[gtk+/gtk-3-22] link button: Set a drag icon
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] link button: Set a drag icon
- Date: Sun, 10 Dec 2017 18:58:58 +0000 (UTC)
commit c4ff07025b887e242fc415927370ae2e270c3f01
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 10 13:58:27 2017 -0500
link button: Set a drag icon
It is a bit odd to drag nothing around, so set an icon.
gtk/gtklinkbutton.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index e7aab31..103348a 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -67,6 +67,7 @@
#include "gtktooltip.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktextutil.h"
#include "a11y/gtklinkbuttonaccessible.h"
@@ -108,6 +109,8 @@ static void gtk_link_button_clicked (GtkButton *button);
static gboolean gtk_link_button_popup_menu (GtkWidget *widget);
static void gtk_link_button_realize (GtkWidget *widget);
static void gtk_link_button_unrealize (GtkWidget *widget);
+static void gtk_link_button_drag_begin (GtkWidget *widget,
+ GdkDragContext *context);
static void gtk_link_button_drag_data_get_cb (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection,
@@ -146,6 +149,7 @@ gtk_link_button_class_init (GtkLinkButtonClass *klass)
widget_class->popup_menu = gtk_link_button_popup_menu;
widget_class->realize = gtk_link_button_realize;
widget_class->unrealize = gtk_link_button_unrealize;
+ widget_class->drag_begin = gtk_link_button_drag_begin;
button_class->clicked = gtk_link_button_clicked;
@@ -453,6 +457,13 @@ gtk_link_button_popup_menu (GtkWidget *widget)
}
static void
+gtk_link_button_drag_begin (GtkWidget *widget,
+ GdkDragContext *context)
+{
+ gtk_drag_set_icon_name (context, "text-x-generic", 0, 0);
+}
+
+static void
gtk_link_button_drag_data_get_cb (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]