X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdialogs%2Flayers-panel.h;h=83c5089fc8a434726caa00a02c9dae7de4718957;hb=4afe6ce6ad98c33cff42076097036e7327f32ceb;hp=bdfab6b29d29a4075138a13008d1e99c3e486d6b;hpb=b18eff4079085241a6b79ef775cf4a620e30b6eb;p=inkscape.git diff --git a/src/dialogs/layers-panel.h b/src/dialogs/layers-panel.h index bdfab6b29..83c5089fc 100644 --- a/src/dialogs/layers-panel.h +++ b/src/dialogs/layers-panel.h @@ -15,10 +15,14 @@ #include #include #include +#include #include +#include +#include +#include -#include "ui/widget/panel.h" //#include "ui/previewholder.h" +#include "ui/dialog/dialog.h" class SPObject; @@ -33,14 +37,14 @@ namespace Dialogs { /** * A panel that displays layers. */ -class LayersPanel : public Inkscape::UI::Widget::Panel +class LayersPanel : public Inkscape::UI::Dialog::Dialog { public: - LayersPanel(); + LayersPanel(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory); virtual ~LayersPanel(); - static LayersPanel& getInstance(); //virtual void setOrientation( Gtk::AnchorType how ); + static LayersPanel *create(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory); void setDesktop( SPDesktop* desktop ); @@ -60,6 +64,7 @@ private: void _fireAction( unsigned int code ); Gtk::MenuItem& _addPopupItem( SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback, int id ); + void _preToggle( GdkEvent const *event ); void _toggled( Glib::ustring const& str, int targetCol ); void _handleButtonEvent(GdkEventButton* evt); @@ -71,27 +76,38 @@ private: void _takeAction( int val ); bool _executeAction(); + bool _rowSelectFunction( Glib::RefPtr const & model, Gtk::TreeModel::Path const & path, bool b ); + + void _updateLayer(SPObject *layer); + bool _checkForUpdated(const Gtk::TreePath &path, const Gtk::TreeIter& iter, SPObject* layer); + void _selectLayer(SPObject *layer); bool _checkForSelected(const Gtk::TreePath& path, const Gtk::TreeIter& iter, SPObject* layer); void _layersChanged(); void _addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::Row* parentRow, SPObject* target, int level ); - SPObject* _selectedLayer(); + void _opacityChanged(); - // Hooked to the desktop: - sigc::connection _layerChangedConnection; + SPObject* _selectedLayer(); // Hooked to the layer manager: + sigc::connection _layerChangedConnection; + sigc::connection _layerUpdatedConnection; sigc::connection _changedConnection; sigc::connection _addedConnection; sigc::connection _removedConnection; + sigc::connection _opacityConnection; + + // Internal + sigc::connection _selectedConnection; int _maxNestDepth; Inkscape::LayerManager* _mgr; SPDesktop* _desktop; ModelColumns* _model; InternalUIBounce* _pending; + GdkEvent* _toggleEvent; Glib::RefPtr _store; std::vector _watching; std::vector _watchingNonTop; @@ -99,9 +115,12 @@ private: Gtk::Tooltips _tips; Gtk::TreeView _tree; - Gtk::HBox _buttonsRow; + Gtk::HButtonBox _buttonsRow; Gtk::ScrolledWindow _scroller; + Gtk::HBox _opacityBox; + Gtk::HScale _opacity; Gtk::Menu _popupMenu; + Gtk::SpinButton _spinBtn; };