Skip to content

Commit

Permalink
Nothing, wip.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpartanJ committed Jan 24, 2025
1 parent 5d12968 commit 4315808
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
5 changes: 5 additions & 0 deletions include/eepp/ui/abstract/uiabstracttableview.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ class EE_API UIAbstractTableView : public UIAbstractView {
/** In pixels. */
void setColumnWidth( const size_t& colIndex, const Float& width );

void setColumnMaxWidth( const size_t& colIndex, const Float& width );

/** In pixels. */
void setColumnsWidth( const Float& width );

void setColumnsMaxWidth( const Float& width );

const Float& getColumnWidth( const size_t& colIndex ) const;

virtual Float getMaxColumnContentWidth( const size_t& colIndex, bool bestGuess = false );
Expand Down Expand Up @@ -138,6 +142,7 @@ class EE_API UIAbstractTableView : public UIAbstractView {
struct ColumnData {
Float minWidth{ 0 };
Float minHeight{ 0 };
Float maxWidth{ 0 };
Float width{ 0 };
bool visible{ true };
UIPushButton* widget{ nullptr };
Expand Down
34 changes: 32 additions & 2 deletions src/eepp/ui/abstract/uiabstracttableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ void UIAbstractTableView::setColumnWidth( const size_t& colIndex, const Float& w
}
}

void UIAbstractTableView::setColumnMaxWidth( const size_t& colIndex, const Float& width ) {
if ( columnData( colIndex ).maxWidth != width ) {
columnData( colIndex ).maxWidth = width;
if ( columnData( colIndex ).width > width ) {
updateHeaderSize();
onColumnSizeChange( colIndex );
createOrUpdateColumns( false );
}
}
}

void UIAbstractTableView::setColumnsWidth( const Float& width ) {
if ( !getModel() )
return;
Expand All @@ -69,6 +80,22 @@ void UIAbstractTableView::setColumnsWidth( const Float& width ) {
createOrUpdateColumns( false );
}

void UIAbstractTableView::setColumnsMaxWidth( const Float& width ) {
if ( !getModel() )
return;
bool needsRefresh = false;
for ( size_t i = 0; i < getModel()->columnCount(); i++ ) {
if ( columnData( i ).width > width )
needsRefresh = true;
columnData( i ).maxWidth = width;
onColumnSizeChange( i );
}
if ( needsRefresh ) {
updateHeaderSize();
createOrUpdateColumns( false );
}
}

const Float& UIAbstractTableView::getColumnWidth( const size_t& colIndex ) const {
return columnData( colIndex ).width;
}
Expand Down Expand Up @@ -111,6 +138,7 @@ void UIAbstractTableView::resetColumnData() {
for ( size_t i = 0; i < count; i++ ) {
ColumnData& col = columnData( i );
col.minWidth = 0;
col.maxWidth = 0;
}
}

Expand Down Expand Up @@ -145,7 +173,8 @@ void UIAbstractTableView::createOrUpdateColumns( bool resetColumnData ) {
col.minWidth = col.widget->getPixelsSize().getWidth();
col.minHeight = col.widget->getPixelsSize().getHeight();
}
col.width = eeceil( eemax( col.width, col.minWidth ) );
col.width = eeceil( col.maxWidth != 0 ? eeclamp( col.width, col.minWidth, col.maxWidth )
: eemax( col.width, col.minWidth ) );
col.widget->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed );
col.widget->setPixelsSize( col.width, getHeaderHeight() );
}
Expand Down Expand Up @@ -198,7 +227,8 @@ void UIAbstractTableView::createOrUpdateColumns( bool resetColumnData ) {
ColumnData& col = columnData( i );
if ( !col.visible )
continue;
col.width = eeceil( eemax( col.width, col.minWidth ) );
col.width = eeceil( col.maxWidth != 0 ? eeclamp( col.width, col.minWidth, col.maxWidth )
: eemax( col.width, col.minWidth ) );
col.widget->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed );
col.widget->setPixelsSize( col.width, getHeaderHeight() );
totalWidth += col.width;
Expand Down
1 change: 1 addition & 0 deletions src/tools/ecode/plugins/debugger/debuggerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ void DebuggerPlugin::loadDAPConfig( const std::string& path, bool updateConfigFi
}

if ( mKeyBindings.empty() ) {
mKeyBindings["debugger-start"] = "mod+f5";
mKeyBindings["debugger-continue-interrupt"] = "f5";
mKeyBindings["debugger-breakpoint-toggle"] = "f9";
mKeyBindings["debugger-breakpoint-enable-toggle"] = "mod+f9";
Expand Down

0 comments on commit 4315808

Please sign in to comment.