Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void sp_event_show_modifier_tip ( Inkscape::MessageContext message_context,
GdkEvent *  event,
gchar const *  ctrl_tip,
gchar const *  shift_tip,
gchar const *  alt_tip 
)

Show tool context specific modifier tip.

Definition at line 1037 of file event-context.cpp.

References Inkscape::MessageContext::flash(), and get_group0_keyval().

                              {
    guint keyval = get_group0_keyval(&event->key);

    bool ctrl = ctrl_tip && (MOD__CTRL || (keyval == GDK_Control_L) || (keyval
            == GDK_Control_R));
    bool shift = shift_tip && (MOD__SHIFT || (keyval == GDK_Shift_L) || (keyval
            == GDK_Shift_R));
    bool alt = alt_tip && (MOD__ALT || (keyval == GDK_Alt_L) || (keyval
            == GDK_Alt_R) || (keyval == GDK_Meta_L) || (keyval == GDK_Meta_R));

    gchar *tip = g_strdup_printf("%s%s%s%s%s", (ctrl ? ctrl_tip : ""), (ctrl
            && (shift || alt) ? "; " : ""), (shift ? shift_tip : ""), ((ctrl
            || shift) && alt ? "; " : ""), (alt ? alt_tip : ""));

    if (strlen(tip) > 0) {
        message_context->flash(Inkscape::INFORMATION_MESSAGE, tip);
    }

    g_free(tip);
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index