[Xfce4-commits] [panel-plugins/xfce4-genmon-plugin] 01/02: As was done in datetime plugin, split the font description to apply it as CSS
noreply at xfce.org
noreply at xfce.org
Wed Nov 2 17:05:18 CET 2016
This is an automated email from the git hooks/post-receive script.
landry pushed a commit to branch master
in repository panel-plugins/xfce4-genmon-plugin.
commit c249e9c4243d27cae39ebbb6b57e99e65b8ef73e
Author: Landry Breuil <landry at xfce.org>
Date: Wed Nov 2 17:00:18 2016 +0100
As was done in datetime plugin, split the font description to apply it as CSS
---
panel-plugin/main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index b4ed15b..4436bb1 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -474,6 +474,19 @@ static int SetMonitorFont (void *p_pvPlugin)
GtkCssProvider *css_provider;
gchar * css;
#if GTK_CHECK_VERSION (3, 20, 0)
+ PangoFontDescription *font;
+ font = pango_font_description_from_string(poConf->acFont);
+ if (G_LIKELY (font))
+ {
+ css = g_strdup_printf("label { font-family: %s; font-size: %dpx; font-style: %s; font-weight: %s }",
+ pango_font_description_get_family (font),
+ pango_font_description_get_size (font) / PANGO_SCALE,
+ (pango_font_description_get_style(font) == PANGO_STYLE_ITALIC ||
+ pango_font_description_get_style(font) == PANGO_STYLE_OBLIQUE) ? "italic" : "normal",
+ (pango_font_description_get_weight(font) >= PANGO_WEIGHT_BOLD) ? "bold" : "normal");
+ pango_font_description_free (font);
+ }
+ else
css = g_strdup_printf("label { font: %s; }",
#else
css = g_strdup_printf(".label { font: %s; }",
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list