Minor hotkey list panel layout improvement.

Use wxCOL_WIDTH_AUTOSIZE instead of fixed column sizes.  This doesn't fix
the initial sizer layout issue on wxWidgets 3.0 but at least resizing the
dialog has better column width behavior.
This commit is contained in:
Wayne Stambaugh 2020-11-16 17:46:39 -05:00
parent 377960d4be
commit 577e99d49d
3 changed files with 15 additions and 19 deletions

View File

@ -57,4 +57,4 @@ DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS( EDA_BASE_FRAME* aParent, TOOL_MANAGER*
bool DIALOG_LIST_HOTKEYS::TransferDataToWindow()
{
return m_hk_list->TransferDataToWindow();
}
}

View File

@ -80,17 +80,15 @@ PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aW
mainSizer->Add( bMargins, 1, wxEXPAND | wxRIGHT | wxLEFT, side_margins );
SetSizer( mainSizer );
Layout();
#ifdef __WXGTK__
// Work around a bug that clips the text vertically in the wxSearchCtrl on GTK
filterSearch->SetMinSize( wxSize( filterSearch->GetSize().x,
int( filterSearch->GetSize().y * 1.6 ) ) );
Layout();
#endif
SetSizer( mainSizer );
Layout();
// Connect Events
filterSearch->Bind( wxEVT_COMMAND_TEXT_UPDATED, &PANEL_HOTKEYS_EDITOR::OnFilterSearch, this );
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Chris Pavlina <pavlina.chris@gmail.com>
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -45,9 +45,9 @@ enum ID_WHKL_MENU_IDS
/**
* WIDGET_HOTKEY_CLIENT_DATA
* Stores the hotkey change data associated with each row. To change a
* hotkey, edit it via GetCurrentValue() in the row's client data, then call
* Store the hotkey change data associated with each row.
*
* To change a hotkey, edit it via GetCurrentValue() in the row's client data, then call
* WIDGET_HOTKEY_LIST::UpdateFromClientData().
*/
class WIDGET_HOTKEY_CLIENT_DATA : public wxClientData
@ -64,7 +64,6 @@ public:
/**
* HK_PROMPT_DIALOG
* Dialog to prompt the user to enter a key.
*/
class HK_PROMPT_DIALOG : public DIALOG_SHIM
@ -213,8 +212,6 @@ protected:
/**
* HOTKEY_FILTER
*
* Class to manage logic for filtering hotkeys based on user input
*/
class HOTKEY_FILTER
@ -227,9 +224,7 @@ public:
}
/**
* Method FilterMatches
*
* Checks if the filter matches the given hotkey
* Check if the filter matches the given hotkey
*
* @return true on match (or if filter is disabled)
*/
@ -456,9 +451,12 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey
if( !m_readOnly )
command_header << " " << _( "(double-click to edit)" );
AppendColumn( command_header, 320, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE );
AppendColumn( _( "Hotkey" ), 110, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE );
AppendColumn( _( "Description" ), 1000, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE );
AppendColumn( command_header, wxCOL_WIDTH_AUTOSIZE, wxALIGN_LEFT,
wxCOL_RESIZABLE | wxCOL_SORTABLE );
AppendColumn( _( "Hotkey" ), wxCOL_WIDTH_AUTOSIZE, wxALIGN_LEFT,
wxCOL_RESIZABLE | wxCOL_SORTABLE );
AppendColumn( _( "Description" ), wxCOL_WIDTH_AUTOSIZE, wxALIGN_LEFT,
wxCOL_RESIZABLE | wxCOL_SORTABLE );
GetDataView()->SetIndent( 10 );
if( !m_readOnly )