adium 3793:7dc5398115ce: Floating text field concept:

commits at adium.im commits at adium.im
Thu Mar 31 01:21:04 UTC 2011


details:	http://hg.adium.im/adium/rev/7dc5398115ce
revision:	3793:7dc5398115ce
branch:		FloatingMessageWindowTextField
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Thu Mar 31 03:20:18 2011 +0200

Floating text field concept:

* Turn off CoreAnimation for the webview. This sucked.
* Adjust width of the box depending on if the webview shows a scrollbar (still needs a -setNeedsDisplay: when needed).
* Activate the message field when the user clicks anywhere in the area.

diffs (55 lines):

diff -r 82dd4d6bcb26 -r 7dc5398115ce Plugins/Dual Window Interface/MessageView.nib/keyedobjects.nib
Binary file Plugins/Dual Window Interface/MessageView.nib/keyedobjects.nib has changed
diff -r 82dd4d6bcb26 -r 7dc5398115ce Source/AIPrettyView.h
--- a/Source/AIPrettyView.h	Thu Mar 31 01:51:26 2011 +0200
+++ b/Source/AIPrettyView.h	Thu Mar 31 03:20:18 2011 +0200
@@ -15,12 +15,15 @@
  */
 
 #import <Cocoa/Cocoa.h>
+#import <Adium/AIMessageEntryTextView.h>
+#import "AIMessageWindowOutgoingScrollView.h"
 
 /**
  *  @brief The white border around floating text input fields.
  */
 @interface AIPrettyView : NSView {
-
+	IBOutlet AIMessageEntryTextView *entryField;
+	IBOutlet AIMessageWindowOutgoingScrollView *messageView;
 }
 
 @end
diff -r 82dd4d6bcb26 -r 7dc5398115ce Source/AIPrettyView.m
--- a/Source/AIPrettyView.m	Thu Mar 31 01:51:26 2011 +0200
+++ b/Source/AIPrettyView.m	Thu Mar 31 03:20:18 2011 +0200
@@ -29,11 +29,28 @@
 }
 
 - (void)drawRect:(NSRect)dirtyRect {
-    NSBezierPath *bp = [NSBezierPath bezierPathWithRoundedRect:dirtyRect radius:5.0];
+	
+	NSRect insetRect = NSMakeRect(self.frame.origin.x + 5, self.frame.origin.y + 5, self.frame.size.width - 10, self.frame.size.height - 10);
+	
+	if ([[[[[[[[messageView contentView] subviews] objectAtIndex:0] subviews] objectAtIndex:0] subviews] objectAtIndex:0] hasVerticalScroller]) {
+		insetRect.size.width -= [messageView verticalScroller].frame.size.width;
+	}
+	
+    NSBezierPath *bp = [NSBezierPath bezierPathWithRoundedRect:insetRect radius:5.0];
 	
 	[[NSColor whiteColor] set];
 	
 	[bp fill];
+	
+	NSRect entryRect = NSMakeRect(10, 10, insetRect.size.width - 10, insetRect.size.height - 10);
+	
+	[entryField enclosingScrollView].frame = entryRect;
 }
 
+- (void)mouseDown:(NSEvent *)event
+{
+	[[entryField window] makeFirstResponder:entryField];
+}
+
+
 @end




More information about the commits mailing list