[gtk+/gtk-style-context: 206/276] GtkStyle: Fill in x/ythickness and font_desc from the style context.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 206/276] GtkStyle: Fill in x/ythickness and font_desc from the style context.
- Date: Sat, 23 Oct 2010 19:12:27 +0000 (UTC)
commit fd9e13d9317a540579508bebdb90b28ea14c49cd
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Aug 30 22:39:47 2010 +0200
GtkStyle: Fill in x/ythickness and font_desc from the style context.
gtk/gtkcssprovider.c | 1 +
gtk/gtkstyle.c | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 9b257ca..941ff79 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1783,6 +1783,7 @@ gtk_css_provider_get_default (void)
" foreground-color: @fg_color;\n"
" text-color: @text_color; \n"
" base-color: @base_color; \n"
+ " padding: 2 2; \n"
"}\n"
"\n"
"*:prelight {\n"
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index c405670..310da02 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -685,6 +685,7 @@ gtk_style_update_from_context (GtkStyle *style)
{
GtkStylePrivate *priv;
GtkStateType state;
+ GtkBorder *padding;
priv = GTK_STYLE_GET_PRIVATE (style);
@@ -696,7 +697,18 @@ gtk_style_update_from_context (GtkStyle *style)
set_color (style, priv->context, state, GTK_RC_TEXT);
}
- /* FIXME: thickness, font_desc */
+ if (style->font_desc)
+ pango_font_description_free (style->font_desc);
+
+ gtk_style_context_get (priv->context, state,
+ "font", &style->font_desc,
+ "padding", &padding,
+ NULL);
+
+ style->xthickness = padding->left;
+ style->ythickness = padding->top;
+
+ gtk_border_free (padding);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]