Hotkey editor: Fix GTK assertion

Tried to set negative width when dialog sized too small
This commit is contained in:
Chris Pavlina 2016-01-25 11:17:43 -05:00
parent e51adaeefd
commit 76fb8ce8f9
1 changed files with 8 additions and 1 deletions

View File

@ -432,9 +432,16 @@ void WIDGET_HOTKEY_LIST::OnSize( wxSizeEvent& aEvent )
if( hk_column_width < HOTKEY_MIN_WIDTH ) if( hk_column_width < HOTKEY_MIN_WIDTH )
hk_column_width = HOTKEY_MIN_WIDTH; hk_column_width = HOTKEY_MIN_WIDTH;
else if( hk_column_width <= 0 )
hk_column_width = 1;
int name_column_width = rect.width - hk_column_width - HORIZ_MARGIN;
if( name_column_width <= 0 )
name_column_width = 1;
SetColumnWidth( 1, hk_column_width ); SetColumnWidth( 1, hk_column_width );
SetColumnWidth( 0, rect.width - hk_column_width - HORIZ_MARGIN ); SetColumnWidth( 0, name_column_width );
} }