mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 23:15:38 +00:00
Added a simple static scroll indicator and set this as the default.
Also made some minor adjustments to the scroll indicator placement.
This commit is contained in:
parent
ca64fc8308
commit
76ef1629c0
|
@ -500,8 +500,8 @@ void GuiMetaDataEd::onSizeChanged()
|
||||||
mGrid.setRowHeightPerc(3, (titleSubtitleSpacing * 1.2f) / mSize.y);
|
mGrid.setRowHeightPerc(3, (titleSubtitleSpacing * 1.2f) / mSize.y);
|
||||||
mGrid.setRowHeightPerc(4, ((mList->getRowHeight(0) * 10.0f) + 2.0f) / mSize.y);
|
mGrid.setRowHeightPerc(4, ((mList->getRowHeight(0) * 10.0f) + 2.0f) / mSize.y);
|
||||||
|
|
||||||
mGrid.setColWidthPerc(0, 0.08f);
|
mGrid.setColWidthPerc(0, 0.07f);
|
||||||
mGrid.setColWidthPerc(2, 0.08f);
|
mGrid.setColWidthPerc(2, 0.07f);
|
||||||
|
|
||||||
mGrid.setSize(mSize);
|
mGrid.setSize(mSize);
|
||||||
mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f});
|
mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f});
|
||||||
|
|
|
@ -181,7 +181,7 @@ void Settings::setDefaults()
|
||||||
mBoolMap["SpecialCharsASCII"] = {false, false};
|
mBoolMap["SpecialCharsASCII"] = {false, false};
|
||||||
mBoolMap["ListScrollOverlay"] = {false, false};
|
mBoolMap["ListScrollOverlay"] = {false, false};
|
||||||
mBoolMap["VirtualKeyboard"] = {true, true};
|
mBoolMap["VirtualKeyboard"] = {true, true};
|
||||||
mBoolMap["ScrollIndicators"] = {true, true};
|
mBoolMap["ScrollIndicators"] = {false, false};
|
||||||
mBoolMap["FavoritesAddButton"] = {true, true};
|
mBoolMap["FavoritesAddButton"] = {true, true};
|
||||||
mBoolMap["RandomAddButton"] = {false, false};
|
mBoolMap["RandomAddButton"] = {false, false};
|
||||||
mBoolMap["GamelistFilters"] = {true, true};
|
mBoolMap["GamelistFilters"] = {true, true};
|
||||||
|
|
|
@ -127,8 +127,8 @@ void MenuComponent::onSizeChanged()
|
||||||
mGrid.setRowHeightPerc(1, TITLE_HEIGHT / mSize.y / 2.0f);
|
mGrid.setRowHeightPerc(1, TITLE_HEIGHT / mSize.y / 2.0f);
|
||||||
mGrid.setRowHeightPerc(3, getButtonGridHeight() / mSize.y);
|
mGrid.setRowHeightPerc(3, getButtonGridHeight() / mSize.y);
|
||||||
|
|
||||||
mGrid.setColWidthPerc(0, 0.08f);
|
mGrid.setColWidthPerc(0, 0.07f);
|
||||||
mGrid.setColWidthPerc(2, 0.08f);
|
mGrid.setColWidthPerc(2, 0.07f);
|
||||||
|
|
||||||
mGrid.setSize(mSize);
|
mGrid.setSize(mSize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,21 @@ public:
|
||||||
scrollUp->setOpacity(0);
|
scrollUp->setOpacity(0);
|
||||||
scrollDown->setOpacity(0);
|
scrollDown->setOpacity(0);
|
||||||
|
|
||||||
if (!Settings::getInstance()->getBool("ScrollIndicators"))
|
if (!Settings::getInstance()->getBool("ScrollIndicators")) {
|
||||||
return;
|
// If the scroll indicators setting is disabled, then show a permanent down arrow
|
||||||
|
// symbol when the component list contains more entries than can fit on screen.
|
||||||
|
componentList.get()->setScrollIndicatorChangedCallback(
|
||||||
|
[scrollUp, scrollDown](ComponentList::ScrollIndicator state) {
|
||||||
|
if (state == ComponentList::SCROLL_UP ||
|
||||||
|
state == ComponentList::SCROLL_UP_DOWN ||
|
||||||
|
state == ComponentList::SCROLL_DOWN) {
|
||||||
|
scrollDown->setOpacity(255);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// If the scroll indicator setting is enabled, then also show the up and up/down
|
||||||
|
// combination and switch between these as the list is scrolled.
|
||||||
componentList.get()->setScrollIndicatorChangedCallback(
|
componentList.get()->setScrollIndicatorChangedCallback(
|
||||||
[this, scrollUp, scrollDown](ComponentList::ScrollIndicator state) {
|
[this, scrollUp, scrollDown](ComponentList::ScrollIndicator state) {
|
||||||
float fadeInTime{FADE_IN_TIME};
|
float fadeInTime{FADE_IN_TIME};
|
||||||
|
@ -93,8 +105,8 @@ public:
|
||||||
static_cast<unsigned char>(glm::mix(0.0f, 1.0f, t) * 255));
|
static_cast<unsigned char>(glm::mix(0.0f, 1.0f, t) * 255));
|
||||||
};
|
};
|
||||||
scrollUp->setAnimation(
|
scrollUp->setAnimation(
|
||||||
new LambdaAnimation(upFadeInFunc, static_cast<int>(fadeInTime)), 0, nullptr,
|
new LambdaAnimation(upFadeInFunc, static_cast<int>(fadeInTime)), 0,
|
||||||
false);
|
nullptr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upFadeOut) {
|
if (upFadeOut) {
|
||||||
|
@ -130,6 +142,7 @@ public:
|
||||||
mPreviousScrollState = state;
|
mPreviousScrollState = state;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ComponentList::ScrollIndicator mPreviousScrollState;
|
ComponentList::ScrollIndicator mPreviousScrollState;
|
||||||
|
|
Loading…
Reference in a new issue