From 4a5c7ee4cc9d3b86c5cb971d86e583fd557398e8 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 14 Sep 2011 19:06:02 -0400 Subject: [PATCH] theme: Attached modal dialogs should have no top invisible border If we do this, then there will be invisible borders around the top of attached modal dialogs, which is unnecessary -- they can't be resized from the top border and just interfere with the parent dialog. This requires changing a bit of API to help identify the type of dialog. https://bugzilla.gnome.org/show_bug.cgi?id=657795 --- src/ui/theme-private.h | 2 ++ src/ui/theme.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h index de993cb6b..ba1943537 100644 --- a/src/ui/theme-private.h +++ b/src/ui/theme-private.h @@ -925,6 +925,7 @@ void meta_frame_layout_unref (MetaFrameLayout *layout) void meta_frame_layout_get_borders (const MetaFrameLayout *layout, int text_height, MetaFrameFlags flags, + MetaFrameType type, MetaFrameBorders *borders); void meta_frame_layout_calc_geometry (const MetaFrameLayout *layout, int text_height, @@ -932,6 +933,7 @@ void meta_frame_layout_calc_geometry (const MetaFrameLayout *layout int client_width, int client_height, const MetaButtonLayout *button_layout, + MetaFrameType type, MetaFrameGeometry *fgeom, MetaTheme *theme); diff --git a/src/ui/theme.c b/src/ui/theme.c index c8b5fc2d1..c6ed106d9 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -401,6 +401,7 @@ void meta_frame_layout_get_borders (const MetaFrameLayout *layout, int text_height, MetaFrameFlags flags, + MetaFrameType type, MetaFrameBorders *borders) { int buttons_height, title_height, draggable_borders; @@ -441,6 +442,9 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout, * pixels to get a proper feel. */ borders->invisible.top = MAX (0, draggable_borders - 2); + if (type == META_FRAME_TYPE_ATTACHED) + borders->invisible.top = 0; + borders->total.left = borders->invisible.left + borders->visible.left; borders->total.right = borders->invisible.right + borders->visible.right; borders->total.bottom = borders->invisible.bottom + borders->visible.bottom; @@ -612,6 +616,7 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout, int client_width, int client_height, const MetaButtonLayout *button_layout, + MetaFrameType type, MetaFrameGeometry *fgeom, MetaTheme *theme) { @@ -636,7 +641,7 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout, MetaFrameBorders borders; meta_frame_layout_get_borders (layout, text_height, - flags, + flags, type, &borders); fgeom->borders = borders; @@ -5521,6 +5526,7 @@ meta_theme_draw_frame_with_style (MetaTheme *theme, flags, client_width, client_height, button_layout, + type, &fgeom, theme); @@ -5580,7 +5586,7 @@ meta_theme_get_frame_borders (MetaTheme *theme, meta_frame_layout_get_borders (style->layout, text_height, - flags, + flags, type, borders); } @@ -5609,6 +5615,7 @@ meta_theme_calc_geometry (MetaTheme *theme, flags, client_width, client_height, button_layout, + type, fgeom, theme); }