summaryrefslogtreecommitdiff
path: root/libmetacity/meta-theme.c
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-02-03 22:11:01 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-02-03 22:11:01 +0200
commit1ec1849e202687298af71f5f480456585adaac08 (patch)
tree0a0b82eff91bec35dff71d390ec6331a9aa32034 /libmetacity/meta-theme.c
parentc7200decbb68e73963b7cf1b3b6434d0b119a91e (diff)
downloadmetacity-1ec1849e202687298af71f5f480456585adaac08.tar.gz
theme: move meta_style_info_create_font_desc to libmetacity
Diffstat (limited to 'libmetacity/meta-theme.c')
-rw-r--r--libmetacity/meta-theme.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/libmetacity/meta-theme.c b/libmetacity/meta-theme.c
index bad12d51..86818fea 100644
--- a/libmetacity/meta-theme.c
+++ b/libmetacity/meta-theme.c
@@ -280,12 +280,6 @@ meta_theme_set_titlebar_font (MetaTheme *theme,
theme->titlebar_font = pango_font_description_copy (titlebar_font);
}
-const PangoFontDescription *
-meta_theme_get_titlebar_font (MetaTheme *theme)
-{
- return theme->titlebar_font;
-}
-
MetaThemeType
meta_theme_get_theme_type (MetaTheme *theme)
{
@@ -389,6 +383,29 @@ meta_theme_get_frame_style (MetaTheme *theme,
return style;
}
+PangoFontDescription*
+meta_style_info_create_font_desc (MetaTheme *theme,
+ MetaStyleInfo *style_info)
+{
+ GtkStyleContext *context;
+ PangoFontDescription *font_desc;
+
+ context = style_info->styles[META_STYLE_ELEMENT_TITLE];
+
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
+
+ gtk_style_context_get (context, GTK_STATE_FLAG_NORMAL,
+ "font", &font_desc, NULL);
+
+ gtk_style_context_restore (context);
+
+ if (theme->titlebar_font)
+ pango_font_description_merge (font_desc, theme->titlebar_font, TRUE);
+
+ return font_desc;
+}
+
gboolean
meta_theme_allows_shade_stick_above_buttons (MetaTheme *theme)
{