diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-04-04 20:08:05 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-04-04 20:08:05 +0300 |
commit | b9d13506d486ddd21c3e019baa8236d0a4438b93 (patch) | |
tree | b68ee495df7ffbbe31377b55d57ae2016e9cab87 | |
parent | 354c0352d7c6ea1c9104c518cebf24f4881d9281 (diff) | |
download | metacity-b9d13506d486ddd21c3e019baa8236d0a4438b93.tar.gz |
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.
-rw-r--r-- | 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 1bbb9932..fc16f9fa 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; |