mirror of
https://github.com/brl/mutter.git
synced 2025-02-25 01:04:10 +00:00
ui: We now always have a theme
This commit is contained in:
parent
af7f51b992
commit
b47afe89d3
53
src/ui/ui.c
53
src/ui/ui.c
@ -531,46 +531,33 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
|
|||||||
const PangoFontDescription *font_desc;
|
const PangoFontDescription *font_desc;
|
||||||
PangoFontDescription *free_font_desc = NULL;
|
PangoFontDescription *free_font_desc = NULL;
|
||||||
|
|
||||||
if (meta_ui_have_a_theme ())
|
GdkDisplay *display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
||||||
|
GdkScreen *screen = gdk_display_get_screen (display, XScreenNumberOfScreen (ui->xscreen));
|
||||||
|
|
||||||
|
style_info = meta_theme_create_style_info (screen, NULL);
|
||||||
|
|
||||||
|
context = gtk_widget_get_pango_context (GTK_WIDGET (ui->frames));
|
||||||
|
font_desc = meta_prefs_get_titlebar_font ();
|
||||||
|
|
||||||
|
if (!font_desc)
|
||||||
{
|
{
|
||||||
GdkDisplay *display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
free_font_desc = meta_style_info_create_font_desc (style_info);
|
||||||
GdkScreen *screen = gdk_display_get_screen (display, XScreenNumberOfScreen (ui->xscreen));
|
font_desc = (const PangoFontDescription *) free_font_desc;
|
||||||
|
|
||||||
style_info = meta_theme_create_style_info (screen, NULL);
|
|
||||||
|
|
||||||
context = gtk_widget_get_pango_context (GTK_WIDGET (ui->frames));
|
|
||||||
font_desc = meta_prefs_get_titlebar_font ();
|
|
||||||
|
|
||||||
if (!font_desc)
|
|
||||||
{
|
|
||||||
free_font_desc = meta_style_info_create_font_desc (style_info);
|
|
||||||
font_desc = (const PangoFontDescription *) free_font_desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
text_height = meta_pango_font_desc_get_text_height (font_desc, context);
|
|
||||||
|
|
||||||
meta_theme_get_frame_borders (meta_theme_get_default (),
|
|
||||||
style_info, type, text_height, flags,
|
|
||||||
borders);
|
|
||||||
|
|
||||||
if (free_font_desc)
|
|
||||||
pango_font_description_free (free_font_desc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
meta_frame_borders_clear (borders);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
text_height = meta_pango_font_desc_get_text_height (font_desc, context);
|
||||||
|
|
||||||
|
meta_theme_get_frame_borders (meta_theme_get_default (),
|
||||||
|
style_info, type, text_height, flags,
|
||||||
|
borders);
|
||||||
|
|
||||||
|
if (free_font_desc)
|
||||||
|
pango_font_description_free (free_font_desc);
|
||||||
|
|
||||||
if (style_info != NULL)
|
if (style_info != NULL)
|
||||||
meta_style_info_unref (style_info);
|
meta_style_info_unref (style_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_ui_have_a_theme (void)
|
|
||||||
{
|
|
||||||
return meta_theme_get_default () != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_ui_window_is_widget (MetaUI *ui,
|
meta_ui_window_is_widget (MetaUI *ui,
|
||||||
Window xwindow)
|
Window xwindow)
|
||||||
|
@ -104,8 +104,6 @@ void meta_ui_repaint_frame (MetaUI *ui,
|
|||||||
gboolean meta_ui_window_should_not_cause_focus (Display *xdisplay,
|
gboolean meta_ui_window_should_not_cause_focus (Display *xdisplay,
|
||||||
Window xwindow);
|
Window xwindow);
|
||||||
|
|
||||||
gboolean meta_ui_have_a_theme (void);
|
|
||||||
|
|
||||||
gboolean meta_ui_window_is_widget (MetaUI *ui,
|
gboolean meta_ui_window_is_widget (MetaUI *ui,
|
||||||
Window xwindow);
|
Window xwindow);
|
||||||
gboolean meta_ui_window_is_dummy (MetaUI *ui,
|
gboolean meta_ui_window_is_dummy (MetaUI *ui,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user