diff --git a/app/data/contextmenudata.h b/app/data/contextmenudata.h index 8c2512379..de7921a6c 100644 --- a/app/data/contextmenudata.h +++ b/app/data/contextmenudata.h @@ -13,18 +13,18 @@ namespace Latte { namespace Data { namespace ContextMenu { -static const char SECTIONACTION[]= "_latte_section"; static const char ADDVIEWACTION[]= "_add_view"; -static const char LAYOUTSACTION[] = "_layouts"; -static const char PRINTACTION[] = "_print"; -static const char PREFERENCESACTION[] = "_preferences"; -static const char QUITLATTEACTION[] = "_quit_latte"; static const char ADDWIDGETSACTION[] = "_add_latte_widgets"; -static const char DUPLICATEVIEWACTION[] = "_duplicate_view"; +static const char DUPLICATEVIEWACTION[] = "_duplicate_view"; /*used inside add view submenu*/ static const char EDITVIEWACTION[] = "_edit_view"; static const char EXPORTVIEWTEMPLATEACTION[] = "_export_view"; -static const char REMOVEVIEWACTION[] = "_remove_view"; +static const char LAYOUTSACTION[] = "_layouts"; static const char MOVEVIEWACTION[] = "_move_view"; +static const char PRINTACTION[] = "_print"; +static const char PREFERENCESACTION[] = "_preferences"; +static const char REMOVEVIEWACTION[] = "_remove_view"; +static const char QUITLATTEACTION[] = "_quit_latte"; +static const char SECTIONACTION[]= "_latte_section"; static const char SEPARATOR1ACTION[] = "_separator1"; static QStringList ACTIONSALWAYSVISIBLE = {LAYOUTSACTION, @@ -34,10 +34,15 @@ static QStringList ACTIONSALWAYSVISIBLE = {LAYOUTSACTION, ADDWIDGETSACTION, ADDVIEWACTION}; +static QStringList ACTIONSALWAYSHIDDEN = {PRINTACTION}; + static QStringList ACTIONSVISIBLEONLYINEDIT = {MOVEVIEWACTION, EXPORTVIEWTEMPLATEACTION, REMOVEVIEWACTION}; +static QStringList ACTIONSSPECIAL = {SECTIONACTION, + EDITVIEWACTION}; + } } } diff --git a/containmentactions/contextmenu/menu.cpp b/containmentactions/contextmenu/menu.cpp index 24433229c..27aadd168 100644 --- a/containmentactions/contextmenu/menu.cpp +++ b/containmentactions/contextmenu/menu.cpp @@ -301,13 +301,13 @@ void Menu::onUserConfiguringChanged(const bool &configuring) void Menu::updateVisibleActions() { - bool configuring = containment()->isUserConfiguring(); - if (!m_actions.contains(Latte::Data::ContextMenu::EDITVIEWACTION) || !m_actions.contains(Latte::Data::ContextMenu::REMOVEVIEWACTION)) { return; } + bool configuring = containment()->isUserConfiguring(); + m_actions[Latte::Data::ContextMenu::EDITVIEWACTION]->setVisible(!configuring); m_actions[Latte::Data::ContextMenu::EXPORTVIEWTEMPLATEACTION]->setVisible(configuring); m_actions[Latte::Data::ContextMenu::MOVEVIEWACTION]->setVisible(configuring);