diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-07-27 23:04:18 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-07-28 08:55:03 +0000 |
| commit | 129c961172a02e62b54e456d6072ee3ccfab0d12 (patch) | |
| tree | 4e066d1c90f9c939f1aa629f81cea5d411404476 | |
| parent | Add verbs update checkbuttons in menu. Also do improvements requested in http... (diff) | |
| download | inkscape-129c961172a02e62b54e456d6072ee3ccfab0d12.tar.gz inkscape-129c961172a02e62b54e456d6072ee3ccfab0d12.zip | |
Fix coding style
| -rw-r--r-- | src/desktop.h | 2 | ||||
| -rw-r--r-- | src/display/sp-canvas.cpp | 4 | ||||
| -rw-r--r-- | src/ui/desktop/menubar.cpp | 18 |
3 files changed, 11 insertions, 13 deletions
diff --git a/src/desktop.h b/src/desktop.h index 450e0b2cf..cff48aa99 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -206,7 +206,7 @@ public: Glib::ustring _reconstruction_old_layer_id; sigc::signal<void, sp_verb_t> _tool_changed; - sigc::signal<void, unsigned int> _menu_update; + sigc::signal<void, unsigned int> _menu_update; sigc::signal<void, SPObject *> _layer_changed_signal; sigc::signal<bool, const SPCSSAttr *>::accumulated<StopOnTrue> _set_style_signal; sigc::signal<int, SPStyle *, int>::accumulated<StopOnNonZero> _query_style_signal; diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 64fca5926..311f52567 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -2461,8 +2461,8 @@ int SPCanvas::paint() bool exact = arena->drawing.getExact(); arena->drawing.setExact(false); Geom::IntRect canvas_rect = Geom::IntRect::from_xywh(_x0, _y0, allocation.width, allocation.height); - Geom::IntRect _xray_rect = Geom::IntRect::from_xywh(_xray_orig[0] - _xray_radius, _xray_orig[1] - _xray_radius, - (_xray_radius * 2), (_xray_radius * 2)); + Geom::IntRect _xray_rect = Geom::IntRect::from_xywh( + _xray_orig[0] - _xray_radius, _xray_orig[1] - _xray_radius, (_xray_radius * 2), (_xray_radius * 2)); paintXRayBuffer(_xray_rect, canvas_rect); arena->drawing.setExact(exact); arena->drawing.setRenderMode(rm); 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) { |
