Show default values
This commit is contained in:
@@ -262,6 +262,31 @@ std::string EpubReaderMenuActivity::getItemValueString(int index) const {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (item.type == SettingType::ENUM) {
|
||||
if (item.nameId == StrId::STR_EMBEDDED_STYLE && pendingEmbeddedStyleOverride < 0) {
|
||||
const auto defaultEffective = (SETTINGS.embeddedStyle != 0) ? tr(STR_STATE_ON) : tr(STR_STATE_OFF);
|
||||
return std::string(tr(STR_DEFAULT_VALUE)) + " (" + defaultEffective + ")";
|
||||
}
|
||||
if (item.nameId == StrId::STR_IMAGES && pendingImageRenderingOverride < 0) {
|
||||
const auto index = static_cast<size_t>(SETTINGS.imageRendering + 1);
|
||||
if (index < item.enumValues.size()) {
|
||||
return std::string(tr(STR_DEFAULT_VALUE)) + " (" + I18N.get(item.enumValues[index]) + ")";
|
||||
}
|
||||
}
|
||||
if (item.nameId == StrId::STR_FONT_FAMILY && pendingFontFamilyOverride < 0) {
|
||||
const auto index = static_cast<size_t>(SETTINGS.fontFamily + 1);
|
||||
if (index < item.enumValues.size()) {
|
||||
return std::string(tr(STR_DEFAULT_VALUE)) + " (" + I18N.get(item.enumValues[index]) + ")";
|
||||
}
|
||||
}
|
||||
if (item.nameId == StrId::STR_FONT_SIZE && pendingFontSizeOverride < 0) {
|
||||
const auto index = static_cast<size_t>(SETTINGS.fontSize + 1);
|
||||
if (index < item.enumValues.size()) {
|
||||
return std::string(tr(STR_DEFAULT_VALUE)) + " (" + I18N.get(item.enumValues[index]) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DynamicEnum items use the standard display
|
||||
return MenuListActivity::getItemValueString(index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user