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.
|
// Blur background when the menu is open.
|
||||||
auto menuBlurBackground = std::make_shared<SwitchComponent>();
|
auto menuBlurBackground = std::make_shared<SwitchComponent>();
|
||||||
menuBlurBackground->setState(Settings::getInstance()->getBool("MenuBlurBackground"));
|
if (mRenderer->getScreenRotation() == 90 || mRenderer->getScreenRotation() == 270) {
|
||||||
s->addWithLabel("BLUR BACKGROUND WHEN MENU IS OPEN", menuBlurBackground);
|
// TODO: Add support for non-blurred background when rotating screen 90 or 270 degrees.
|
||||||
s->addSaveFunc([menuBlurBackground, s] {
|
menuBlurBackground->setState(true);
|
||||||
if (menuBlurBackground->getState() !=
|
s->addWithLabel("BLUR BACKGROUND WHEN MENU IS OPEN", menuBlurBackground);
|
||||||
Settings::getInstance()->getBool("MenuBlurBackground")) {
|
menuBlurBackground->setEnabled(false);
|
||||||
Settings::getInstance()->setBool("MenuBlurBackground", menuBlurBackground->getState());
|
menuBlurBackground->setOpacity(DISABLED_OPACITY);
|
||||||
s->setNeedsSaving();
|
menuBlurBackground->getParent()
|
||||||
s->setInvalidateCachedBackground();
|
->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());
|
||||||
|
s->setNeedsSaving();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Display pillarboxes (and letterboxes) for videos in the gamelists.
|
// Display pillarboxes (and letterboxes) for videos in the gamelists.
|
||||||
auto gamelistVideoPillarbox = std::make_shared<SwitchComponent>();
|
auto gamelistVideoPillarbox = std::make_shared<SwitchComponent>();
|
||||||
|
|
|
@ -46,6 +46,7 @@ private:
|
||||||
void openOtherOptions();
|
void openOtherOptions();
|
||||||
void openQuitMenu();
|
void openQuitMenu();
|
||||||
|
|
||||||
|
Renderer* mRenderer;
|
||||||
MenuComponent mMenu;
|
MenuComponent mMenu;
|
||||||
TextComponent mVersion;
|
TextComponent mVersion;
|
||||||
};
|
};
|
||||||
|
|
|
@ -505,7 +505,10 @@ void Window::render()
|
||||||
// of iterations relative to the screen resolution.
|
// of iterations relative to the screen resolution.
|
||||||
Renderer::postProcessingParams backgroundParameters;
|
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()};
|
const float resolutionModifier {mRenderer->getScreenResolutionModifier()};
|
||||||
// clang-format off
|
// clang-format off
|
||||||
if (resolutionModifier < 1)
|
if (resolutionModifier < 1)
|
||||||
|
|
Loading…
Reference in a new issue