Bypass widget options setup when they are not available #890
This commit is contained in:
@@ -124,14 +124,16 @@ SetupWidgetsPageSlot::SetupWidgetsPageSlot(FormGroup * parent, const rect_t & re
|
|||||||
menu->addLine(factory->getName(), [=]() {
|
menu->addLine(factory->getName(), [=]() {
|
||||||
container->createWidget(slotIndex, factory);
|
container->createWidget(slotIndex, factory);
|
||||||
auto widget = container->getWidget(slotIndex);
|
auto widget = container->getWidget(slotIndex);
|
||||||
new WidgetSettings(parent, widget);
|
if(widget->getOptions() && widget->getOptions()->name)
|
||||||
|
new WidgetSettings(parent, widget);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (container->getWidget(slotIndex)) {
|
if (container->getWidget(slotIndex)) {
|
||||||
menu->addLine(TR_WIDGET_SETTINGS, [=]() {
|
auto widget = container->getWidget(slotIndex);
|
||||||
auto widget = container->getWidget(slotIndex);
|
if(widget->getOptions() && widget->getOptions()->name)
|
||||||
|
menu->addLine(TR_WIDGET_SETTINGS, [=]() {
|
||||||
new WidgetSettings(parent, widget);
|
new WidgetSettings(parent, widget);
|
||||||
});
|
});
|
||||||
menu->addLine(STR_REMOVE_WIDGET, [=]() {
|
menu->addLine(STR_REMOVE_WIDGET, [=]() {
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ static void openWidgetMenu(Widget * parent)
|
|||||||
menu->addLine("Full screen", [=]() {
|
menu->addLine("Full screen", [=]() {
|
||||||
parent->setFullscreen(true);
|
parent->setFullscreen(true);
|
||||||
});
|
});
|
||||||
menu->addLine(TR_WIDGET_SETTINGS, [=]() {
|
if(parent->getOptions() && parent->getOptions()->name)
|
||||||
|
menu->addLine(TR_WIDGET_SETTINGS, [=]() {
|
||||||
new WidgetSettings(parent, parent);
|
new WidgetSettings(parent, parent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user