[gtk/wip/otte/dnd: 6/9] dnd: Don't create custom color drag icons
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/dnd: 6/9] dnd: Don't create custom color drag icons
- Date: Mon, 2 Mar 2020 03:33:26 +0000 (UTC)
commit b4cd1aeaaedd5d8115cdf497553a9f773439b0dd
Author: Benjamin Otte <otte redhat com>
Date: Mon Mar 2 03:46:59 2020 +0100
dnd: Don't create custom color drag icons
... use the default one. It looks much better.
gtk/gtkcolorbutton.c | 19 -------------------
gtk/gtkcolorswatch.c | 19 -------------------
2 files changed, 38 deletions(-)
---
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index 17f52fba7d..1638cdc6ee 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -240,24 +240,6 @@ gtk_color_button_drop (GtkDropTarget *dest,
return TRUE;
}
-static void
-gtk_color_button_drag_begin (GtkDragSource *source,
- GdkDrag *drag,
- GtkColorButton *button)
-{
- GtkColorButtonPrivate *priv = gtk_color_button_get_instance_private (button);
- GtkSnapshot *snapshot;
- GdkPaintable *paintable;
-
- snapshot = gtk_snapshot_new ();
- gtk_snapshot_append_color (snapshot, &priv->rgba, &GRAPHENE_RECT_INIT(0, 0, 48, 32));
- paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
-
- gtk_drag_source_set_icon (source, paintable, 0, 0);
-
- g_object_unref (paintable);
-}
-
static GdkContentProvider *
gtk_color_button_drag_prepare (GtkDragSource *source,
double x,
@@ -306,7 +288,6 @@ gtk_color_button_init (GtkColorButton *button)
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (gtk_color_button_drag_prepare), button);
- g_signal_connect (source, "drag-begin", G_CALLBACK (gtk_color_button_drag_begin), button);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (source), GTK_PHASE_CAPTURE);
gtk_widget_add_controller (priv->button, GTK_EVENT_CONTROLLER (source));
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index 63dad35bd9..ca6ab4d54f 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -125,24 +125,6 @@ swatch_snapshot (GtkWidget *widget,
gtk_widget_snapshot_child (widget, priv->overlay_widget, snapshot);
}
-static void
-gtk_color_swatch_drag_begin (GtkDragSource *source,
- GdkDrag *drag,
- GtkColorSwatch *swatch)
-{
- GtkColorSwatchPrivate *priv = gtk_color_swatch_get_instance_private (swatch);
- GtkSnapshot *snapshot;
- GdkPaintable *paintable;
-
- snapshot = gtk_snapshot_new ();
- gtk_snapshot_append_color (snapshot, &priv->color, &GRAPHENE_RECT_INIT(0, 0, 48, 32));
- paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
-
- gtk_drag_source_set_icon (source, paintable, 0, 0);
-
- g_object_unref (paintable);
-}
-
static gboolean
swatch_drag_drop (GtkDropTarget *dest,
const GValue *value,
@@ -594,7 +576,6 @@ gtk_color_swatch_set_rgba (GtkColorSwatch *swatch,
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (gtk_color_swatch_drag_prepare), swatch);
- g_signal_connect (source, "drag-begin", G_CALLBACK (gtk_color_swatch_drag_begin), swatch);
gtk_widget_add_controller (GTK_WIDGET (swatch), GTK_EVENT_CONTROLLER (source));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]