Changeset 15034
- Timestamp:
- 01/22/2006 01:49:00 AM (3 years ago)
- Files:
-
- trunk/Plugins/Dual Window Interface/AIMessageViewController.m (modified) (1 diff)
- trunk/Plugins/Dual Window Interface/AIMessageWindowController.m (modified) (2 diffs)
- trunk/Plugins/WebKit Message View/AIWebKitMessageViewController.m (modified) (2 diffs)
- trunk/Plugins/WebKit Message View/AIWebkitMessageViewStyle.h (modified) (2 diffs)
- trunk/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m (modified) (3 diffs)
- trunk/Plugins/WebKit Message View/ESWebKitMessageViewPreferences.m (modified) (4 diffs)
- trunk/Plugins/WebKit Message View/ESWebView.h (modified) (1 diff)
- trunk/Plugins/WebKit Message View/ESWebView.m (modified) (2 diffs)
- trunk/Plugins/WebKit Message View/WebKitMessageView.ldb (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plugins/Dual Window Interface/AIMessageViewController.m
r14844 r15034 273 273 [controllerView_messages setFrame:[scrollView_messages documentVisibleRect]]; 274 274 [[customView_messages superview] replaceSubview:customView_messages with:controllerView_messages]; 275 276 //This is what draws our transparent background 277 //Technically, it could be set in MessageView.nib, too 278 [scrollView_messages setBackgroundColor:[NSColor clearColor]]; 279 275 280 [controllerView_messages setNextResponder:textView_outgoing]; 276 281 } trunk/Plugins/Dual Window Interface/AIMessageWindowController.m
r14671 r15034 89 89 //Load our window 90 90 myWindow = [self window]; 91 91 92 //Disable the optimization for opaque windows since ours might not be 93 [myWindow setOpaque:NO]; 94 92 95 //Tab hiding suppression (used to force tab bars visible when a drag is occuring) 93 96 tabBarIsVisible = YES; … … 298 301 299 302 [inTabViewItem setContainer:self]; 300 303 301 304 if (!silent) [[adium interfaceController] chatDidOpen:[inTabViewItem chat]]; 302 305 } trunk/Plugins/WebKit Message View/AIWebKitMessageViewController.m
r14669 r15034 336 336 [webView setDraggingDelegate:self]; 337 337 [webView setMaintainsBackForwardList:NO]; 338 338 339 339 if (!draggedTypes) { 340 340 draggedTypes = [[NSArray alloc] initWithObjects: … … 425 425 [messageStyle setCustomBackgroundColor:nil]; 426 426 } 427 427 [webView setDrawsBackground:![[self messageStyle] isBackgroundTransparent]]; 428 428 429 //Update webview font settings 429 430 NSString *fontFamily = [prefDict objectForKey:[plugin styleSpecificKey:@"FontFamily" forStyle:activeStyle]]; trunk/Plugins/WebKit Message View/AIWebkitMessageViewStyle.h
r11318 r15034 58 58 //Style settings 59 59 BOOL allowsCustomBackground; 60 BOOL transparentDefaultBackground; 60 61 BOOL allowsUserIcons; 61 62 BOOL usingCustomBaseHTML; … … 89 90 //Settings 90 91 - (BOOL)allowsCustomBackground; 92 - (BOOL)isBackgroundTransparent; 91 93 - (NSString *)defaultFontFamily; 92 94 - (NSNumber *)defaultFontSize; trunk/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m
r14625 r15034 92 92 //Style flags 93 93 allowsCustomBackground = ![[styleBundle objectForInfoDictionaryKey:@"DisableCustomBackground"] boolValue]; 94 transparentDefaultBackground = [[styleBundle objectForInfoDictionaryKey:@"DefaultBackgroundIsTransparent"] boolValue]; 95 94 96 combineConsecutive = ![[styleBundle objectForInfoDictionaryKey:@"DisableCombineConsecutive"] boolValue]; 95 97 … … 156 158 { 157 159 return allowsCustomBackground; 160 } 161 162 /*! 163 * @breif Style has a transparent background 164 */ 165 - (BOOL)isBackgroundTransparent 166 { 167 //Our custom background is only transparent if the user has set a custom color with an alpha component less than 1.0 168 return ((!customBackgroundColor && transparentDefaultBackground) || 169 (customBackgroundColor && [customBackgroundColor alphaComponent] < 0.99)); 158 170 } 159 171 … … 1024 1036 } 1025 1037 if (customBackgroundColor) { 1026 [bodyTag appendString:[NSString stringWithFormat:@"background-color: #%@; ", [customBackgroundColor hexString]]]; 1038 float red, green, blue, alpha; 1039 [customBackgroundColor getRed:&red green:&green blue:&blue alpha:&alpha]; 1040 [bodyTag appendString:[NSString stringWithFormat:@"background-color: rgba(%i, %i, %i, %f); ", (int)(red * 255.0), (int)(green * 255.0), (int)(blue * 255.0), alpha]]; 1027 1041 } 1028 1042 } trunk/Plugins/WebKit Message View/ESWebKitMessageViewPreferences.m
r14712 r15034 108 108 //Observe preference changes and set our initial preferences 109 109 [[adium preferenceController] registerPreferenceObserver:self forGroup:PREF_GROUP_WEBKIT_MESSAGE_DISPLAY]; 110 111 //Allow the alpha component to be set for our background color 112 [[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; 113 114 [self configureControlDimming]; 110 115 } 111 116 … … 115 120 - (void)viewWillClose 116 121 { 122 //Hide the alpha component 123 [[NSColorPanel sharedColorPanel] setShowsAlpha:NO]; 124 117 125 [[adium notificationCenter] removeObserver:self]; 118 126 [[adium preferenceController] unregisterPreferenceObserver:self]; … … 256 264 group:PREF_GROUP_WEBKIT_MESSAGE_DISPLAY]; 257 265 } 258 } 266 267 [self configureControlDimming]; 268 } 269 } 270 271 - (void)configureControlDimming 272 { 273 BOOL customBackground = [checkBox_useCustomBackground state]; 274 [popUp_backgroundImageType setEnabled:customBackground]; 275 [imageView_backgroundImage setEnabled:customBackground]; 276 [colorWell_customBackgroundColor setEnabled:customBackground]; 259 277 } 260 278 … … 576 594 message:message 577 595 autoreply:[[messageDict objectForKey:@"Autoreply"] boolValue]]; 578 596 579 597 //AIContentMessage won't know whether the message is outgoing unless we tell it since neither our source 580 598 //nor our destination are AIAccount objects. trunk/Plugins/WebKit Message View/ESWebView.h
r9455 r15034 21 21 BOOL allowsDragAndDrop; 22 22 BOOL shouldForwardEvents; 23 BOOL transparentBackground; 23 24 } 25 26 - (void)setDrawsBackground:(BOOL)flag; 27 - (BOOL)drawsBackground; 24 28 25 29 - (void)setFontFamily:(NSString *)familyName; trunk/Plugins/WebKit Message View/ESWebView.m
r12662 r15034 17 17 #import "ESWebView.h" 18 18 19 @interface WebView (PRIVATE) 20 - (void)setDrawsBackground:(BOOL)flag; 21 - (BOOL)drawsBackground; 22 @end 23 19 24 @interface ESWebView (PRIVATE) 20 25 - (void)forwardSelector:(SEL)selector withObject:(id)object; … … 25 30 - (id)initWithFrame:(NSRect)frameRect frameName:(NSString *)frameName groupName:(NSString *)groupName 26 31 { 27 [super initWithFrame:frameRect frameName:frameName groupName:groupName]; 28 29 draggingDelegate = nil; 30 allowsDragAndDrop = YES; 31 shouldForwardEvents = YES; 32 32 if ((self = [super initWithFrame:frameRect frameName:frameName groupName:groupName])) { 33 draggingDelegate = nil; 34 allowsDragAndDrop = YES; 35 shouldForwardEvents = YES; 36 transparentBackground = (![self drawsBackground]); 37 } 38 33 39 return self; 34 40 } 41 42 - (void)drawRect:(NSRect)rect 43 { 44 [super drawRect:rect]; 45 46 //Only reset the shadow if we're transparent 47 if (transparentBackground) { 48 //This happens after the next run loop to ensure that we invalidate the shadow after all of our subviews have drawn 49 [[self window] performSelector:@selector(invalidateShadow) 50 withObject:nil 51 afterDelay:0 52 inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSEventTrackingRunLoopMode, nil]]; 53 } 54 } 55 56 //Background Drawing --------------------------------------------------------------------------------------------------- 57 #pragma mark Background Drawing 58 - (void)setDrawsBackground:(BOOL)flag 59 { 60 if ([super respondsToSelector:@selector(setDrawsBackground:)]) { 61 [super setDrawsBackground:flag]; 62 transparentBackground = !flag; 63 } 64 } 65 - (BOOL)drawsBackground 66 { 67 BOOL flag = YES; 68 if ([super respondsToSelector:@selector(drawsBackground)]) flag = [super drawsBackground]; 69 return flag; 70 } 71 35 72 //Font Family ---------------------------------------------------------------------------------------------------------- 36 73 #pragma mark Font Family