diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-07-20 22:51:39 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-07-20 22:52:53 +0000 |
| commit | a6e593e63a4c7de57f9792adb2e2d5295080e7fe (patch) | |
| tree | a188e8d83227c05096846a3e5c871214d34db12a /src/ui/dialog/layers.cpp | |
| parent | Preferences: save shortcut file location relative to INKSCAPE_DATADIR (diff) | |
| download | inkscape-a6e593e63a4c7de57f9792adb2e2d5295080e7fe.tar.gz inkscape-a6e593e63a4c7de57f9792adb2e2d5295080e7fe.zip | |
Fix icon positions in context menus of Layers and Objects dialogs
Fixes https://gitlab.com/inkscape/inbox/issues/462
Diffstat (limited to 'src/ui/dialog/layers.cpp')
| -rw-r--r-- | src/ui/dialog/layers.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 1e2a6ea35..18020e87b 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -36,6 +36,7 @@ #include "svg/css-ostringstream.h" +#include "ui/contextmenu.h" #include "ui/icon-loader.h" #include "ui/icon-names.h" #include "ui/tools/tool-base.h" @@ -146,6 +147,7 @@ Gtk::MenuItem& LayersPanel::_addPopupItem( SPDesktop *desktop, unsigned int code auto box = Gtk::manage(new Gtk::Box()); Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem()); + item->set_name("ImageMenuItem"); // custom name to identify our "ImageMenuItems" if (iconWidget) { box->pack_start(*iconWidget, false, true, 0); @@ -913,8 +915,11 @@ LayersPanel::LayersPanel() : _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DUPLICATE, nullptr, "Duplicate", (int)BUTTON_DUPLICATE ) ); _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DELETE, nullptr, "Delete", (int)BUTTON_DELETE ) ); - + _popupMenu.show_all_children(); + + // Install CSS to shift icons into the space reserved for toggles (i.e. check and radio items). + _popupMenu.signal_map().connect(sigc::mem_fun(static_cast<ContextMenu*>(&_popupMenu), &ContextMenu::ShiftIcons)); } // ------------------------------------------------------- |
