summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJess VanDerwalker <washu@sonic.net>2012-07-25 11:25:18 -0700
committerJess VanDerwalker <washu@sonic.net>2012-07-25 13:06:03 -0700
commitd0224611012556ffc6bda9cef75b4e7371d0893d (patch)
tree8b979cdd2bc88e7615b35f1a1d8e09c02fb58e23
parent72257f8c6fb0010b61fff10600a58c8422822aec (diff)
xtoq: Support for window sizing restrictions added.
On window creation, XtoQ gets the sizing data for the window and sets the resizing increments, max size, and min size of the window. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r--src/xtoq/XtoqController.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m
index 67f833f..131e7c5 100644
--- a/src/xtoq/XtoqController.m
+++ b/src/xtoq/XtoqController.m
@@ -497,6 +497,21 @@
[newWindow setTitle: winTitle];
free(name);
+ // Set the sizing for the window, if we have values.
+ xcwm_window_sizing_t const *sizing = xcwm_window_get_sizing(window);
+ if (sizing->min_width > 0 || sizing->min_height > 0) {
+ [newWindow setContentMinSize: NSMakeSize(sizing->min_width,
+ sizing->min_height)];
+ }
+ if (sizing->max_width > 0 || sizing->max_height > 0) {
+ [newWindow setContentMaxSize: NSMakeSize(sizing->max_width,
+ sizing->max_height)];
+ }
+ if (sizing->width_inc > 0 || sizing->height_inc > 0) {
+ [newWindow setContentResizeIncrements: NSMakeSize(sizing->width_inc,
+ sizing->height_inc)];
+ }
+
//shows the window
[newWindow makeKeyAndOrderFront: self];
}