mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-05 23:18:32 +00:00
UI: Ask linear child views to stay inside AT_MOST.
Fixes the DevMenu pop up in larger windows.
This commit is contained in:
parent
efbfdbb4a7
commit
9f3415f43f
@ -61,7 +61,7 @@ void DevMenu::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
I18NCategory *dev = GetI18NCategory("Developer");
|
||||
I18NCategory *sy = GetI18NCategory("System");
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
LinearLayout *items = new LinearLayout(ORIENT_VERTICAL);
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
|
@ -410,11 +410,19 @@ void LinearLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec v
|
||||
if (v.type == UNSPECIFIED && measuredHeight_ != 0.0f)
|
||||
v = MeasureSpec(AT_MOST, measuredHeight_);
|
||||
view->Measure(dc, MeasureSpec(UNSPECIFIED, measuredWidth_), v - (float)margins.vert());
|
||||
if (horiz.type == AT_MOST && view->GetMeasuredWidth() + margins.horiz() > horiz.size - weightZeroSum) {
|
||||
// Try again, this time with AT_MOST.
|
||||
view->Measure(dc, horiz, v - (float)margins.vert());
|
||||
}
|
||||
} else if (orientation_ == ORIENT_VERTICAL) {
|
||||
MeasureSpec h = horiz;
|
||||
if (h.type == UNSPECIFIED && measuredWidth_ != 0.0f)
|
||||
h = MeasureSpec(AT_MOST, measuredWidth_);
|
||||
view->Measure(dc, h - (float)margins.horiz(), MeasureSpec(UNSPECIFIED, measuredHeight_));
|
||||
if (vert.type == AT_MOST && view->GetMeasuredHeight() + margins.vert() > vert.size - weightZeroSum) {
|
||||
// Try again, this time with AT_MOST.
|
||||
view->Measure(dc, h - (float)margins.horiz(), vert);
|
||||
}
|
||||
}
|
||||
|
||||
float amount;
|
||||
|
Loading…
x
Reference in New Issue
Block a user