diff options
| -rw-r--r-- | src/desktop.cpp | 4 | ||||
| -rw-r--r-- | src/ui/desktop/menubar.cpp | 17 | ||||
| -rw-r--r-- | src/ui/desktop/menubar.h | 2 |
3 files changed, 10 insertions, 13 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index b458d0e78..a9e318b78 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -61,12 +61,12 @@ #include "object/sp-namedview.h" #include "object/sp-root.h" +#include "ui/desktop/menubar.h" #include "ui/dialog/dialog-manager.h" -#include "ui/interface.h" // Only for getLayoutPrefPath +#include "ui/interface.h" // Only for getLayoutPrefPath #include "ui/tool-factory.h" #include "ui/tools/box3d-tool.h" #include "ui/tools/select-tool.h" -#include "ui/desktop/menubar.h" #include "widgets/desktop-widget.h" diff --git a/src/ui/desktop/menubar.cpp b/src/ui/desktop/menubar.cpp index 79c3f5aaf..fd0d502d8 100644 --- a/src/ui/desktop/menubar.cpp +++ b/src/ui/desktop/menubar.cpp @@ -41,8 +41,9 @@ // ================= Common ==================== -std::vector<std::pair<unsigned int, Gtk::CheckMenuItem *> > checkmenuitems; -unsigned int lastverb = 0;; +std::vector<std::pair<unsigned int, Gtk::CheckMenuItem *>> checkmenuitems; +unsigned int lastverb = 0; +; // Sets tip static void @@ -59,8 +60,7 @@ deselect_action(SPAction *action) } // Trigger action -static void -item_activate(Gtk::MenuItem *menuitem, SPAction *action) +static void item_activate(Gtk::MenuItem *menuitem, SPAction *action) { if (action->verb->get_code() == lastverb) { lastverb = 0; @@ -71,12 +71,11 @@ item_activate(Gtk::MenuItem *menuitem, SPAction *action) lastverb = 0; } -static void -toggle_checkmenu(unsigned int emitting_verb, bool value) +static void toggle_checkmenu(unsigned int emitting_verb, bool value) { for (auto menu : checkmenuitems) { if (emitting_verb == menu.first) { - if (emitting_verb == lastverb) { + if (emitting_verb == lastverb) { lastverb = 0; return; } @@ -183,8 +182,7 @@ build_menu_item_from_verb(SPAction* action, // =============== CheckMenuItem ================== -bool -getStateFromPref(SPDesktop* dt, Glib::ustring item) +bool getStateFromPref(SPDesktop *dt, Glib::ustring item) { Glib::ustring pref_path; @@ -533,7 +531,6 @@ build_menu(Gtk::MenuShell* menu, Inkscape::XML::Node* xml, Inkscape::UI::View::V } } SP_ACTIVE_DESKTOP->_menu_update.connect(sigc::ptr_fun(&toggle_checkmenu)); - } Gtk::MenuBar* diff --git a/src/ui/desktop/menubar.h b/src/ui/desktop/menubar.h index c04ff57d0..fc1937055 100644 --- a/src/ui/desktop/menubar.h +++ b/src/ui/desktop/menubar.h @@ -29,7 +29,7 @@ namespace View { } } -bool getStateFromPref(SPDesktop* dt, Glib::ustring item); +bool getStateFromPref(SPDesktop *dt, Glib::ustring item); Gtk::MenuBar* build_menubar(Inkscape::UI::View::View* view); #endif // SEEN_DESKTOP_MENUBAR_H |
