From 0962b310bc44fd9a2b4904db9b91185ff0bfd1ed Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 25 Nov 2008 23:27:51 +0000 Subject: [PATCH] The previous commit was a little hasty. The focus point is also used when resizing the canvas, to decide which point to keep in the same relative position. Reverting previous commit. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2279 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/renddesc.cpp | 30 ++++++++++++++++++++++++++++++ synfig-studio/trunk/src/gtkmm/renddesc.h | 3 +++ 2 files changed, 33 insertions(+) diff --git a/synfig-studio/trunk/src/gtkmm/renddesc.cpp b/synfig-studio/trunk/src/gtkmm/renddesc.cpp index f1a3464..c88ac87 100644 --- a/synfig-studio/trunk/src/gtkmm/renddesc.cpp +++ b/synfig-studio/trunk/src/gtkmm/renddesc.cpp @@ -134,6 +134,7 @@ Widget_RendDesc::refresh() adjustment_span.set_value(rend_desc_.get_span()); entry_tl->set_value(rend_desc_.get_tl()); entry_br->set_value(rend_desc_.get_br()); + entry_focus->set_value(rend_desc_.get_focus()); toggle_px_aspect->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_ASPECT)); toggle_px_width->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_W)); @@ -315,6 +316,16 @@ Widget_RendDesc::on_br_changed() } void +Widget_RendDesc::on_focus_changed() +{ + if(update_lock)return; + UpdateLock lock(update_lock); + rend_desc_.set_focus(entry_focus->get_value()); + refresh(); + signal_changed()(); +} + +void Widget_RendDesc::on_span_changed() { if(update_lock)return; @@ -375,6 +386,7 @@ Widget_RendDesc::create_widgets() entry_end_time=manage(new Widget_Time()); //entry_start_frame=manage(new Gtk::SpinButton(adjustment_start_frame,1,0)); //entry_end_frame=manage(new Gtk::SpinButton(adjustment_end_frame,1,0)); + entry_focus=manage(new Widget_Vector()); toggle_px_aspect=manage(new Gtk::CheckButton(_("_Pixel Aspect"), true)); toggle_px_aspect->set_alignment(0, 0.5); toggle_px_width=manage(new Gtk::CheckButton(_("Pi_xel Width"), true)); @@ -408,6 +420,7 @@ Widget_RendDesc::connect_signals() entry_end_time->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_end_time_changed)); //entry_start_frame->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_start_frame_changed)); //entry_end_frame->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_end_frame_changed)); + entry_focus->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_focus_changed)); toggle_px_aspect->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed)); toggle_px_width->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed)); toggle_px_height->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed)); @@ -581,6 +594,23 @@ Widget_RendDesc::create_other_tab() lockTable->attach(*toggle_px_height, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); lockTable->attach(*toggle_px_aspect, 2, 3, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); + Gtk::Frame *focusFrame = manage(new Gtk::Frame(_("Focus Point"))); + focusFrame->set_shadow_type(Gtk::SHADOW_NONE); + ((Gtk::Label *) focusFrame->get_label_widget())->set_markup(_("Focus Point")); + panelBox->pack_start(*focusFrame, false, false, 0); + + Gtk::Alignment *focusPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); + focusPadding->set_padding(6, 0, 24, 0); + focusFrame->add(*focusPadding); + + Gtk::HBox *focusBox = manage(new Gtk::HBox(false, 12)); + focusPadding->add(*focusBox); + + Gtk::Label *focusLabel = manage(new Gtk::Label(_("_Focus Point"), 0, 0.5, true)); + focusLabel->set_mnemonic_widget(*entry_focus); + focusBox->pack_start(*focusLabel, false, false, 0); + focusBox->pack_start(*entry_focus, true, true, 0); + paddedPanel->show_all(); return paddedPanel; } diff --git a/synfig-studio/trunk/src/gtkmm/renddesc.h b/synfig-studio/trunk/src/gtkmm/renddesc.h index 5e5407b..48d0793 100644 --- a/synfig-studio/trunk/src/gtkmm/renddesc.h +++ b/synfig-studio/trunk/src/gtkmm/renddesc.h @@ -93,6 +93,8 @@ class Widget_RendDesc : public Gtk::Notebook Widget_Vector *entry_tl; Widget_Vector *entry_br; + Widget_Vector *entry_focus; + Widget_Time *entry_start_time; Widget_Time *entry_end_time; @@ -142,6 +144,7 @@ private: //void on_start_frame_changed(); //void on_end_frame_changed(); void on_lock_changed(); + void on_focus_changed(); void on_span_changed(); void create_widgets(); -- 2.7.4