diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2018-11-05 21:08:27 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2018-11-05 22:05:46 +0000 |
| commit | cf9a91ff9e8932c4e0e889577980b5e246aee647 (patch) | |
| tree | fa57f9738cd90ae62f1edc8ff4cf9fe1f555607e /src/ui/contextmenu.h | |
| parent | More cleanup (diff) | |
| download | inkscape-cf9a91ff9e8932c4e0e889577980b5e246aee647.tar.gz inkscape-cf9a91ff9e8932c4e0e889577980b5e246aee647.zip | |
ContextMenu: Harmonize with menu bar
Diffstat (limited to 'src/ui/contextmenu.h')
| -rw-r--r-- | src/ui/contextmenu.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ui/contextmenu.h b/src/ui/contextmenu.h index bd58fde00..a940e7f27 100644 --- a/src/ui/contextmenu.h +++ b/src/ui/contextmenu.h @@ -35,7 +35,7 @@ class Verb; * Implements the Inkscape context menu. * * For the context menu implementation, the ContextMenu class stores the object - * that was selected in a private data member. This should be farely safe to do + * that was selected in a private data member. This should be fairly safe to do * and a pointer to the SPItem as well as SPObject class are kept. * All callbacks of the context menu entries are implemented as private * functions. @@ -54,7 +54,14 @@ class ContextMenu : public Gtk::Menu */ ContextMenu(SPDesktop *desktop, SPItem *item); ~ContextMenu() override; - + + /** + * install CSS to shift menu icons into the space reserved for toggles (i.e. check and radio items) + * + * TODO: This should be private but we already re-use this code in ui/interface.cpp which is not c++ified yet. + * In future ContextMenu and the (to be created) class for the menu bar should then be derived from one common base class. + */ + void ShiftIcons(); private: SPItem *_item; // pointer to the object selected at the time the ContextMenu is created SPObject *_object; // pointer to the object selected at the time the ContextMenu is created @@ -71,11 +78,15 @@ class ContextMenu : public Gtk::Menu Gtk::SeparatorMenuItem* AddSeparator(); /** - * c++ified version of sp_ui_menu_append_item. + * Appends a custom menu UI from a verb. * + * c++ified version of sp_ui_menu_append_item. * @see sp_ui_menu_append_item_from_verb and synchronize/drop that function when c++ifying other code in interface.cpp + * + * @param show_icon True if an icon should be displayed before the menu item's label + * */ - void AppendItemFromVerb(Inkscape::Verb *verb); + void AppendItemFromVerb(Inkscape::Verb *verb, bool show_icon = false); /** * main function which is responsible for creating the context sensitive menu items, |
