From e1c2ecc584e0ca495dbe6be4ef845135366181eb Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Sat, 28 Sep 2024 10:38:28 -0700 Subject: [PATCH] [dialogs] Display all controls in AccelConfig on Mac (#1349) Calling `ExpandAll()` on the `wxTreeCtrl` would cause it to display outside of its intended view, hiding other controls. Instead, this sets a minimum size for the tree control, so the default window size is reasonable. Fixes #1348 --- src/wx/dialogs/accel-config.cpp | 4 +++- src/wx/wxvbam.h | 2 +- src/wx/xrc/AccelConfig.xrc | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wx/dialogs/accel-config.cpp b/src/wx/dialogs/accel-config.cpp index 7f69f365..9b57c97e 100644 --- a/src/wx/dialogs/accel-config.cpp +++ b/src/wx/dialogs/accel-config.cpp @@ -145,9 +145,11 @@ AccelConfig::AccelConfig(wxWindow* parent, PopulateTreeWithMenu(&command_to_item_id_, tree_, id, menu->GetMenu(i), recents, menu->GetMenuLabelText(i) + '\n'); } - tree_->ExpandAll(); tree_->SelectItem(menu_id); + // Set a minimum size for the tree so the default dialog size is reasonable. + tree_->SetMinSize(wxSize(300, 300)); + int w, h; current_keys_->GetTextExtent("CTRL-ALT-SHIFT-ENTER", &w, &h); wxSize size(w, h); diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index 48661b82..49a1fcb1 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -97,7 +97,7 @@ public: bool pending_fullscreen; #if __WXMAC__ // I suppose making this work will require tweaking the bundle - void MacOpenFile(const wxString& f) + void MacOpenFile(const wxString& f) override { pending_load = f; }; diff --git a/src/wx/xrc/AccelConfig.xrc b/src/wx/xrc/AccelConfig.xrc index 0788cce5..c6c27fdb 100644 --- a/src/wx/xrc/AccelConfig.xrc +++ b/src/wx/xrc/AccelConfig.xrc @@ -2,7 +2,7 @@ Key Shortcuts - + wxVERTICAL wxEXPAND @@ -56,6 +56,7 @@ + wxEXPAND @@ -80,7 +81,6 @@ wxVERTICAL - wxEXPAND wxALL @@ -98,6 +98,7 @@ + wxEXPAND wxALL @@ -113,7 +114,6 @@ wxVERTICAL - wxEXPAND