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

fix(color): Don't display long press widget menu if no options #4263

Merged
merged 1 commit into from
Oct 30, 2023
Merged
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
22 changes: 12 additions & 10 deletions radio/src/gui/colorlcd/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ Widget::Widget(const WidgetFactory* factory, Window* parent,

void Widget::openMenu()
{
// Widgets are placed on a full screen window which is underneath the main view menu bar
// Find the parent of this so that when the popup loads it covers the main view menu
Window* w = parent->getFullScreenWindow()->getParent();
Menu* menu = new Menu(w ? w : this);
if (fsAllowed) {
menu->addLine(STR_WIDGET_FULLSCREEN, [&]() { setFullscreen(true); });
}
if (getOptions() && getOptions()->name) {
menu->addLine(STR_WIDGET_SETTINGS,
[=]() { new WidgetSettings(this, this); });
if (getOptions() || fsAllowed) {
// Widgets are placed on a full screen window which is underneath the main view menu bar
// Find the parent of this so that when the popup loads it covers the main view menu
Window* w = parent->getFullScreenWindow()->getParent();
Menu* menu = new Menu(w ? w : this);
if (fsAllowed) {
menu->addLine(STR_WIDGET_FULLSCREEN, [&]() { setFullscreen(true); });
}
if (getOptions() && getOptions()->name) {
menu->addLine(STR_WIDGET_SETTINGS,
[=]() { new WidgetSettings(this, this); });
}
}
}

Expand Down