[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
This commit is contained in:
Fabrice de Gans 2024-09-28 10:38:28 -07:00 committed by GitHub
parent 4c450ab360
commit e1c2ecc584
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View File

@ -145,9 +145,11 @@ AccelConfig::AccelConfig(wxWindow* parent,
PopulateTreeWithMenu(&command_to_item_id_, tree_, id, menu->GetMenu(i), recents, PopulateTreeWithMenu(&command_to_item_id_, tree_, id, menu->GetMenu(i), recents,
menu->GetMenuLabelText(i) + '\n'); menu->GetMenuLabelText(i) + '\n');
} }
tree_->ExpandAll();
tree_->SelectItem(menu_id); 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; int w, h;
current_keys_->GetTextExtent("CTRL-ALT-SHIFT-ENTER", &w, &h); current_keys_->GetTextExtent("CTRL-ALT-SHIFT-ENTER", &w, &h);
wxSize size(w, h); wxSize size(w, h);

View File

@ -97,7 +97,7 @@ public:
bool pending_fullscreen; bool pending_fullscreen;
#if __WXMAC__ #if __WXMAC__
// I suppose making this work will require tweaking the bundle // I suppose making this work will require tweaking the bundle
void MacOpenFile(const wxString& f) void MacOpenFile(const wxString& f) override
{ {
pending_load = f; pending_load = f;
}; };

View File

@ -2,7 +2,7 @@
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0"> <resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="AccelConfig"> <object class="wxDialog" name="AccelConfig">
<title>Key Shortcuts</title> <title>Key Shortcuts</title>
<style>wxRESIZE_BORDER</style> <style>wxRESIZE_BORDER|wxCLOSE_BOX</style>
<object class="wxBoxSizer"> <object class="wxBoxSizer">
<orient>wxVERTICAL</orient> <orient>wxVERTICAL</orient>
<flag>wxEXPAND</flag> <flag>wxEXPAND</flag>
@ -56,6 +56,7 @@
</object> </object>
</object> </object>
<object class="sizeritem"> <object class="sizeritem">
<flag>wxEXPAND</flag>
<object class="wxBoxSizer"> <object class="wxBoxSizer">
<object class="sizeritem"> <object class="sizeritem">
<object class="wxButton" name="Assign"> <object class="wxButton" name="Assign">
@ -80,7 +81,6 @@
</object> </object>
<orient>wxVERTICAL</orient> <orient>wxVERTICAL</orient>
</object> </object>
<flag>wxEXPAND</flag>
</object> </object>
<object class="sizeritem"> <object class="sizeritem">
<flag>wxALL</flag> <flag>wxALL</flag>
@ -98,6 +98,7 @@
</object> </object>
</object> </object>
<object class="sizeritem"> <object class="sizeritem">
<flag>wxEXPAND</flag>
<object class="wxBoxSizer"> <object class="wxBoxSizer">
<object class="sizeritem"> <object class="sizeritem">
<flag>wxALL</flag> <flag>wxALL</flag>
@ -113,7 +114,6 @@
</object> </object>
<orient>wxVERTICAL</orient> <orient>wxVERTICAL</orient>
</object> </object>
<flag>wxEXPAND</flag>
</object> </object>
</object> </object>
</object> </object>