mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Merge branch '653-properly-apply-z-index-in-the-system-view' into 575-theme-add-a-modern-clean-switch-like-theme-as-an-official-theme-in-es-de-to-choose-from
This commit is contained in:
commit
bb6363dab2
|
@ -467,16 +467,35 @@ void SystemView::render(const glm::mat4& parentTrans)
|
|||
|
||||
glm::mat4 trans{getTransform() * parentTrans};
|
||||
|
||||
renderExtras(trans, INT16_MIN, INT16_MAX);
|
||||
if (mCarousel.legacyZIndexMode) {
|
||||
// Render all extras.
|
||||
renderExtras(trans, INT16_MIN, INT16_MAX);
|
||||
|
||||
// Fade the screen if we're using fade transitions and we're currently transitioning.
|
||||
// This basically renders a black rectangle on top of the currently visible extras
|
||||
// (and beneath the carousel and help prompts).
|
||||
if (mExtrasFadeOpacity)
|
||||
renderFade(trans);
|
||||
// Fade the screen if we're using fade transitions and we're currently transitioning.
|
||||
// This basically renders a black rectangle on top of the currently visible extras
|
||||
// (and beneath the carousel and help prompts).
|
||||
if (mExtrasFadeOpacity)
|
||||
renderFade(trans);
|
||||
|
||||
// Always render the carousel on top so that it's not faded.
|
||||
renderCarousel(trans);
|
||||
// Always render the carousel on top so that it's not faded.
|
||||
renderCarousel(trans);
|
||||
}
|
||||
else {
|
||||
// Render the extras that are below the carousel.
|
||||
renderExtras(trans, INT16_MIN, mCarousel.zIndex);
|
||||
|
||||
// Fade the screen if we're using fade transitions and we're currently transitioning.
|
||||
// This basically renders a black rectangle on top of the currently visible extras
|
||||
// (and beneath the carousel and help prompts).
|
||||
if (mExtrasFadeOpacity)
|
||||
renderFade(trans);
|
||||
|
||||
// Render the carousel.
|
||||
renderCarousel(trans);
|
||||
|
||||
// Render the rest of the extras.
|
||||
renderExtras(trans, mCarousel.zIndex, INT16_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<HelpPrompt> SystemView::getHelpPrompts()
|
||||
|
@ -806,4 +825,11 @@ void SystemView::getCarouselFromTheme(const ThemeData::ThemeElement* elem)
|
|||
else
|
||||
mCarousel.logoAlignment = ALIGN_CENTER;
|
||||
}
|
||||
if (elem->has("legacyZIndexMode")) {
|
||||
mCarousel.legacyZIndexMode =
|
||||
elem->get<std::string>("legacyZIndexMode").compare("true") == 0 ? true : false;
|
||||
}
|
||||
else {
|
||||
mCarousel.legacyZIndexMode = true;
|
||||
}
|
||||
}
|
|
@ -48,6 +48,7 @@ struct SystemViewCarousel {
|
|||
int maxLogoCount; // Number of logos shown on the carousel.
|
||||
glm::vec2 logoSize;
|
||||
float zIndex;
|
||||
bool legacyZIndexMode;
|
||||
};
|
||||
|
||||
class SystemView : public IList<SystemViewData, SystemData*>
|
||||
|
|
|
@ -210,7 +210,8 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>> The
|
|||
{"logoSize", NORMALIZED_PAIR},
|
||||
{"logoAlignment", STRING},
|
||||
{"maxLogoCount", FLOAT},
|
||||
{"zIndex", FLOAT}}}};
|
||||
{"zIndex", FLOAT},
|
||||
{"legacyZIndexMode", STRING}}}};
|
||||
|
||||
#define MINIMUM_THEME_FORMAT_VERSION 3
|
||||
#define CURRENT_THEME_FORMAT_VERSION 7
|
||||
|
|
Loading…
Reference in a new issue