DEFINE_ACTION("toggle-grid-snap", _("Toggle Grid Snap"));
DEFINE_ACTION("toggle-guide-show", _("Toggle Guide Show"));
DEFINE_ACTION("toggle-low-res", _("Toggle Low-Res"));
+ DEFINE_ACTION("decrease-low-res-pixel-size", _("Decrease Low-Res Pixel Size"));
+ DEFINE_ACTION("increase-low-res-pixel-size", _("Increase Low-Res Pixel Size"));
DEFINE_ACTION("toggle-onion-skin", _("Toggle Onion Skin"));
DEFINE_ACTION("canvas-zoom-in", Gtk::StockID("gtk-zoom-in"));
DEFINE_ACTION("canvas-zoom-out", Gtk::StockID("gtk-zoom-out"));
" <menuitem action='quality-09' />"
" <menuitem action='quality-10' />"
" </menu>"
-" <menu action='menu-lowres-pixel'>";
+" <menu action='menu-lowres-pixel'>"
+" <menuitem action='decrease-low-res-pixel-size'/>"
+" <menuitem action='increase-low-res-pixel-size'/>"
+" <separator name='pixel-size-separator'/>"
+;
for(list<int>::iterator iter = CanvasView::get_pixel_sizes().begin(); iter != CanvasView::get_pixel_sizes().end(); iter++)
ui_info += strprintf(" <menuitem action='lowres-pixel-%d' />", *iter);
ACCEL("<Actions>//time-zoom-in","+");
ACCEL("<Actions>//time-zoom-out","_");
*/
+ ACCEL2(Gtk::AccelKey('(',Gdk::CONTROL_MASK,"<Actions>//decrease-low-res-pixel-size"));
+ ACCEL2(Gtk::AccelKey(')',Gdk::CONTROL_MASK,"<Actions>//increase-low-res-pixel-size"));
+
ACCEL2(Gtk::AccelKey('(',Gdk::MOD1_MASK|Gdk::CONTROL_MASK,"<Actions>//amount-dec"));
ACCEL2(Gtk::AccelKey(')',Gdk::MOD1_MASK|Gdk::CONTROL_MASK,"<Actions>//amount-inc"));
)
);
}
+
+ Glib::RefPtr<Gtk::Action> action;
+
+ action=Gtk::Action::create("decrease-low-res-pixel-size", _("Decrease Low-Res Pixel Size"));
+ action_group->add( action,sigc::mem_fun(this, &studio::CanvasView::decrease_low_res_pixel_size));
+
+ action=Gtk::Action::create("increase-low-res-pixel-size", _("Increase Low-Res Pixel Size"));
+ action_group->add( action, sigc::mem_fun(this, &studio::CanvasView::increase_low_res_pixel_size));
+
}
action_group->add( Gtk::Action::create("play", Gtk::Stock::MEDIA_PLAY),
}
void
+CanvasView::decrease_low_res_pixel_size()
+{
+ list<int> sizes = CanvasView::get_pixel_sizes();
+ int pixel_size = work_area->get_low_res_pixel_size();
+
+ for (list<int>::iterator iter = sizes.begin(); iter != sizes.end(); iter++)
+ if (*iter == pixel_size)
+ {
+ if (iter == sizes.begin())
+ // we already have the smallest low-res pixels possible - turn off low-res instead
+ work_area->set_low_resolution_flag(false);
+ else
+ {
+ iter--;
+ Glib::RefPtr<Gtk::Action> action = action_group->get_action(strprintf("lowres-pixel-%d", *iter));
+ action->activate(); // to make sure the radiobutton in the menu is updated too
+ work_area->set_low_resolution_flag(true);
+ }
+ break;
+ }
+}
+
+void
+CanvasView::increase_low_res_pixel_size()
+{
+ list<int> sizes = CanvasView::get_pixel_sizes();
+ int pixel_size = work_area->get_low_res_pixel_size();
+
+ if (!work_area->get_low_resolution_flag())
+ {
+ work_area->set_low_resolution_flag(true);
+ return;
+ }
+
+ for (list<int>::iterator iter = sizes.begin(); iter != sizes.end(); iter++)
+ if (*iter == pixel_size)
+ {
+ iter++;
+ if (iter != sizes.end())
+ {
+ Glib::RefPtr<Gtk::Action> action = action_group->get_action(strprintf("lowres-pixel-%d", *iter));
+ action->activate(); // to make sure the radiobutton in the menu is updated too
+ work_area->set_low_resolution_flag(true);
+ }
+ break;
+ }
+}
+
+void
CanvasView::on_dirty_preview()
{
if(!is_playing_)
void rebuild_ducks_layer_(synfig::TransformStack& transform_stack, synfig::Canvas::Handle canvas, std::set<synfig::Layer::Handle>& selected_list);
+ void decrease_low_res_pixel_size();
+ void increase_low_res_pixel_size();
+
/*
-- ** -- P U B L I C M E T H O D S -----------------------------------------
*/