Fix 1896834: Keep the 'show grid' and 'snap to grid' checkboxes in the caret menu...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 19 Feb 2008 15:34:02 +0000 (15:34 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 19 Feb 2008 15:34:02 +0000 (15:34 +0000)
git-svn-id: http://svn.voria.com/code@1757 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/canvasoptions.cpp
synfig-studio/trunk/src/gtkmm/canvasview.cpp
synfig-studio/trunk/src/gtkmm/canvasview.h

index e880f87..dfc15ed 100644 (file)
@@ -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
index 3782afd..8436ec9 100644 (file)
@@ -1324,13 +1324,13 @@ CanvasView::init_menus()
        {
                Glib::RefPtr<Gtk::ToggleAction> 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());
index 1cb3b42..6afc299 100644 (file)
@@ -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<Gtk::ToggleAction> grid_snap_toggle;
+       Glib::RefPtr<Gtk::ToggleAction> grid_show_toggle;
+
        Gtk::RadioButtonGroup quality_group;
        Gtk::RadioButtonGroup low_res_pixel_size_group;