From d397144b0f8f17842780ee23369b1d534f5bc1d4 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 15 Oct 2006 19:24:08 +0000 Subject: [PATCH] if there's not enough room to allow the window to expand to show the status/filter bars, first make the window smaller. --- macosx/Controller.m | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 4f3cb1e7e..67094dc84 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1765,6 +1765,20 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy float heightChange = [fStatusBar frame].size.height; if (!show) heightChange *= -1; + + //allow bar to show even if not enough room + if (show && ![fDefaults boolForKey: @"AutoSize"]) + { + float maxHeight = [[fWindow screen] visibleFrame].size.height - heightChange; + if (frame.size.height > maxHeight) + { + float change = maxHeight - frame.size.height; + frame.size.height += change; + frame.origin.y -= change; + + [fWindow setFrame: frame display: NO animate: NO]; + } + } frame.size.height += heightChange; frame.origin.y -= heightChange; @@ -1820,6 +1834,20 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy float heightChange = [fFilterBar frame].size.height; if (!show) heightChange *= -1; + + //allow bar to show even if not enough room + if (show && ![fDefaults boolForKey: @"AutoSize"]) + { + float maxHeight = [[fWindow screen] visibleFrame].size.height - heightChange; + if (frame.size.height > maxHeight) + { + float change = maxHeight - frame.size.height; + frame.size.height += change; + frame.origin.y -= change; + + [fWindow setFrame: frame display: NO animate: NO]; + } + } frame.size.height += heightChange; frame.origin.y -= heightChange; @@ -1830,7 +1858,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy [fFilterBar setAutoresizingMask: 0]; [fScrollView setAutoresizingMask: 0]; - [fWindow setFrame: frame display: YES animate: animate]; + [fWindow setFrame: frame display: YES animate: animate]; //re-enable autoresize [fFilterBar setAutoresizingMask: filterMask];