From: Carlos Lopez Date: Sun, 28 Jun 2009 17:55:36 +0000 (+0200) Subject: Add render quality spin button. WIP X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4a5036c12bc268713be0509278c9b303c953e02b;p=synfig.git Add render quality spin button. WIP --- diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 5f3e389..7e77704 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -683,6 +683,7 @@ CanvasView::CanvasView(etl::loose_handle instance,etl::handle instance,etl::handleshow(); // Set up a separator - Gtk::VSeparator *separator = Gtk::manage(new class Gtk::VSeparator()); - separator->show(); + Gtk::VSeparator *separator1 = Gtk::manage(new class Gtk::VSeparator()); + separator1->show(); + Gtk::VSeparator *separator2 = Gtk::manage(new class Gtk::VSeparator()); + separator2->show(); + + // Set up quality spin button + quality_spin=Gtk::manage(new class Gtk::SpinButton(quality_adjustment_)); + quality_spin->signal_value_changed().connect( + sigc::mem_fun(*this, &studio::CanvasView::update_quality)); + quality_spin->show(); - displaybar->attach(*resolutiondial, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); displaybar->attach(*toggleducksdial, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK); - displaybar->attach(*separator, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL); + displaybar->attach(*separator1, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL); + displaybar->attach(*resolutiondial, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); + displaybar->attach(*separator2, 3, 4, 0, 1, Gtk::FILL, Gtk::FILL); + displaybar->attach(*quality_spin, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK); + displaybar->show(); return displaybar; @@ -3172,6 +3185,16 @@ CanvasView::toggle_low_res_pixel_flag() } void +CanvasView::update_quality() +{ + if(updating_quality_) + return; + updating_quality_=true; + work_area->set_quality((int) quality_spin->get_value()); + updating_quality_=false; +} + +void CanvasView::on_dirty_preview() { if(!is_playing_) diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.h b/synfig-studio/trunk/src/gtkmm/canvasview.h index ea3fae7..aa43bb8 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.h +++ b/synfig-studio/trunk/src/gtkmm/canvasview.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -272,8 +273,9 @@ private: bool toggling_ducks_; ResolutionDial *resolutiondial; bool changing_resolution_; - - + Gtk::Adjustment quality_adjustment_; + Gtk::SpinButton *quality_spin; + bool updating_quality_; //! Shows current time and allows edition Widget_Time *current_time_widget; void on_current_time_widget_changed(); @@ -606,6 +608,8 @@ public: bool is_playing() { return is_playing_; } + void update_quality(); + /* -- ** -- S I G N A L T E R M I N A L S ------------------------------------- */