From: joncruz Date: Mon, 22 May 2006 09:32:22 +0000 (+0000) Subject: Removed panel menu unless requested. Fixes bug #1492597 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3cc86195f8421708895b8cfd3dcc1eea5dbf50d2;p=inkscape.git Removed panel menu unless requested. Fixes bug #1492597 --- diff --git a/ChangeLog b/ChangeLog index e7ce13d05..93b22d4c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-05-22 Jon A. Cruz + + * src/dialogs/swatches.cpp, src/ui/widget/panel.cpp, + src/ui/widget/panel.h: + Removed panel menu unless requested. Fixes bug #1492597. + 2006-05-22 MenTaLguY * src/extension/internal/svg.cpp: diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 5af23f95e..31e91562b 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -916,7 +916,7 @@ SwatchesPanel& SwatchesPanel::getInstance() * Constructor */ SwatchesPanel::SwatchesPanel() : - Inkscape::UI::Widget::Panel ("dialogs.swatches"), + Inkscape::UI::Widget::Panel( "dialogs.swatches", true ), _holder(0) { _holder = new PreviewHolder(); diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index f00d736ae..2112ea7b2 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -31,8 +31,9 @@ namespace Widget { * \param label Label. */ -Panel::Panel(const gchar *prefs_path) : +Panel::Panel( const gchar *prefs_path, bool menuDesired ) : _prefs_path(NULL), + _menuDesired(menuDesired), _tempArrow( Gtk::ARROW_LEFT, Gtk::SHADOW_ETCHED_OUT ), menu(0), _fillable(0) @@ -43,6 +44,7 @@ Panel::Panel(const gchar *prefs_path) : Panel::Panel() : _prefs_path(NULL), + _menuDesired(false), _tempArrow( Gtk::ARROW_LEFT, Gtk::SHADOW_ETCHED_OUT ), menu(0), _fillable(0) @@ -50,8 +52,9 @@ Panel::Panel() : init(); } -Panel::Panel(Glib::ustring const &label) : +Panel::Panel( Glib::ustring const &label, bool menuDesired ) : _prefs_path(NULL), + _menuDesired(menuDesired), _tempArrow( Gtk::ARROW_LEFT, Gtk::SHADOW_ETCHED_OUT ), menu(0), _fillable(0) @@ -137,12 +140,14 @@ void Panel::init() //topBar.pack_end(closeButton, false, false); - topBar.pack_end(menuPopper, false, false); - Gtk::Frame* outliner = manage(new Gtk::Frame()); - outliner->set_shadow_type( Gtk::SHADOW_ETCHED_IN ); - outliner->add( _tempArrow ); - menuPopper.add( *outliner ); - menuPopper.signal_button_press_event().connect_notify( sigc::mem_fun(*this, &Panel::_popper) ); + if ( _menuDesired ) { + topBar.pack_end(menuPopper, false, false); + Gtk::Frame* outliner = manage(new Gtk::Frame()); + outliner->set_shadow_type( Gtk::SHADOW_ETCHED_IN ); + outliner->add( _tempArrow ); + menuPopper.add( *outliner ); + menuPopper.signal_button_press_event().connect_notify( sigc::mem_fun(*this, &Panel::_popper) ); + } pack_start( topBar, false, false ); @@ -175,10 +180,12 @@ void Panel::setOrientation( Gtk::AnchorType how ) case Gtk::ANCHOR_NORTH: case Gtk::ANCHOR_SOUTH: { - menuPopper.reference(); - topBar.remove(menuPopper); - rightBar.pack_start(menuPopper, false, false); - menuPopper.unreference(); + if ( _menuDesired ) { + menuPopper.reference(); + topBar.remove(menuPopper); + rightBar.pack_start(menuPopper, false, false); + menuPopper.unreference(); + } topBar.remove(tabTitle); } diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h index 8fb4b517a..cf201d6da 100644 --- a/src/ui/widget/panel.h +++ b/src/ui/widget/panel.h @@ -34,8 +34,8 @@ class Panel : public Gtk::VBox public: Panel(); virtual ~Panel(); - Panel(Glib::ustring const &label); - Panel(const gchar *prefs_path); + Panel(Glib::ustring const &label, bool menuDesired = false ); + Panel(const gchar *prefs_path, bool menuDesired = false ); void setLabel(Glib::ustring const &label); Glib::ustring const &getLabel() const; @@ -51,6 +51,7 @@ protected: void _regItem( Gtk::MenuItem* item, int group, int id ); virtual void _handleAction( int setId, int itemId ); + bool _menuDesired; Gtk::AnchorType _anchor;