[metacity/wip/gtk-theme: 18/41] theme: Attached modal dialogs should have no top invisible border
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/wip/gtk-theme: 18/41] theme: Attached modal dialogs should have no top invisible border
- Date: Wed, 7 Jan 2015 12:37:37 +0000 (UTC)
commit 64f9c4b7e31feb5b9c421de7581359041d868ed4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Sep 14 19:06:02 2011 -0400
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.c | 9 +++++++++
src/ui/theme.h | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 109a9aa..d342229 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -407,6 +407,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;
@@ -449,6 +450,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;
@@ -713,6 +717,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)
{
@@ -738,6 +743,7 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
meta_frame_layout_get_borders (layout, text_height,
flags,
+ type,
&borders);
fgeom->borders = borders;
@@ -5771,6 +5777,7 @@ meta_theme_draw_frame (MetaTheme *theme,
flags,
client_width, client_height,
button_layout,
+ type,
&fgeom,
theme);
@@ -5807,6 +5814,7 @@ meta_theme_get_frame_borders (MetaTheme *theme,
meta_frame_layout_get_borders (style->layout,
text_height,
flags,
+ type,
borders);
}
@@ -5835,6 +5843,7 @@ meta_theme_calc_geometry (MetaTheme *theme,
flags,
client_width, client_height,
button_layout,
+ type,
fgeom,
theme);
}
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 2b1de34..f991caf 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -899,6 +899,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);
gboolean meta_frame_layout_validate (const MetaFrameLayout *layout,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]