From: <ro...@sy...> - 2012-01-27 18:12:04
|
Author: Yu Chen <jc...@gm...> Date: Sat Dec 31 10:40:59 2011 +0800 Replace dialog with window widget for preview window so that we have a close button available on all platform --- synfig-studio/src/gui/dialogs/dialog_preview.cpp | 10 +++++++--- synfig-studio/src/gui/dialogs/dialog_preview.h | 8 +++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.cpp b/synfig-studio/src/gui/dialogs/dialog_preview.cpp index e9e4cc3..65ebe59 100644 --- a/synfig-studio/src/gui/dialogs/dialog_preview.cpp +++ b/synfig-studio/src/gui/dialogs/dialog_preview.cpp @@ -59,10 +59,14 @@ using namespace Gtk; //dialog_preview stuff... Dialog_Preview::Dialog_Preview() -:Dialog(_("Preview Window"),false,true), +:preview_table(1, 1, true), settings(this,"preview") { - get_vbox()->pack_start(preview); + set_title(_("Preview Window")); + add(preview_table); + preview_table.attach(preview, 0, 1, 0, 1); + show_all_children(); + } Dialog_Preview::~Dialog_Preview() @@ -78,7 +82,7 @@ void Dialog_Preview::set_preview(etl::handle<Preview> prev) void Dialog_Preview::on_hide() { - Dialog::on_hide(); + Window::on_hide(); preview.pause(); preview.stoprender(); } diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.h b/synfig-studio/src/gui/dialogs/dialog_preview.h index 72ba7b0..03aad73 100644 --- a/synfig-studio/src/gui/dialogs/dialog_preview.h +++ b/synfig-studio/src/gui/dialogs/dialog_preview.h @@ -51,7 +51,7 @@ struct PreviewInfo bool overbegin,overend; }; -class Dialog_Preview : public Gtk::Dialog +class Dialog_Preview : public Gtk::Window { Widget_Preview preview; DialogSettings settings; @@ -69,6 +69,12 @@ public: virtual void on_hide(); //other forwarding functions... + + //child widgets: + +protected: + Gtk::Table preview_table; + }; // END of Dialog_Preview class Dialog_PreviewOptions : public Gtk::Dialog |