[mutter] theme: Scale whitespace from theme with title_scale factor
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] theme: Scale whitespace from theme with title_scale factor
- Date: Mon, 29 Dec 2014 16:58:29 +0000 (UTC)
commit 8a7a01b0cf284c6e70e4d70ddaade13998b34298
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Sep 25 22:55:53 2014 +0200
theme: Scale whitespace from theme with title_scale factor
GTK+ doesn't deal with different frame types for its client-side
decorations - it just treats dialogs the same as normal windows
and ignores the odder frame types like UTILITY and MENU. That's
fine as those have largely gone out of fashion anyway, but it's a
different case for the WM - we still have to support them somehow.
For now, just apply the existing title_scale factor to the geometry
information picked up from the theme in addition to the title font.
If it turns out that there's demand for something more sophisticated,
we can still consider adding wm-only style information to the GTK+
theme.
https://bugzilla.gnome.org/show_bug.cgi?id=741917
src/ui/theme.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 1a94df4..c96858c 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -543,6 +543,16 @@ get_padding_and_border (GtkStyleContext *style,
}
static void
+scale_border (GtkBorder *border,
+ double factor)
+{
+ border->left *= factor;
+ border->right *= factor;
+ border->top *= factor;
+ border->bottom *= factor;
+}
+
+static void
meta_frame_layout_sync_with_style (MetaFrameLayout *layout,
MetaStyleInfo *style_info,
MetaFrameFlags flags)
@@ -557,6 +567,7 @@ meta_frame_layout_sync_with_style (MetaFrameLayout *layout,
style = style_info->styles[META_STYLE_ELEMENT_FRAME];
get_padding_and_border (style, &border);
+ scale_border (&border, layout->title_scale);
layout->left_width = border.left;
layout->right_width = border.right;
@@ -585,6 +596,7 @@ meta_frame_layout_sync_with_style (MetaFrameLayout *layout,
layout->bottom_right_corner_rounded_radius = MAX (border_radius, max_radius);
get_padding_and_border (style, &border);
+ scale_border (&border, layout->title_scale);
layout->left_titlebar_edge = border.left;
layout->right_titlebar_edge = border.right;
layout->title_vertical_pad = border.top;
@@ -599,11 +611,13 @@ meta_frame_layout_sync_with_style (MetaFrameLayout *layout,
style = style_info->styles[META_STYLE_ELEMENT_BUTTON];
get_padding_and_border (style, &border);
+ scale_border (&border, layout->title_scale);
layout->button_width += border.left + border.right;
layout->button_height += border.top + border.bottom;
style = style_info->styles[META_STYLE_ELEMENT_IMAGE];
get_padding_and_border (style, &border);
+ scale_border (&border, layout->title_scale);
layout->button_width += border.left + border.right;
layout->button_height += border.top + border.bottom;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]