Auto-size buttons in bottom panels #3576
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problems
CKAN/GUI/Controls/DeleteDirectories.resx
Line 126 in 4f3da57
Causes
Anchor
to position themselves and have hard coded sizes, and if those sizes aren't big enough to fit the text, it is truncated. Due to differences in fonts, we have enough space for "Delete Checked" on Linux bot not on Windows.ForeColor
we set is ignored because we aren't settingBackColor
. The text color change happens becauseMainTabControl
is disabled, which cascades into disabling the log text box.Changes
LeftRightRowPanel
control hosts two groups of controls, one in.LeftControls
and the other in.RightControls
. These are passed through to a pair ofFlowLayoutPanel
s, which themselves are hosted in the cells of a one-rowTableLayoutPanel
. Controls hosted in such a way will be positioned nicely while also being able to autosize themselves.BottomButtonPanel
now useLeftRightRowPanel
for it, and the buttons contained therein have autosizing enabled inGrowOnly
mode, so they will expand if needed to fit their contents but otherwise keep a nice friendly width for easy clicking:As a bonus, the buttons even wrap nicely when space is very limited:
BottomButtonPanel
which cannot be easily split into left and right flow layout groups. This panel is now renamedBottomPanel
to distinguish it from the ones that only contain Buttons.AutoSize
property but notAutoSizeMode
, so we have to choose between static sizes and making them smaller in some cases. For now I have left them with static sizes.BackColor
, which makes the text color render correctly in all cases. The disabling ofMainTabControl
is replaced with calls totabController.SetTabLock
, which is how we are supposed to disable the tab control.