mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Disabled non-blurred backgrounds when rotating screen 90 or 270 degrees.
This commit is contained in:
parent
c2790f5c2f
commit
b335901ee6
|
@ -728,16 +728,29 @@ void GuiMenu::openUIOptions()
|
|||
|
||||
// Blur background when the menu is open.
|
||||
auto menuBlurBackground = std::make_shared<SwitchComponent>();
|
||||
if (mRenderer->getScreenRotation() == 90 || mRenderer->getScreenRotation() == 270) {
|
||||
// TODO: Add support for non-blurred background when rotating screen 90 or 270 degrees.
|
||||
menuBlurBackground->setState(true);
|
||||
s->addWithLabel("BLUR BACKGROUND WHEN MENU IS OPEN", menuBlurBackground);
|
||||
menuBlurBackground->setEnabled(false);
|
||||
menuBlurBackground->setOpacity(DISABLED_OPACITY);
|
||||
menuBlurBackground->getParent()
|
||||
->getChild(menuBlurBackground->getChildIndex() - 1)
|
||||
->setOpacity(DISABLED_OPACITY);
|
||||
}
|
||||
else {
|
||||
menuBlurBackground->setState(Settings::getInstance()->getBool("MenuBlurBackground"));
|
||||
s->addWithLabel("BLUR BACKGROUND WHEN MENU IS OPEN", menuBlurBackground);
|
||||
s->addSaveFunc([menuBlurBackground, s] {
|
||||
if (menuBlurBackground->getState() !=
|
||||
Settings::getInstance()->getBool("MenuBlurBackground")) {
|
||||
Settings::getInstance()->setBool("MenuBlurBackground", menuBlurBackground->getState());
|
||||
Settings::getInstance()->setBool("MenuBlurBackground",
|
||||
menuBlurBackground->getState());
|
||||
s->setNeedsSaving();
|
||||
s->setInvalidateCachedBackground();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Display pillarboxes (and letterboxes) for videos in the gamelists.
|
||||
auto gamelistVideoPillarbox = std::make_shared<SwitchComponent>();
|
||||
|
|
|
@ -46,6 +46,7 @@ private:
|
|||
void openOtherOptions();
|
||||
void openQuitMenu();
|
||||
|
||||
Renderer* mRenderer;
|
||||
MenuComponent mMenu;
|
||||
TextComponent mVersion;
|
||||
};
|
||||
|
|
|
@ -505,7 +505,10 @@ void Window::render()
|
|||
// of iterations relative to the screen resolution.
|
||||
Renderer::postProcessingParams backgroundParameters;
|
||||
|
||||
if (Settings::getInstance()->getBool("MenuBlurBackground")) {
|
||||
// TODO: Add support for non-blurred background when rotating screen 90 or 270
|
||||
// degrees.
|
||||
if (Settings::getInstance()->getBool("MenuBlurBackground") ||
|
||||
mRenderer->getScreenRotation() == 90 || mRenderer->getScreenRotation() == 270) {
|
||||
const float resolutionModifier {mRenderer->getScreenResolutionModifier()};
|
||||
// clang-format off
|
||||
if (resolutionModifier < 1)
|
||||
|
|
Loading…
Reference in a new issue