Esempio n. 1
0
static void
tap_action (GtkPressAndHold *pah,
            gint             x,
            gint             y,
            GtkColorSwatch  *swatch)
{
  swatch_primary_action (swatch);
}
Esempio n. 2
0
static gboolean
swatch_button_release (GtkWidget      *widget,
                       GdkEventButton *event)
{
  GtkColorSwatch *swatch = GTK_COLOR_SWATCH (widget);

  if (event->button == GDK_BUTTON_PRIMARY &&
      swatch->priv->contains_pointer)
    return swatch_primary_action (swatch);

  return FALSE;
}
Esempio n. 3
0
static void
tap_action (GtkGestureMultiPress *gesture,
            gint                  n_press,
            gdouble               x,
            gdouble               y,
            GtkColorSwatch       *swatch)
{
    guint button;

    button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));

    if (button == GDK_BUTTON_PRIMARY)
    {
        if (n_press == 1)
            swatch_primary_action (swatch);
        else if (n_press > 1)
            g_signal_emit (swatch, signals[ACTIVATE], 0);
    }
    else if (button == GDK_BUTTON_SECONDARY)
    {
        if (swatch->priv->has_color && swatch->priv->has_menu)
            do_popup (swatch);
    }
}