diff --git a/Common/UI/ViewGroup.cpp b/Common/UI/ViewGroup.cpp index f32bd6fd37..ce030a3249 100644 --- a/Common/UI/ViewGroup.cpp +++ b/Common/UI/ViewGroup.cpp @@ -928,6 +928,8 @@ void ScrollView::Draw(UIContext &dc) { } dc.PushScissor(bounds_); + dc.FillRect(bg_, bounds_); + // For debugging layout issues, this can be useful. // dc.FillRect(Drawable(0x60FF00FF), bounds_); views_[0]->Draw(dc); diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 432e3b5eaa..9efb29688a 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -218,6 +218,11 @@ void DisplayLayoutScreen::CreateViews() { LinearLayout *bottomControls = new LinearLayout(ORIENT_HORIZONTAL, new AnchorLayoutParams(NONE, NONE, NONE, 10.0f, false)); root_->Add(bottomControls); + // Set backgrounds for readability + Drawable backgroundWithAlpha(GetBackgroundColorWithAlpha(*screenManager()->getUIContext())); + leftScrollView->SetBG(backgroundWithAlpha); + rightScrollView->SetBG(backgroundWithAlpha); + if (!IsVREnabled()) { auto stretch = new CheckBox(&g_Config.bDisplayStretch, gr->T("Stretch")); rightColumn->Add(stretch); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index e00ec856a0..f880935e08 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -356,6 +356,10 @@ void DrawBackground(UIContext &dc, float alpha, float x, float y, float z) { } } +uint32_t GetBackgroundColorWithAlpha(UIContext &dc) { + return colorAlpha(colorBlend(dc.GetTheme().backgroundColor, 0, 0.5f), 0.65f); // 0.65 = 166 = A6 +} + void DrawGameBackground(UIContext &dc, const Path &gamePath, float x, float y, float z, bool darkenBackground) { using namespace Draw; using namespace UI; @@ -379,7 +383,7 @@ void DrawGameBackground(UIContext &dc, const Path &gamePath, float x, float y, f dc.Begin(); if (darkenBackground) { - uint32_t color = colorAlpha(colorBlend(dc.GetTheme().backgroundColor, 0, 0.5f), 0.65f); + uint32_t color = GetBackgroundColorWithAlpha(dc); dc.FillRect(UI::Drawable(color), dc.GetBounds()); dc.Flush(); } diff --git a/UI/MiscScreens.h b/UI/MiscScreens.h index 07f544f855..d218739a78 100644 --- a/UI/MiscScreens.h +++ b/UI/MiscScreens.h @@ -192,3 +192,5 @@ private: float cutOffY_; bool showing_ = false; }; + +uint32_t GetBackgroundColorWithAlpha(UIContext &dc);