From aa7d0c1df59483cb21b2a0dc46b430308be9bb9e Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 24 Jan 2008 22:27:19 +0000 Subject: [PATCH] Add checkboxes to the toggleable entries in the view menu. git-svn-id: http://svn.voria.com/code@1459 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/canvasview.cpp | 37 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 226848f..93bf896 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -1298,22 +1298,29 @@ CanvasView::init_menus() sigc::mem_fun0(*preview_dialog, &studio::Dialog_Preview::present) ); - action_group->add( Gtk::Action::create("toggle-grid-show", _("Toggle Grid Show")), - sigc::mem_fun(*work_area, &studio::WorkArea::toggle_grid) - ); - action_group->add( Gtk::Action::create("toggle-grid-snap", _("Toggle Grid Snap")), - sigc::mem_fun(*work_area, &studio::WorkArea::toggle_grid_snap) - ); - action_group->add( Gtk::Action::create("toggle-guide-show", _("Toggle Guide Show")), - sigc::mem_fun(*work_area, &studio::WorkArea::toggle_guide_snap) - ); - action_group->add( Gtk::Action::create("toggle-low-res", _("Toggle Low-Res")), - sigc::mem_fun(*work_area, &studio::WorkArea::toggle_low_resolution_flag) - ); - action_group->add( Gtk::Action::create("toggle-onion-skin", _("Toggle Onion Skin")), - sigc::mem_fun(*work_area, &studio::WorkArea::toggle_onion_skin) - ); + { + 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)); + + 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)); + + action = Gtk::ToggleAction::create("toggle-guide-show", _("Show Guides")); + action->set_active(work_area->get_show_guides()); + action_group->add(action, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_guide_snap)); + + action = Gtk::ToggleAction::create("toggle-low-res", _("Use Low-Res")); + action->set_active(work_area->get_low_resolution_flag()); + action_group->add(action, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_low_resolution_flag)); + + action = Gtk::ToggleAction::create("toggle-onion-skin", _("Show Onion Skin")); + action->set_active(work_area->get_onion_skin()); + action_group->add(action, sigc::mem_fun(*work_area, &studio::WorkArea::toggle_onion_skin)); + } action_group->add( Gtk::Action::create("canvas-zoom-fit", Gtk::StockID("gtk-zoom-fit")), sigc::mem_fun(*work_area, &studio::WorkArea::zoom_fit) -- 2.7.4