From e46b0364820d5934b13bdc76ae71c0fe5dc00aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 3 Dec 2022 19:13:39 +0100 Subject: [PATCH] Reorganize the DisplayLayoutScreen again - flip left/right sides, move mode switch to bottom. --- UI/DisplayLayoutScreen.cpp | 40 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 82ee390b7c..c7286acf62 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -208,31 +208,31 @@ void DisplayLayoutScreen::CreateViews() { rightScrollView->Add(rightColumn); root_->Add(rightScrollView); + LinearLayout *bottomControls = new LinearLayout(ORIENT_HORIZONTAL, new AnchorLayoutParams(NONE, NONE, NONE, 10.0f, false)); + root_->Add(bottomControls); if (!IsVREnabled()) { auto stretch = new CheckBox(&g_Config.bDisplayStretch, gr->T("Stretch")); - leftColumn->Add(stretch); + rightColumn->Add(stretch); PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&g_Config.fDisplayAspectRatio, 0.5f, 2.0f, gr->T("Aspect Ratio"), screenManager()); - leftColumn->Add(aspectRatio); + rightColumn->Add(aspectRatio); aspectRatio->SetDisabledPtr(&g_Config.bDisplayStretch); aspectRatio->SetHasDropShadow(false); aspectRatio->SetLiveUpdate(true); - mode_ = new ChoiceStrip(ORIENT_VERTICAL); + mode_ = new ChoiceStrip(ORIENT_HORIZONTAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)); mode_->AddChoice(di->T("Move")); mode_->AddChoice(di->T("Resize")); mode_->SetSelection(0, false); - leftColumn->Add(mode_); + bottomControls->Add(mode_); static const char *displayRotation[] = { "Landscape", "Portrait", "Landscape Reversed", "Portrait Reversed" }; auto rotation = new PopupMultiChoice(&g_Config.iInternalScreenRotation, gr->T("Rotation"), displayRotation, 1, ARRAY_SIZE(displayRotation), co->GetName(), screenManager()); rotation->SetEnabledFunc([] { return !g_Config.bSkipBufferEffects || g_Config.bSoftwareRendering; }); - leftColumn->Add(rotation); - - leftColumn->Add(new Spacer(12.0f)); + rightColumn->Add(rotation); Choice *center = new Choice(di->T("Reset")); center->OnClick.Add([&](UI::EventParams &) { @@ -242,13 +242,19 @@ void DisplayLayoutScreen::CreateViews() { g_Config.fDisplayOffsetY = 0.5f; return UI::EVENT_DONE; }); - leftColumn->Add(center); + rightColumn->Add(center); + + rightColumn->Add(new Spacer(12.0f)); } - static const char *bufFilters[] = { "Linear", "Nearest", }; - rightColumn->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager())); + Choice *back = new Choice(di->T("Back"), "", false); + back->OnClick.Handle(this, &UIScreen::OnBack); + rightColumn->Add(back); - rightColumn->Add(new ItemHeader(gr->T("Postprocessing effect"))); + static const char *bufFilters[] = { "Linear", "Nearest", }; + leftColumn->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager())); + + leftColumn->Add(new ItemHeader(gr->T("Postprocessing effect"))); Draw::DrawContext *draw = screenManager()->getDrawContext(); @@ -262,8 +268,8 @@ void DisplayLayoutScreen::CreateViews() { for (int i = 0; i < (int)g_Config.vPostShaderNames.size() + 1 && i < ARRAY_SIZE(shaderNames_); ++i) { // Vector element pointer get invalidated on resize, cache name to have always a valid reference in the rendering thread shaderNames_[i] = i == g_Config.vPostShaderNames.size() ? "Off" : g_Config.vPostShaderNames[i]; - rightColumn->Add(new ItemHeader(StringFromFormat("%s #%d", gr->T("Postprocessing Shader"), i + 1))); - postProcChoice_ = rightColumn->Add(new ChoiceWithValueDisplay(&shaderNames_[i], "", &PostShaderTranslateName)); + leftColumn->Add(new ItemHeader(StringFromFormat("%s #%d", gr->T("Postprocessing Shader"), i + 1))); + postProcChoice_ = leftColumn->Add(new ChoiceWithValueDisplay(&shaderNames_[i], "", &PostShaderTranslateName)); postProcChoice_->OnClick.Add([=](EventParams &e) { auto gr = GetI18NCategory("Graphics"); auto procScreen = new PostProcScreen(gr->T("Postprocessing Shader"), i, false); @@ -293,10 +299,10 @@ void DisplayLayoutScreen::CreateViews() { auto &value = g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderInfo->section.c_str(), i + 1)]; if (duplicated) { auto sliderName = StringFromFormat("%s %s", ps->T(setting.name), ps->T("(duplicated setting, previous slider will be used)")); - PopupSliderChoiceFloat *settingValue = rightColumn->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, sliderName, setting.step, screenManager())); + PopupSliderChoiceFloat *settingValue = leftColumn->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, sliderName, setting.step, screenManager())); settingValue->SetEnabled(false); } else { - PopupSliderChoiceFloat *settingValue = rightColumn->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, ps->T(setting.name), setting.step, screenManager())); + PopupSliderChoiceFloat *settingValue = leftColumn->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, ps->T(setting.name), setting.step, screenManager())); settingValue->SetLiveUpdate(true); settingValue->SetHasDropShadow(false); settingValue->SetEnabledFunc([=] { @@ -308,9 +314,5 @@ void DisplayLayoutScreen::CreateViews() { } } - Choice *back = new Choice(di->T("Back"), "", false); - back->OnClick.Handle(this, &UIScreen::OnBack); - rightColumn->Add(back); - root_->Add(new DisplayLayoutBackground(mode_, new AnchorLayoutParams(FILL_PARENT, FILL_PARENT, 0.0f, 0.0f, 0.0f, 0.0f))); }