From ec36670485e9afb5fd0537e0c5e7fea185b4266c Mon Sep 17 00:00:00 2001 From: jpirnay Date: Fri, 24 Apr 2026 12:54:17 +0200 Subject: [PATCH] Show default values --- .../reader/EpubReaderMenuActivity.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/activities/reader/EpubReaderMenuActivity.cpp b/src/activities/reader/EpubReaderMenuActivity.cpp index c74d8252..5bcc9568 100644 --- a/src/activities/reader/EpubReaderMenuActivity.cpp +++ b/src/activities/reader/EpubReaderMenuActivity.cpp @@ -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(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(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(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); }