summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2009-10-23 19:54:28 -0400
committerThomas Thurman <tthurman@gnome.org>2009-10-23 19:54:28 -0400
commitc981e806658e4302b23c190b7d42d59f4b3f5b15 (patch)
tree0cb219aaec44c4f6f01e08381e22ebebf3623ea6
parent894213c5260178132bf708dcd447d418cbf2cc1f (diff)
downloadmetacity-c981e806658e4302b23c190b7d42d59f4b3f5b15.tar.gz
max/min button widths
-rw-r--r--src/ui/theme.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index c536c91a..5c973921 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -643,7 +643,9 @@ cowbell_get_button_width (MetaTheme *theme,
double width=0.0, height=0.0;
ccss_style_t *style = cowbell_get_current_style (theme, type, flags, button);
double aspect_ratio;
+ double result;
+ /* FIXME: maybe check these are ordered correctly */
ccss_style_get_double (style, "min-width", &min_width);
ccss_style_get_double (style, "max-width", &max_width);
@@ -676,7 +678,12 @@ cowbell_get_button_width (MetaTheme *theme,
/* FIXME honour min/max width */
- return (int) (width / aspect_ratio);
+ result = width / aspect_ratio;
+
+ if (min_width!=0 && result<min_width) result = min_width;
+ if (max_width!=0 && result>max_width) result = max_width;
+
+ return (int) result;
}
void