index 4bd8aebb503f840eaea128685e625fdcfe51dcf7..383d11f57b0e54a0559bd418c21ce9e09bf2fa6b 100644 (file)
LayersPanel* LayersPanel::instance = 0;
-LayersPanel& LayersPanel::getInstance()
+LayersPanel*
+LayersPanel::create(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory)
{
if ( !instance ) {
- instance = new LayersPanel();
+ instance = new LayersPanel(behavior_factory);
}
- return *instance;
+ return instance;
}
enum {
if ( inTree->repr ) {
SPCSSAttr *css = sp_repr_css_attr(inTree->repr, "style");
if ( css ) {
+ _opacityConnection.block();
_opacity.set_value( sp_repr_css_double_property( css, "opacity", 1.0 ) * 100 );
+ _opacityConnection.unblock();
}
}
}
if ( _desktop && layer && !_opacityConnection.blocked() ) {
_opacityConnection.block();
-
Gtk::Adjustment* adj = _opacity.get_adjustment();
SPCSSAttr *css = sp_repr_css_attr_new();
/**
* Constructor
*/
-LayersPanel::LayersPanel() :
- Inkscape::UI::Widget::Panel( Glib::ustring(), "dialogs.layers" ),
+LayersPanel::LayersPanel(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory) :
+ Inkscape::UI::Dialog::Dialog(behavior_factory, "dialogs.layers", SP_VERB_DIALOG_LAYERS),
_maxNestDepth(20),
_mgr(0),
_desktop(0),
_opacityBox.pack_end( _spinBtn, Gtk::PACK_SHRINK );
_watching.push_back( &_opacityBox );
- _getContents()->pack_start( _scroller, Gtk::PACK_EXPAND_WIDGET );
+ get_vbox()->pack_start( _scroller, Gtk::PACK_EXPAND_WIDGET );
- _getContents()->pack_end(_opacityBox, Gtk::PACK_SHRINK);
- _getContents()->pack_end(_buttonsRow, Gtk::PACK_SHRINK);
+ get_vbox()->pack_end(_opacityBox, Gtk::PACK_SHRINK);
+ get_vbox()->pack_end(_buttonsRow, Gtk::PACK_SHRINK);
_opacityConnection = _opacity.get_adjustment()->signal_value_changed().connect( sigc::mem_fun(*this, &LayersPanel::_opacityChanged) );
}
g_signal_connect( G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK( layers_panel_activated ), this );
-
-
setDesktop( targetDesktop );
-
-
show_all_children();
- restorePanelPrefs();
+ // restorePanelPrefs();
}
LayersPanel::~LayersPanel()
_desktop = SP_ACTIVE_DESKTOP;
if ( _desktop ) {
- setLabel( _desktop->doc()->name );
+ //setLabel( _desktop->doc()->name );
_mgr = _desktop->layer_manager;
if ( _mgr ) {