1
0

Add a config to disable the main menu button (#173)

Closes #127
This commit is contained in:
Josh Gao
2024-11-16 22:20:06 -08:00
committed by GitHub
parent 047c6c4d94
commit 4b779df860
2 changed files with 8 additions and 0 deletions

View File

@@ -191,10 +191,12 @@
# option, only the first one takes effect. # option, only the first one takes effect.
# #
# <key> the option name, one of: # <key> the option name, one of:
# menu_main_15505_enabled - controls enablement of the NickelMenu button on 4.23.15505+
# menu_main_15505_label - sets the label used for the NickelMenu button on 4.23.15505+ # menu_main_15505_label - sets the label used for the NickelMenu button on 4.23.15505+
# menu_main_15505_icon - sets the icon used for the NickelMenu button on 4.23.15505+ # menu_main_15505_icon - sets the icon used for the NickelMenu button on 4.23.15505+
# menu_main_15505_icon_active - sets the active icon used for the NickelMenu button on 4.23.15505+ # menu_main_15505_icon_active - sets the active icon used for the NickelMenu button on 4.23.15505+
# <val> the option value: # <val> the option value:
# menu_main_15505_enabled - 0 or 1
# menu_main_15505_label - the label to use instead of "NickelMenu" # menu_main_15505_label - the label to use instead of "NickelMenu"
# menu_main_15505_icon - the path passed to QPixmap # menu_main_15505_icon - the path passed to QPixmap
# menu_main_15505_icon_active - the path passed to QPixmap # menu_main_15505_icon_active - the path passed to QPixmap

View File

@@ -267,6 +267,12 @@ extern "C" __attribute__((visibility("default"))) void _nm_menu_hook2(MainNavVie
NM_LOG("MainNavView::MainNavView(%p, %p)", _this, parent); NM_LOG("MainNavView::MainNavView(%p, %p)", _this, parent);
MainNavView_MainNavView(_this, parent); MainNavView_MainNavView(_this, parent);
const char *enabled = nm_global_config_experimental("menu_main_15505_enabled");
if (enabled && strcmp("0", enabled) == 0) {
NM_LOG("Main menu disabled");
return;
}
NM_LOG("Adding main menu button in tab bar for firmware 4.23.15505+."); NM_LOG("Adding main menu button in tab bar for firmware 4.23.15505+.");
if (!MainNavButton_MainNavButton || !MainNavButton_setPixmap || !MainNavButton_setActivePixmap || !MainNavButton_setText || !MainNavButton_setText) { if (!MainNavButton_MainNavButton || !MainNavButton_setPixmap || !MainNavButton_setActivePixmap || !MainNavButton_setText || !MainNavButton_setText) {