-
Notifications
You must be signed in to change notification settings - Fork 586
Adjust the default (=minimum) width of the style editor #490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
src/dialog_style_editor.cpp
Outdated
| add_with_label(OutlineBox, _("Shadow:"), Shadow); | ||
| add_with_label(OutlineBox, _("Border style:"), OutlineType); | ||
| OutlineBox->Add(new wxStaticText(this, -1, _("Border style:")), wxSizerFlags().Center().HorzBorder()); | ||
| OutlineBox->Add(OutlineType, wxSizerFlags().Left().Expand()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, I'd rather add an optional parameter proportion to add_with_label. As far as I can tell, the sizer flags for the label match here match the one in add_with_label, right?
|
After thinking for a while longer, I considered deeper questions which confused me again. What behavior do we expect the dialog box to exhibit when it is "stretched and widened"? I feel that the behavior prior to this PR, scaling these two spinboxes proportionally to the combobox, is reasonable. |
|
I was barking up the wrong tree :-( |
83f4ab9 to
246c751
Compare
|
The code is ready for review, although the commit message appears verbose and warrants discussion. Perhaps a more concise explanation of the rationale behind this change could be provided. |
Previously, the Outline/Shadow spinboxes and the Border Style combobox shared a fixed sizer proportion of 1. Because the combobox has a much wider natural size than the spinboxes, the wxBoxSizer forced the spinboxes to stretch excessively to match the combobox's width. This changes `add_with_label` to use the control's natural width (`GetBestSize().GetWidth()`) as its sizer proportion instead of a fixed value. By weighting the proportion based on width, the layout achieves two goals: 1. At the default dialog size, the spinboxes are not forced to expand to match the wider combobox, allowing them to retain their compact, natural size. 2. When the dialog is resized horizontally, all controls expand together, distributing the extra space relative to their original widths, rather than the combobox remaining fixed or the spinboxes growing disproportionately.
246c751 to
a2c7031
Compare
|
I actually prefer the suggestion you had before, i.e. just giving the combobox a proportion of 0 and making only the two spin controls expand with the dialog. That helps visually separate the combobox from the spin controls a bit, and is more likely to be what the user wants. And yes, I'm not really a fan of overly verbose LLM-generated commit messages. Commit messages should explain why a change was made (like e.g. what bugs it fixes) and why a specific solution was chosen over other options, but they don't need to explain the code itself - if the code needs to be explained, that should happen in comments. |









Before:

After:
