[gtk+/wip/pbor/css-text-attributes: 2/6] entry: add css letter-spacing
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/pbor/css-text-attributes: 2/6] entry: add css letter-spacing
- Date: Sun, 5 Jul 2015 21:31:43 +0000 (UTC)
commit 75b96426f57bb2e8793ae579217356b9b84b54cb
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Jul 5 10:48:40 2015 +0200
entry: add css letter-spacing
gtk/gtkentry.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index d8a6496..04a198f 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -47,6 +47,7 @@
#include "gtkmarshalers.h"
#include "gtkmenu.h"
#include "gtkmenuitem.h"
+#include "gtkpango.h"
#include "gtkseparatormenuitem.h"
#include "gtkselection.h"
#include "gtksettings.h"
@@ -6250,8 +6251,10 @@ gtk_entry_create_layout (GtkEntry *entry,
{
GtkEntryPrivate *priv = entry->priv;
GtkWidget *widget = GTK_WIDGET (entry);
+ GtkStyleContext *context;
PangoLayout *layout;
PangoAttrList *tmp_attrs;
+ PangoAttrList *style_attrs;
gboolean placeholder_layout;
gchar *preedit_string = NULL;
@@ -6261,12 +6264,21 @@ gtk_entry_create_layout (GtkEntry *entry,
gchar *display_text;
guint n_bytes;
+ context = gtk_widget_get_style_context (widget);
+
layout = gtk_widget_create_pango_layout (widget, NULL);
pango_layout_set_single_paragraph_mode (layout, TRUE);
tmp_attrs = priv->attrs ? pango_attr_list_ref (priv->attrs)
: pango_attr_list_new ();
+ style_attrs = _gtk_style_context_get_pango_attributes (context);
+ if (style_attrs)
+ {
+ _gtk_pango_attr_list_merge (tmp_attrs, style_attrs);
+ pango_attr_list_unref (style_attrs);
+ }
+
placeholder_layout = show_placeholder_text (entry);
if (placeholder_layout)
display_text = g_strdup (priv->placeholder_text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]