From 5caa6ff4dfb7b538555d60fa2732272bf8b9828b Mon Sep 17 00:00:00 2001 From: gustav_b Date: Thu, 22 Nov 2007 00:14:41 +0000 Subject: 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) --- src/dialogs/layers-panel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/dialogs/layers-panel.cpp') diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index 34bb5101c..ff18c82b4 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -46,14 +46,14 @@ namespace Dialogs { LayersPanel* LayersPanel::instance = 0; -LayersPanel* -LayersPanel::create(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory) +LayersPanel& +LayersPanel::getInstance() { if ( !instance ) { - instance = new LayersPanel(behavior_factory); + instance = new LayersPanel(); } - return instance; + return *instance; } enum { @@ -708,8 +708,8 @@ void LayersPanel::_opacityChanged() /** * Constructor */ -LayersPanel::LayersPanel(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory) : - Inkscape::UI::Dialog::Dialog(behavior_factory, "dialogs.layers", SP_VERB_DIALOG_LAYERS), +LayersPanel::LayersPanel() : + UI::Widget::Panel("", "dialogs.layers", SP_VERB_DIALOG_LAYERS), _maxNestDepth(20), _mgr(0), _desktop(0), @@ -776,10 +776,10 @@ LayersPanel::LayersPanel(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavio _opacityBox.pack_end( _spinBtn, Gtk::PACK_SHRINK ); _watching.push_back( &_opacityBox ); - get_vbox()->pack_start( _scroller, Gtk::PACK_EXPAND_WIDGET ); + _getContents()->pack_start( _scroller, Gtk::PACK_EXPAND_WIDGET ); - get_vbox()->pack_end(_opacityBox, Gtk::PACK_SHRINK); - get_vbox()->pack_end(_buttonsRow, Gtk::PACK_SHRINK); + _getContents()->pack_end(_opacityBox, Gtk::PACK_SHRINK); + _getContents()->pack_end(_buttonsRow, Gtk::PACK_SHRINK); _opacityConnection = _opacity.get_adjustment()->signal_value_changed().connect( sigc::mem_fun(*this, &LayersPanel::_opacityChanged) ); -- cgit v1.2.3