From: Carlos Lopez Date: Sat, 27 Jun 2009 08:20:11 +0000 (+0200) Subject: Synchronise toggle buttons with keyboard and menu actions. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7b90fa6d64864aba582c3e8d4e0f2e8add8bd6c5;p=synfig.git Synchronise toggle buttons with keyboard and menu actions. --- diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index c7db107..2207d24 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -704,6 +704,7 @@ CanvasView::CanvasView(etl::loose_handle instance,etl::handleget_type_mask()&type); if(is_currently_on) @@ -3668,6 +3672,15 @@ CanvasView::toggle_duck_mask(Duckmatic::Type type) work_area->set_type_mask(work_area->get_type_mask()|type); work_area->queue_draw(); + try + { + toggleducksdial->update_toggles(work_area->get_type_mask()); + } + catch(...) + { + toggling_ducks_=false; + } + toggling_ducks_=false; } void diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.h b/synfig-studio/trunk/src/gtkmm/canvasview.h index 182d3e6..826c8ea 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.h +++ b/synfig-studio/trunk/src/gtkmm/canvasview.h @@ -267,6 +267,7 @@ private: Gtk::Button *keyframebutton; FrameDial *framedial; ToggleDucksDial *toggleducksdial; + bool toggling_ducks_; //! Shows current time and allows edition diff --git a/synfig-studio/trunk/src/gtkmm/toggleducksdial.cpp b/synfig-studio/trunk/src/gtkmm/toggleducksdial.cpp index 6dd67bc..8e07816 100644 --- a/synfig-studio/trunk/src/gtkmm/toggleducksdial.cpp +++ b/synfig-studio/trunk/src/gtkmm/toggleducksdial.cpp @@ -83,7 +83,7 @@ ToggleDucksDial::create_label_button(Gtk::IconSize iconsize, const char *label, } void -ToggleDucksDial::initiate_toggles(Duck::Type mask) +ToggleDucksDial::update_toggles(Duck::Type mask) { ducks_position-> set_active((mask & Duck::TYPE_POSITION)); ducks_vertex -> set_active((mask & Duck::TYPE_VERTEX)); diff --git a/synfig-studio/trunk/src/gtkmm/toggleducksdial.h b/synfig-studio/trunk/src/gtkmm/toggleducksdial.h index 312e3fd..919b01a 100644 --- a/synfig-studio/trunk/src/gtkmm/toggleducksdial.h +++ b/synfig-studio/trunk/src/gtkmm/toggleducksdial.h @@ -63,7 +63,7 @@ class ToggleDucksDial : public Gtk::Table public: ToggleDucksDial(); - void initiate_toggles(Duck::Type mask); + void update_toggles(Duck::Type mask); Glib::SignalProxy0 signal_ducks_position() { return ducks_position->signal_toggled(); } Glib::SignalProxy0 signal_ducks_vertex() { return ducks_vertex-> signal_toggled(); } Glib::SignalProxy0 signal_ducks_tangent() { return ducks_tangent-> signal_toggled(); }