From bc8f10aa89bba44d77bf9dd651895b344693ac50 Mon Sep 17 00:00:00 2001 From: Pit64 Date: Thu, 4 Dec 2025 14:30:07 +0100 Subject: [PATCH] fix(frontend): add hotkey button customizable in themes --- projects/frontend/es-core/src/components/HelpComponent.cpp | 3 ++- projects/frontend/es-core/src/themes/PropertyNames.h | 1 + projects/frontend/es-core/src/themes/ThemeSupport.cpp | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/frontend/es-core/src/components/HelpComponent.cpp b/projects/frontend/es-core/src/components/HelpComponent.cpp index 5a5b197608..43c9ea08dd 100644 --- a/projects/frontend/es-core/src/components/HelpComponent.cpp +++ b/projects/frontend/es-core/src/components/HelpComponent.cpp @@ -271,6 +271,7 @@ void HelpComponent::OnApplyThemeElement(const ThemeElement& element, ThemeProper if(element.HasProperty(ThemePropertyName::IconL3R3)) mImagesPath[(int)HelpType::L3R3] = Path(element.AsString(ThemePropertyName::IconL3R3)); if(element.HasProperty(ThemePropertyName::IconStart)) mImagesPath[(int)HelpType::Start] = Path(element.AsString(ThemePropertyName::IconStart)); if(element.HasProperty(ThemePropertyName::IconSelect)) mImagesPath[(int)HelpType::Select] = Path(element.AsString(ThemePropertyName::IconSelect)); + if(element.HasProperty(ThemePropertyName::IconHotkey)) mImagesPath[(int)HelpType::HotkeyCombo] = Path(element.AsString(ThemePropertyName::IconHotkey)); } void HelpComponent::ViewChanged(ViewType currentView, bool hasWindowOver) @@ -280,7 +281,7 @@ void HelpComponent::ViewChanged(ViewType currentView, bool hasWindowOver) if (hasWindowOver) { - // We are on a menu or a window. Select menu view or if it doesn't exists, just keep default + // We are on a menu or a window. Select menu view or if it doesn't exist, just keep default if (ThemeManager::Instance().Main().HasMenuView()) viewName = "menu"; } diff --git a/projects/frontend/es-core/src/themes/PropertyNames.h b/projects/frontend/es-core/src/themes/PropertyNames.h index 5cffdb31db..9a20d2d173 100644 --- a/projects/frontend/es-core/src/themes/PropertyNames.h +++ b/projects/frontend/es-core/src/themes/PropertyNames.h @@ -42,6 +42,7 @@ enum class ThemePropertyName IconDownload, IconFastShutdown, IconGames, + IconHotkey, IconKodi, IconL, IconL2, diff --git a/projects/frontend/es-core/src/themes/ThemeSupport.cpp b/projects/frontend/es-core/src/themes/ThemeSupport.cpp index bf4ae3bd74..d963d9f412 100644 --- a/projects/frontend/es-core/src/themes/ThemeSupport.cpp +++ b/projects/frontend/es-core/src/themes/ThemeSupport.cpp @@ -52,6 +52,7 @@ void ThemeSupport::InitializeStatics() case ThemePropertyName::IconDownload: case ThemePropertyName::IconFastShutdown: case ThemePropertyName::IconGames: + case ThemePropertyName::IconHotkey: case ThemePropertyName::IconKodi: case ThemePropertyName::IconL: case ThemePropertyName::IconL2: @@ -383,6 +384,7 @@ HashMap& ThemeSupport::ElementMap() ThemePropertyName::IconR3, ThemePropertyName::IconStart, ThemePropertyName::IconSelect, + ThemePropertyName::IconHotkey, }, }, { @@ -571,6 +573,7 @@ HashMap& ThemeSupport::PropertyName() { "iconDownload", ThemePropertyName::IconDownload }, { "iconFastShutdown", ThemePropertyName::IconFastShutdown }, { "iconGames", ThemePropertyName::IconGames }, + { "iconHotkey", ThemePropertyName::IconHotkey }, { "iconKodi", ThemePropertyName::IconKodi }, { "iconL", ThemePropertyName::IconL }, { "iconL2", ThemePropertyName::IconL2 }, @@ -680,6 +683,7 @@ String ThemeSupport::ReversePropertyName(ThemePropertyName name) { ThemePropertyName::IconDownload, "iconDownload" }, { ThemePropertyName::IconFastShutdown, "iconFastShutdown" }, { ThemePropertyName::IconGames, "iconGames" }, + { ThemePropertyName::IconHotkey, "iconHotkey" }, { ThemePropertyName::IconKodi, "iconKodi" }, { ThemePropertyName::IconL, "iconL" }, { ThemePropertyName::IconL2, "iconL2" }, -- GitLab