UI: Allow scoll views to have specific height.

This commit is contained in:
Unknown W. Brackets 2021-08-29 14:11:32 -07:00
parent cf22268bc1
commit 5e3ffe94b3
2 changed files with 3 additions and 3 deletions

View File

@ -765,10 +765,10 @@ void ScrollView::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec ver
MeasureBySpec(layoutParams_->width, views_[0]->GetMeasuredWidth(), horiz, &measuredWidth_);
}
if (orientation_ == ORIENT_VERTICAL && vert.type != EXACTLY) {
if (measuredHeight_ < views_[0]->GetMeasuredHeight()) {
if (measuredHeight_ < views_[0]->GetMeasuredHeight() && layoutParams_->height < 0.0f) {
measuredHeight_ = views_[0]->GetMeasuredHeight();
}
if (measuredHeight_ < views_[0]->GetBounds().h) {
if (measuredHeight_ < views_[0]->GetBounds().h && layoutParams_->height < 0.0f) {
measuredHeight_ = views_[0]->GetBounds().h;
}
if (vert.type == AT_MOST && measuredHeight_ > vert.size) {

View File

@ -1535,7 +1535,7 @@ void GridSettingsScreen::CreatePopupContents(UI::ViewGroup *parent) {
auto di = GetI18NCategory("Dialog");
auto sy = GetI18NCategory("System");
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, 50, 1.0f));
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
LinearLayout *items = new LinearLayoutList(ORIENT_VERTICAL);
items->Add(new CheckBox(&g_Config.bGridView1, sy->T("Display Recent on a grid")));