Add render quality spin button. WIP
authorCarlos Lopez <carlos@pcnuevo.(none)>
Sun, 28 Jun 2009 17:55:36 +0000 (19:55 +0200)
committerCarlos Lopez <carlos@pcnuevo.(none)>
Mon, 13 Jul 2009 18:07:45 +0000 (20:07 +0200)
synfig-studio/trunk/src/gtkmm/canvasview.cpp
synfig-studio/trunk/src/gtkmm/canvasview.h

index 5f3e389..7e77704 100644 (file)
@@ -683,6 +683,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigap
        //keyframe_tree_store_  (KeyframeTreeStore::create(canvas_interface_)),
        time_adjustment_                (0,0,25,0,0,0),
        time_window_adjustment_ (0,0,25,0,0,0),
+       quality_adjustment_             (8,1,10,1,1,0),
        statusbar                               (manage(new class Gtk::Statusbar())),
 
        timeslider                              (new Widget_Timeslider),
@@ -707,6 +708,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigap
        duck_refresh_flag=true;
        toggling_ducks_=false;
        changing_resolution_=false;
+       updating_quality_=false;
 
        smach_.set_default_state(&state_normal);
 
@@ -1100,7 +1102,7 @@ CanvasView::create_status_bar()
 Gtk::Widget*
 CanvasView::create_display_bar()
 {
-       displaybar = manage(new class Gtk::Table(1, 3, false));
+       displaybar = manage(new class Gtk::Table(1, 5, false));
 
        // Setup the ToggleDuckDial widget
        toggleducksdial = Gtk::manage(new class ToggleDucksDial());
@@ -1141,12 +1143,23 @@ CanvasView::create_display_bar()
        resolutiondial->show();
 
        // 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_)
index ea3fae7..aa43bb8 100644 (file)
@@ -41,6 +41,7 @@
 #include <gtkmm/scrolledwindow.h>
 #include <gtkmm/notebook.h>
 #include <gdkmm/device.h>
+#include <gtkmm/spinbutton.h>
 
 #include <synfigapp/canvasinterface.h>
 #include <synfigapp/selectionmanager.h>
@@ -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 -------------------------------------
        */