[gtk+/touch-selection-improvements: 3/17] texthandle: Use the handle widget style context for rendering
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touch-selection-improvements: 3/17] texthandle: Use the handle widget style context for rendering
- Date: Thu, 18 Dec 2014 13:54:30 +0000 (UTC)
commit cceea46f367784b70cc80d286ba67eb30656750b
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Nov 20 13:41:24 2014 +0100
texthandle: Use the handle widget style context for rendering
Using the parent widget context is a leftover of the pre-popover
implementation, which used GdkWindows directly. This will make the context
reflect widget state, at the expense of changing the selector paths
that used to match the handles.
gtk/gtktexthandle.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index 74023f4..2b42685 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -101,7 +101,7 @@ _gtk_text_handle_draw (GtkTextHandle *handle,
gint width, height;
priv = handle->priv;
- context = gtk_widget_get_style_context (priv->parent);
+ context = gtk_widget_get_style_context (priv->windows[pos].widget);
_gtk_text_handle_get_size (handle, &width, &height);
cairo_save (cr);
@@ -221,6 +221,12 @@ static void
gtk_text_handle_widget_style_updated (GtkWidget *widget,
GtkTextHandle *handle)
{
+ GtkTextHandlePrivate *priv;
+
+ priv = handle->priv;
+ gtk_style_context_set_parent (gtk_widget_get_style_context (widget),
+ gtk_widget_get_style_context (priv->parent));
+
_gtk_text_handle_update (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_START);
_gtk_text_handle_update (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_END);
}
@@ -254,6 +260,9 @@ _gtk_text_handle_ensure_widget (GtkTextHandle *handle,
priv->windows[pos].widget = g_object_ref_sink (widget);
window = gtk_widget_get_ancestor (priv->parent, GTK_TYPE_WINDOW);
_gtk_window_add_popover (GTK_WINDOW (window), widget);
+
+ gtk_style_context_set_parent (gtk_widget_get_style_context (widget),
+ gtk_widget_get_style_context (priv->parent));
}
return priv->windows[pos].widget;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]