adium 4362:b3df28c10c74: Fix opening position, in a way that mos...

commits at adium.im commits at adium.im
Sat Dec 10 20:10:01 UTC 2011


details:	http://hg.adium.im/adium/rev/b3df28c10c74
revision:	4362:b3df28c10c74
branch:		EmoticonsMenu
author:		Adrian Godoroja <robotive at me.com>
date:		Sat Dec 10 22:09:17 2011 +0200

Fix opening position, in a way that most of the times will prevent the menu from covering the text input and the message view.

diffs (32 lines):

diff -r f4b06cb13b51 -r b3df28c10c74 Frameworks/Adium Framework/Source/AIMessageEntryTextView.m
--- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Sat Dec 10 21:36:51 2011 +0200
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Sat Dec 10 22:09:17 2011 +0200
@@ -1873,7 +1873,7 @@
     if ([self hasEmoticonsMenu]) {
 		NSRect menuButtonRect = [[self emoticonsMenuButton] frame];
 
-    	[AIMessageViewEmoticonsController popUpMenuForTextView:self atPoint:NSMakePoint(menuButtonRect.origin.x + menuButtonRect.size.width - INDICATOR_RIGHT_PADDING, menuButtonRect.origin.y - menuButtonRect.size.height + 2.0f)];
+    	[AIMessageViewEmoticonsController popUpMenuForTextView:self atPoint:NSMakePoint(menuButtonRect.origin.x + menuButtonRect.size.width - INDICATOR_RIGHT_PADDING, menuButtonRect.origin.y + menuButtonRect.size.height)];
     }
 }
 
diff -r f4b06cb13b51 -r b3df28c10c74 Source/AIMessageViewEmoticonsController.m
--- a/Source/AIMessageViewEmoticonsController.m	Sat Dec 10 21:36:51 2011 +0200
+++ b/Source/AIMessageViewEmoticonsController.m	Sat Dec 10 22:09:17 2011 +0200
@@ -187,12 +187,13 @@
 		/*[menu popUpMenuPositioningItem:[menu itemAtIndex:0]
 							atLocation:NSMakePoint([aView frame].size.width - [menu size].width - 5.0f, -[menu size].height)
 								inView:[aView superview]];*/
-		//[aView bounds].size.width - [menu size].width - 5.0f, [aView bounds].size.height - [menu size].height
+		//[aView bounds].size.width - [menu size].width - 5.0f, [aView bounds].size.height - [menu size].height		
+		//([menu numberOfItems] - 1)
 		
 		// Adjust opening position
 		aPoint.x -= [menu size].width;
-		
-		[menu popUpMenuPositioningItem:[menu itemAtIndex:([menu numberOfItems] - 1)]
+
+		[menu popUpMenuPositioningItem:[menu itemAtIndex:0]
 							atLocation:aPoint
 								inView:[aView superview]];
 	}




More information about the commits mailing list