From 76fb8ce8f92ec38d6ad134a41a090544a59d70fa Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Mon, 25 Jan 2016 11:17:43 -0500 Subject: [PATCH] Hotkey editor: Fix GTK assertion Tried to set negative width when dialog sized too small --- common/widgets/widget_hotkey_list.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index 381367020d..1995ac6e51 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -432,9 +432,16 @@ void WIDGET_HOTKEY_LIST::OnSize( wxSizeEvent& aEvent ) if( 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( 0, rect.width - hk_column_width - HORIZ_MARGIN ); + SetColumnWidth( 0, name_column_width ); }