Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config to disable the main menu button #173

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions res/doc
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@
# option, only the first one takes effect.
#
# <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_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+
# <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_icon - the path passed to QPixmap
# menu_main_15505_icon_active - the path passed to QPixmap
Expand Down
6 changes: 6 additions & 0 deletions src/nickelmenu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ extern "C" __attribute__((visibility("default"))) void _nm_menu_hook2(MainNavVie
NM_LOG("MainNavView::MainNavView(%p, %p)", _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+.");

if (!MainNavButton_MainNavButton || !MainNavButton_setPixmap || !MainNavButton_setActivePixmap || !MainNavButton_setText || !MainNavButton_setText) {
Expand Down
Loading