Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
contextmenu.cpp File Reference

Context menu. More...

Go to the source code of this file.

Functions

static void AppendItemFromAction (Glib::RefPtr< Gio::Menu > const &gmenu, Glib::ustring const &action, Glib::ustring const &label, Glib::ustring const &icon={})
 
static Glib::RefPtr< Gio::Menu > create_clipboard_actions (bool const paste_only=false)
 Create a menu section containing the standard editing actions: Cut, Copy, Paste, Paste... (in place, on page, style, size, width, height, size separately, width separately, height separately).
 
void show_all_images (Gtk::Widget &parent)
 Recursively force all Image descendants with :storage-type other than EMPTY to :visible = TRUE.
 
bool is_clone_of_image (SPItem const *item)
 Check if the item is a clone of an image.
 
static bool childrenIncludedInSelection (SPItem *item, Inkscape::Selection &selection)
 

Detailed Description

Context menu.

Definition in file contextmenu.cpp.

Function Documentation

◆ AppendItemFromAction()

static void AppendItemFromAction ( Glib::RefPtr< Gio::Menu > const &  gmenu,
Glib::ustring const &  action,
Glib::ustring const &  label,
Glib::ustring const &  icon = {} 
)
static

Definition at line 55 of file contextmenu.cpp.

Referenced by ContextMenu::ContextMenu(), and create_clipboard_actions().

◆ childrenIncludedInSelection()

static bool childrenIncludedInSelection ( SPItem item,
Inkscape::Selection selection 
)
static

Definition at line 132 of file contextmenu.cpp.

References child, SPObject::children, and item.

Referenced by ContextMenu::ContextMenu().

◆ create_clipboard_actions()

static Glib::RefPtr< Gio::Menu > create_clipboard_actions ( bool const  paste_only = false)
static

Create a menu section containing the standard editing actions: Cut, Copy, Paste, Paste... (in place, on page, style, size, width, height, size separately, width separately, height separately).

Parameters
paste_onlyIf true, only the Paste action will be included.
Returns
A new menu containing the requested actions.

Also appending special paste options (in place, paste on page, paste style, paste size, paste width, paste height, paste size separately, paste width separately, paste height separately), to increase discoverability.

Definition at line 77 of file contextmenu.cpp.

References AppendItemFromAction(), and result.

Referenced by ContextMenu::ContextMenu().

◆ is_clone_of_image()

bool is_clone_of_image ( SPItem const *  item)

Check if the item is a clone of an image.

Definition at line 124 of file contextmenu.cpp.

References item.

Referenced by ContextMenu::ContextMenu().

◆ show_all_images()

void show_all_images ( Gtk::Widget &  parent)

Recursively force all Image descendants with :storage-type other than EMPTY to :visible = TRUE.

We have to do this this if using Gio::Menu with icons as GTK, in its vast genius, doesnʼt think those should ever actually be visible in the majority of cases. So, we just have to fight it 🤷 We donʼt show images if :storage-type == EMPTY so that shift_icons() can select on :only-child.

Definition at line 110 of file contextmenu.cpp.

References Inkscape::UI::_continue, child, Inkscape::UI::for_each_descendant(), image, and parent.

Referenced by ContextMenu::ContextMenu().