From aba6e2238a7fe85197e57032bdc29ed53d97bf7e Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 19 Feb 2008 15:34:02 +0000 Subject: [PATCH] Fix 1896834: Keep the 'show grid' and 'snap to grid' checkboxes in the caret menu up to date. git-svn-id: http://svn.voria.com/code@1757 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/canvasoptions.cpp | 2 ++ synfig-studio/trunk/src/gtkmm/canvasview.cpp | 12 ++++++------ synfig-studio/trunk/src/gtkmm/canvasview.h | 6 ++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/canvasoptions.cpp b/synfig-studio/trunk/src/gtkmm/canvasoptions.cpp index e880f87..dfc15ed 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasoptions.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasoptions.cpp @@ -185,11 +185,13 @@ CanvasOptions::on_grid_show_toggle() void CanvasOptions::on_apply_pressed() { + canvas_view_->set_grid_snap_toggle(toggle_grid_snap.get_active()); if(toggle_grid_snap.get_active()) canvas_view_->work_area->enable_grid_snap(); else canvas_view_->work_area->disable_grid_snap(); + canvas_view_->set_grid_show_toggle(toggle_grid_show.get_active()); if(toggle_grid_show.get_active()) canvas_view_->work_area->enable_grid(); else diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 3782afd..8436ec9 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -1324,13 +1324,13 @@ CanvasView::init_menus() { Glib::RefPtr action; - action = Gtk::ToggleAction::create("toggle-grid-show", _("Show Grid")); - action->set_active(work_area->grid_status()); - action_group->add(action, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_grid)); + grid_show_toggle = Gtk::ToggleAction::create("toggle-grid-show", _("Show Grid")); + grid_show_toggle->set_active(work_area->grid_status()); + action_group->add(grid_show_toggle, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_grid)); - action = Gtk::ToggleAction::create("toggle-grid-snap", _("Snap to Grid")); - action->set_active(work_area->get_grid_snap()); - action_group->add(action, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_grid_snap)); + grid_snap_toggle = Gtk::ToggleAction::create("toggle-grid-snap", _("Snap to Grid")); + grid_snap_toggle->set_active(work_area->get_grid_snap()); + action_group->add(grid_snap_toggle, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_grid_snap)); action = Gtk::ToggleAction::create("toggle-guide-show", _("Show Guides")); action->set_active(work_area->get_show_guides()); diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.h b/synfig-studio/trunk/src/gtkmm/canvasview.h index 1cb3b42..6afc299 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.h +++ b/synfig-studio/trunk/src/gtkmm/canvasview.h @@ -173,6 +173,9 @@ public: typedef synfigapp::CanvasInterface::Mode Mode; + void set_grid_snap_toggle(bool flag) { grid_snap_toggle->set_active(flag); } + void set_grid_show_toggle(bool flag) { grid_show_toggle->set_active(flag); } + /* -- ** -- P R I V A T E D A T A --------------------------------------------- */ @@ -307,6 +310,9 @@ private: */ Gtk::Menu parammenu; + Glib::RefPtr grid_snap_toggle; + Glib::RefPtr grid_show_toggle; + Gtk::RadioButtonGroup quality_group; Gtk::RadioButtonGroup low_res_pixel_size_group; -- 2.7.4