[metacity] theme: read margin from gtk+ theme
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] theme: read margin from gtk+ theme
- Date: Sun, 5 Apr 2015 20:45:53 +0000 (UTC)
commit b9d13506d486ddd21c3e019baa8236d0a4438b93
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Apr 4 20:08:05 2015 +0300
theme: read margin from gtk+ theme
And use it as invisible area for resizing if compositing manager
is running otherwise use as extra size for visible border.
src/ui/theme.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 1bbb993..fc16f9f 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -625,6 +625,17 @@ strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER],
}
static void
+get_margin (GtkStyleContext *style,
+ GtkBorder *border)
+{
+ GtkStateFlags state;
+
+ state = gtk_style_context_get_state (style);
+
+ gtk_style_context_get_margin (style, state, border);
+}
+
+static void
get_padding_and_border (GtkStyleContext *style,
GtkBorder *border)
{
@@ -678,6 +689,17 @@ meta_frame_layout_sync_with_style (MetaFrameLayout *layout,
layout->right_width = border.right;
layout->bottom_height = border.bottom;
+ if (compositing_manager)
+ get_margin (style, &layout->invisible_border);
+ else
+ {
+ get_margin (style, &border);
+
+ layout->left_width += border.left;
+ layout->right_width += border.right;
+ layout->bottom_height += border.bottom;
+ }
+
if (layout->hide_buttons)
layout->icon_size = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]