summaryrefslogtreecommitdiffstats
path: root/src/ui/desktop
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-07-27 23:04:18 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-07-28 08:55:03 +0000
commit129c961172a02e62b54e456d6072ee3ccfab0d12 (patch)
tree4e066d1c90f9c939f1aa629f81cea5d411404476 /src/ui/desktop
parentAdd verbs update checkbuttons in menu. Also do improvements requested in http... (diff)
downloadinkscape-129c961172a02e62b54e456d6072ee3ccfab0d12.tar.gz
inkscape-129c961172a02e62b54e456d6072ee3ccfab0d12.zip
Fix coding style
Diffstat (limited to 'src/ui/desktop')
-rw-r--r--src/ui/desktop/menubar.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ui/desktop/menubar.cpp b/src/ui/desktop/menubar.cpp
index 8d72d49ad..0ada70284 100644
--- a/src/ui/desktop/menubar.cpp
+++ b/src/ui/desktop/menubar.cpp
@@ -56,8 +56,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)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool freeze = prefs->getBool("/menu/freeze", false);
@@ -68,15 +67,13 @@ item_activate(Gtk::MenuItem * menuitem, SPAction* action)
}
}
-void
-activate_checkmenu(unsigned int emited_verb, unsigned int recibe_verb, Gtk::CheckMenuItem* menuitem)
+void activate_checkmenu(unsigned int emited_verb, unsigned int recibe_verb, Gtk::CheckMenuItem *menuitem)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool freeze = prefs->getBool("/menu/freeze", false);
if (!freeze) {
prefs->setBool("/menu/freeze", true);
- if (emited_verb == recibe_verb)
- {
+ if (emited_verb == recibe_verb) {
if (menuitem->get_active()) {
menuitem->property_active() = false;
} else {
@@ -277,7 +274,7 @@ build_menu_check_item_from_verb(SPAction* action)
// Set initial state before connecting signals.
checkitem_update(menuitem, action);
-
+
menuitem->signal_toggled().connect(
sigc::bind<Gtk::CheckMenuItem*, SPAction*>(sigc::ptr_fun(&item_activate), menuitem, action));
menuitem->signal_select().connect( sigc::bind<SPAction*>(sigc::ptr_fun(&select_action), action));
@@ -452,15 +449,16 @@ build_menu(Gtk::MenuShell* menu, Inkscape::XML::Node* xml, Inkscape::UI::View::V
Gtk::CheckMenuItem* menuitem = build_menu_check_item_from_verb(action);
if (menuitem) {
- SP_ACTIVE_DESKTOP->_menu_update.connect(sigc::bind(sigc::ptr_fun(&activate_checkmenu), verb->get_code(), menuitem));
+ SP_ACTIVE_DESKTOP->_menu_update.connect(
+ sigc::bind(sigc::ptr_fun(&activate_checkmenu), verb->get_code(), menuitem));
menu->append(*menuitem);
}
-
+
} else if (menu_ptr->attribute("radio") != nullptr) {
Gtk::MenuItem* menuitem = build_menu_item_from_verb(action, show_icons_curr, true, &group);
if (menuitem) {
- // TODO: if necesary update a radio in the future we can folloe the previus checkbutton code
+ // TODO: if necesary update a radio in the future we can follow the previus checkbutton
if (menu_ptr->attribute("default") != nullptr) {
auto radiomenuitem = dynamic_cast<Gtk::RadioMenuItem*>(menuitem);
if (radiomenuitem) {