summaryrefslogtreecommitdiffstats
path: root/src/dialogs/iconpreview.cpp
diff options
context:
space:
mode:
authorgustav_b <gustav_b@users.sourceforge.net>2007-11-22 00:14:41 +0000
committergustav_b <gustav_b@users.sourceforge.net>2007-11-22 00:14:41 +0000
commit5caa6ff4dfb7b538555d60fa2732272bf8b9828b (patch)
tree65c6fb0232f8621fa6cecdcdf68d0790bd955777 /src/dialogs/iconpreview.cpp
parentFix ordering of LPE parameters (no longer use map, just use vector) (diff)
downloadinkscape-5caa6ff4dfb7b538555d60fa2732272bf8b9828b.tar.gz
inkscape-5caa6ff4dfb7b538555d60fa2732272bf8b9828b.zip
The dialog to panel refactoring:
* Made the current dialogs subclass the Panel class instead of the Dialog class. * Extended the Panel class with some functionality that the dialogs relied on. * Added a PanelDialog class which is a dialog container for a single panel with the dialog behavior as a template parameter. (* Fixed coding style for the Panel and Dialog class) For details, see http://www.nabble.com/Re%3A-Dockable-dialogs%2C-todo-list-p12728194.html http://www.nabble.com/Re%3A-Inkscape-overcomes-Xara-in-Google-Trends-p13126622.html (bzr r4126)
Diffstat (limited to 'src/dialogs/iconpreview.cpp')
-rw-r--r--src/dialogs/iconpreview.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dialogs/iconpreview.cpp b/src/dialogs/iconpreview.cpp
index d0b8b4a8f..c36414705 100644
--- a/src/dialogs/iconpreview.cpp
+++ b/src/dialogs/iconpreview.cpp
@@ -49,16 +49,16 @@ namespace Dialogs {
IconPreviewPanel* IconPreviewPanel::instance = 0;
-IconPreviewPanel*
-IconPreviewPanel::create(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory)
+IconPreviewPanel&
+IconPreviewPanel::getInstance()
{
if ( !instance ) {
- instance = new IconPreviewPanel(behavior_factory);
+ instance = new IconPreviewPanel();
}
instance->refreshPreview();
- return instance;
+ return *instance;
}
//#########################################################################
@@ -72,7 +72,7 @@ void IconPreviewPanel::on_button_clicked(int which)
hot = which;
updateMagnify();
- get_vbox()->queue_draw();
+ _getContents()->queue_draw();
}
}
@@ -85,8 +85,8 @@ void IconPreviewPanel::on_button_clicked(int which)
/**
* Constructor
*/
-IconPreviewPanel::IconPreviewPanel(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory) :
- Inkscape::UI::Dialog::Dialog(behavior_factory, "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW),
+IconPreviewPanel::IconPreviewPanel() :
+ UI::Widget::Panel("", "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW),
hot(1),
refreshButton(0),
selectionButton(0)
@@ -186,7 +186,7 @@ IconPreviewPanel::IconPreviewPanel(Inkscape::UI::Dialog::Behavior::BehaviorFacto
Gtk::HButtonBox* holder = new Gtk::HButtonBox( Gtk::BUTTONBOX_END );
- get_vbox()->pack_end( *holder, false, false );
+ _getContents()->pack_end(*holder, false, false);
selectionButton = new Gtk::ToggleButton(_("Selection")); // , GTK_RESPONSE_APPLY
holder->pack_start( *selectionButton, false, false );
@@ -202,7 +202,7 @@ IconPreviewPanel::IconPreviewPanel(Inkscape::UI::Dialog::Behavior::BehaviorFacto
refreshButton->signal_clicked().connect( sigc::mem_fun(*this, &IconPreviewPanel::refreshPreview) );
- get_vbox()->pack_start(iconBox, Gtk::PACK_EXPAND_WIDGET);
+ _getContents()->pack_start(iconBox, Gtk::PACK_EXPAND_WIDGET);
show_all_children();
}