summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-04-26 21:23:08 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-05-05 15:03:59 -0400
commitacdb9650e2e25cbb2acd6fb310ae72446243a820 (patch)
treeb0df36d18b7855fac49c13877d8cb709e5d3faf2
parent92166f1f694a0af3c8474344f47f318c7c5153aa (diff)
downloadgtk+-acdb9650e2e25cbb2acd6fb310ae72446243a820.tar.gz
dnd: Set attributes from all widgets for text drag icons
There is nothing textview-specific here.
-rw-r--r--gtk/gtktextutil.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c
index f880c233d7..ab9a15178c 100644
--- a/gtk/gtktextutil.c
+++ b/gtk/gtktextutil.c
@@ -254,14 +254,12 @@ _gtk_text_util_create_drag_icon (GtkWidget *widget,
}
static void
-gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
- GtkTextAttributes *values)
+set_attributes_from_style (GtkStyleContext *context,
+ GtkTextAttributes *values)
{
- GtkStyleContext *context;
GdkRGBA bg_color, fg_color;
GtkStateFlags state;
- context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
state = gtk_style_context_get_state (context);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -328,10 +326,10 @@ _gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
gtk_widget_get_allocation (widget, &allocation);
layout_width = allocation.width;
+ set_attributes_from_style (gtk_widget_get_style_context (widget), style);
+
if (GTK_IS_TEXT_VIEW (widget))
{
- gtk_text_view_set_attributes_from_style (GTK_TEXT_VIEW (widget), style);
-
layout_width = layout_width
- gtk_text_view_get_border_window_size (GTK_TEXT_VIEW (widget), GTK_TEXT_WINDOW_LEFT)
- gtk_text_view_get_border_window_size (GTK_TEXT_VIEW (widget), GTK_TEXT_WINDOW_RIGHT);