FileTypes: Allow expansion of Supported types box

* In the Application Type window, increase the weight of typeBox so the primary effect of resizing the window is to control height of the Supported types scrollView.
* Increase the height of scrollView so that it extends below the Remove button (presence of a button in a row seems to make row height static, preventing scrollView expansion).
* Modify ComplexLayouter in attempt to address root cause of the initial height of typeBox being too small to properly display the contents.
* Fixes #14936

Change-Id: I94ad8c5c8140814bfc2c399803f4d629ecd467bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4926
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Jim906 2022-02-03 09:42:48 -05:00 committed by Adrien Destugues
parent ffb1567fda
commit f159a01a02
2 changed files with 8 additions and 2 deletions

View File

@ -605,6 +605,12 @@ ComplexLayouter::_ValidateLayout()
Constraint* constraint = fConstraints[i];
while (constraint != NULL) {
int32 minSum = fSums[constraint->start].min + constraint->min;
//Do not allow the cumulative minimum at fSums[i+1].min to be less than the
//cumulative minimum already established at fSums[i].min (fSums[i] may have been
//ignored if fSums[constraint->start] evaluates to, say, fSums[i-1]).
if (minSum < fSums[i].min) {
minSum = fSums[i].min;
}
if (minSum > sum.min) {
sum.min = minSum;
} else {

4
src/preferences/filetypes/ApplicationTypeWindow.cpp Normal file → Executable file
View File

@ -408,7 +408,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
BLayoutBuilder::Grid<>(typeBox, padding, padding)
.SetInsets(padding, padding * 2, padding, padding)
.Add(scrollView, 0, 0, 1, 4)
.Add(scrollView, 0, 0, 1, 5)
.Add(fAddTypeButton, 1, 0, 1, 2)
.Add(fRemoveTypeButton, 1, 2, 1, 2)
.Add(iconHolder, 2, 1, 1, 2)
@ -515,7 +515,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
.Add(flagsBox, 3)
.Add(iconBox, 1)
.End()
.Add(typeBox)
.Add(typeBox, 2)
.Add(versionBox);
SetKeyMenuBar(menuBar);