[gtk+] Add a style class for touch selection popovers
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add a style class for touch selection popovers
- Date: Tue, 7 Oct 2014 17:34:45 +0000 (UTC)
commit f93795d272e29d34efc0b8f446efab59ec72e2f2
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 7 13:25:53 2014 -0400
Add a style class for touch selection popovers
gtk/gtkentry.c | 2 ++
gtk/gtkstylecontext.h | 10 ++++++++++
gtk/gtktextview.c | 2 ++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 48a38b8..ff30d16 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -9723,6 +9723,8 @@ bubble_targets_received (GtkClipboard *clipboard,
priv->selection_bubble = gtk_popover_new (GTK_WIDGET (entry));
gtk_style_context_add_class (gtk_widget_get_style_context (priv->selection_bubble),
GTK_STYLE_CLASS_OSD);
+ gtk_style_context_add_class (gtk_widget_get_style_context (priv->selection_bubble),
+ GTK_STYLE_CLASS_TOUCH_SELECTION);
gtk_popover_set_position (GTK_POPOVER (priv->selection_bubble),
GTK_POS_TOP);
gtk_popover_set_modal (GTK_POPOVER (priv->selection_bubble), FALSE);
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 6e22a6c..3af4d10 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -297,6 +297,16 @@ struct _GtkStyleContextClass
#define GTK_STYLE_CLASS_CONTEXT_MENU "context-menu"
/**
+ * GTK_STYLE_CLASS_TOUCH_SELECTION:
+ *
+ * A CSS class for touch selection popups on entries
+ * and text views.
+ *
+ * Since: 3.16
+ */
+#define GTK_STYLE_CLASS_TOUCH_SELECTION "touch-selection"
+
+/**
* GTK_STYLE_CLASS_MENUBAR:
*
* A CSS class to menubars.
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 0ba3c5b..f10a81b 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -9038,6 +9038,8 @@ bubble_targets_received (GtkClipboard *clipboard,
priv->selection_bubble = gtk_popover_new (GTK_WIDGET (text_view));
gtk_style_context_add_class (gtk_widget_get_style_context (priv->selection_bubble),
GTK_STYLE_CLASS_OSD);
+ gtk_style_context_add_class (gtk_widget_get_style_context (priv->selection_bubble),
+ GTK_STYLE_CLASS_TOUCH_SELECTION);
gtk_popover_set_position (GTK_POPOVER (priv->selection_bubble),
GTK_POS_TOP);
gtk_popover_set_modal (GTK_POPOVER (priv->selection_bubble), FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]