adium 4271:83a1889b92c8: Fix a minor warning from the splitview ...

commits at adium.im commits at adium.im
Sat Oct 29 22:08:40 UTC 2011


details:	http://hg.adium.im/adium/rev/83a1889b92c8
revision:	4271:83a1889b92c8
branch:		(none)
author:		Stephen Holt <sholt at adium.im>
date:		Sat Oct 29 15:08:25 2011 -0700

Fix a minor warning from the splitview about message subview bounds after we've removed the userlist for single user chats

diffs (29 lines):

diff -r eaa71e28c9fe -r 83a1889b92c8 Plugins/Dual Window Interface/AIMessageViewController.m
--- a/Plugins/Dual Window Interface/AIMessageViewController.m	Sat Oct 29 14:26:33 2011 -0700
+++ b/Plugins/Dual Window Interface/AIMessageViewController.m	Sat Oct 29 15:08:25 2011 -0700
@@ -1329,6 +1329,7 @@
 			NSRect userFrame = view_userList.frame;
 			CGFloat dividerThickness = [splitView dividerThickness];
 			BOOL userListVisible = [self userListVisible];
+			BOOL userListAttached = view_userList.superview != nil;
 			
 			msgFrame.size.height = currentFrame.size.height;
 			userFrame.size.height = currentFrame.size.height;
@@ -1345,12 +1346,15 @@
 				}
 			}
 			
-			if (userListOnRight){
+			if (userListOnRight && userListAttached){
 				msgFrame.size.width = currentFrame.size.width - userFrame.size.width - dividerThickness;
 				userFrame.origin.x = msgFrame.size.width + dividerThickness;
-			} else {
+			} else if (userListAttached) {
 				msgFrame.origin.x = NSMaxX(userFrame) + dividerThickness;
 				msgFrame.size.width = currentFrame.size.width - userFrame.size.width - dividerThickness;
+			} else {
+				msgFrame.size.width = currentFrame.size.width;
+				userFrame.origin.x = userListOnRight? currentFrame.size.width + dividerThickness : -1;
 			}
 			
 			[view_userList setFrame:userFrame];




More information about the commits mailing list