adium-1.4 2882:b96f5cc1fbf2: Indicate the currently selected doc...
commits at adium.im
commits at adium.im
Tue Dec 8 04:24:53 UTC 2009
details: http://hg.adium.im/adium-1.4/rev/b96f5cc1fbf2
revision: 2882:b96f5cc1fbf2
author: Evan Schoenberg
date: Mon Dec 07 22:19:12 2009 -0600
Indicate the currently selected dock icon when showing all dock icons via the Appearance preferences
(transplanted from 0c299ebf38cfc9b772822a19a47920ef47a2749f)
Subject: adium-1.4 2883:e003a8f10ef9: Properly update the displayed dock icon in the Appearance preferences if it is changed via the show all dock icons sheet before the menu was clicked (and therefore built)
details: http://hg.adium.im/adium-1.4/rev/e003a8f10ef9
revision: 2883:e003a8f10ef9
author: Evan Schoenberg
date: Mon Dec 07 22:20:19 2009 -0600
Properly update the displayed dock icon in the Appearance preferences if it is changed via the show all dock icons sheet before the menu was clicked (and therefore built)
(transplanted from 06259ef49a44907d65ce888e808d42fea30e65fe)
Subject: adium-1.4 2884:bd554aa194d2: Patch from Luca Motta ('''lucamot''') which fixes dock icons with overlays randomly displaying as flipped upside down in the dock icon preview sheet. Thanks! The bug has existed as long as Adium has. Fixes #2812
details: http://hg.adium.im/adium-1.4/rev/bd554aa194d2
revision: 2884:bd554aa194d2
author: Evan Schoenberg
date: Mon Dec 07 22:24:50 2009 -0600
Patch from Luca Motta ('''lucamot''') which fixes dock icons with overlays randomly displaying as flipped upside down in the dock icon preview sheet. Thanks! The bug has existed as long as Adium has. Fixes #2812
(transplanted from b11b147bd3dba56f4327b3c65f50a8798aaabee2)
Subject: adium-1.4 2885:ce4a5e53e3cf: Added Luca Motta to the copyright file
details: http://hg.adium.im/adium-1.4/rev/ce4a5e53e3cf
revision: 2885:ce4a5e53e3cf
author: Evan Schoenberg
date: Mon Dec 07 22:25:17 2009 -0600
Added Luca Motta to the copyright file
(transplanted from 03fbcb47ee5f7b9ede4ae1f1080f54bc42508b82)
diffs (190 lines):
diff -r 6eed094a07df -r ce4a5e53e3cf Copyright.txt
--- a/Copyright.txt Mon Dec 07 20:46:52 2009 -0500
+++ b/Copyright.txt Mon Dec 07 22:25:17 2009 -0600
@@ -48,6 +48,7 @@
Sam McCandlish
Nicola Del Monaco
Yan Morissette
+Luca Motta
Jeffrey Melloy
David Munch
Roeland Nas
diff -r 6eed094a07df -r ce4a5e53e3cf Frameworks/AIUtilities Framework/Source/AIScaledImageCell.m
--- a/Frameworks/AIUtilities Framework/Source/AIScaledImageCell.m Mon Dec 07 20:46:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIScaledImageCell.m Mon Dec 07 22:25:17 2009 -0600
@@ -36,9 +36,6 @@
NSImage *img = [self image];
if (img) {
- //Handle flipped axis
- [img setFlipped:![img isFlipped]];
-
//Size and location
//Get image metrics
NSSize imgSize = [img size];
@@ -76,14 +73,27 @@
//Centering
targetRect = NSOffsetRect(targetRect, round((cellFrame.size.width - targetRect.size.width) / 2), round((cellFrame.size.height - targetRect.size.height) / 2));
+ //Flip & reposition image
+ [NSGraphicsContext saveGraphicsState];
+
+ long cellPosition = floor(cellFrame.origin.y / cellFrame.size.height) + 1;
+ long yOffset = fmodl(cellFrame.origin.y, cellFrame.size.height);
+
+ NSAffineTransform *xform = [NSAffineTransform transform];
+ [xform translateXBy: 0.f yBy: cellPosition * cellFrame.size.height + yOffset];
+ [xform scaleXBy: 1.f yBy: -1.f];
+ [xform concat];
+
+ //y offset already handled by translation
+ targetRect.origin.y = 0.f;
+
//Draw Image
[img drawInRect:targetRect
fromRect:imgRect
operation:NSCompositeSourceOver
fraction:([self isEnabled] ? 1.0 : 0.5)];
- //Clean-up
- [img setFlipped:![img isFlipped]];
+ [NSGraphicsContext restoreGraphicsState];
}
}
diff -r 6eed094a07df -r ce4a5e53e3cf Source/AIAppearancePreferences.m
--- a/Source/AIAppearancePreferences.m Mon Dec 07 20:46:52 2009 -0500
+++ b/Source/AIAppearancePreferences.m Mon Dec 07 22:25:17 2009 -0600
@@ -118,7 +118,9 @@
NSString *filenameExtension = [notification object];
//Convert our filename extension into a Uniform Type Identifier so that we can robustly determine what type of Xtra this is.
- CFStringRef type = (CFStringRef)[(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)filenameExtension, /*inConformingToUTI*/ NULL) autorelease];
+ CFStringRef type = (CFStringRef)[(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,
+ (CFStringRef)filenameExtension,
+ /*inConformingToUTI*/ NULL) autorelease];
if (!type || UTTypeEqual(type, CFSTR("com.adiumx.emoticonset"))) {
[self _rebuildEmoticonMenuAndSelectActivePack];
@@ -258,7 +260,11 @@
[popUp_colorTheme selectItemWithRepresentedObject:[prefDict objectForKey:KEY_LIST_THEME_NAME]];
}
if (firstTime || [key isEqualToString:KEY_ACTIVE_DOCK_ICON]) {
- [popUp_dockIcon selectItemWithRepresentedObject:[prefDict objectForKey:KEY_ACTIVE_DOCK_ICON]];
+ /* popUp_dockIcon initially is a single-item popup menu with just the active icon; it is built
+ * lazily in menuNeedsUpdate:. If we haven't displayed it yet, we'll need to configure again
+ * to show just the current icon */
+ if (![popUp_dockIcon selectItemWithRepresentedObject:[prefDict objectForKey:KEY_ACTIVE_DOCK_ICON]])
+ [self configureDockIconMenu];
}
}
}
diff -r 6eed094a07df -r ce4a5e53e3cf Source/AIContactListRecentImagesWindowController.m
--- a/Source/AIContactListRecentImagesWindowController.m Mon Dec 07 20:46:52 2009 -0500
+++ b/Source/AIContactListRecentImagesWindowController.m Mon Dec 07 22:25:17 2009 -0600
@@ -138,7 +138,6 @@
NSBezierPath *fullPath = [NSBezierPath bezierPathWithRect:NSMakeRect(0, 0, size.width, size.height)];
displayImage = [image copy];
- [displayImage setFlipped:YES];
[displayImage lockFocus];
if (index == currentHoveredIndex) {
diff -r 6eed094a07df -r ce4a5e53e3cf Source/AIDockIconSelectionSheet.m
--- a/Source/AIDockIconSelectionSheet.m Mon Dec 07 20:46:52 2009 -0500
+++ b/Source/AIDockIconSelectionSheet.m Mon Dec 07 22:25:17 2009 -0600
@@ -19,6 +19,8 @@
#import "AIAppearancePreferencesPlugin.h"
#import <AIUtilities/AIFileManagerAdditions.h>
#import <AIUtilities/AIImageGridView.h>
+#import <AIUtilities/AIBezierPathAdditions.h>
+#import <AIUtilities/AIGradientAdditions.h>
#import <Adium/AIIconState.h>
#define PREF_GROUP_DOCK_ICON @"Dock Icon"
@@ -120,49 +122,8 @@
}
}
-
-
-
-
//Build an array of available icon packs
-
-
-//- (void)_buildIconArray
-//{
-// NSDirectoryEnumerator *fileEnumerator;
-// NSString *iconPath;
-// NSString *filePath;
-// NSEnumerator *enumerator;
-//
-// //Create a fresh icon array
-// [iconArray release]; iconArray = [[NSMutableArray alloc] init];
-// enumerator = [[adium resourcePathsForName:FOLDER_DOCK_ICONS] objectEnumerator];
-//
-// while ((iconPath = [enumerator nextObject])) {
-// fileEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:iconPath];
-//
-// //Find all the .AdiumIcon's
-// while ((filePath = [fileEnumerator nextObject])) {
-// if ([[filePath pathExtension] caseInsensitiveCompare:@"AdiumIcon"] == NSOrderedSame) {
-// NSString *fullPath;
-// AIIconState *previewState;
-//
-// //Get the icon pack's full path and preview state
-// fullPath = [iconPath stringByAppendingPathComponent:filePath];
-// previewState = [adium.dockController previewStateForIconPackAtPath:fullPath];
-//
-// //Add this icon to our icon array
-// [iconArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:fullPath, @"Path", previewState, @"State", previewState, @"Original State", nil]];
-// }
-// }
-// }
-//
-// //Update our view and re-select the correct icon
-// [imageGridView_icons reloadData];
-// [self selectIconWithName:[adium.preferenceController preferenceForKey:KEY_ACTIVE_DOCK_ICON group:PREF_GROUP_APPEARANCE]];
-//}
-
//Set the selected icon by name
- (void)selectIconWithName:(NSString *)selectName
{
@@ -238,13 +199,30 @@
return [iconArray count];
}
-- (NSImage *)imageGridView:(AIImageGridView *)imageGridView imageAtIndex:(NSUInteger)index
+- (NSImage *)imageGridView:(AIImageGridView *)imageGridView imageAtIndex:(NSUInteger)inIndex
{
- if (index == animatedIndex) {
- return [animatedIconState image];
- } else {
- return [[[iconArray objectAtIndex:index] objectForKey:@"State"] image];
+ NSImage *image = ((inIndex == animatedIndex) ?
+ animatedIconState.image :
+ [[[iconArray objectAtIndex:inIndex] objectForKey:@"State"] image]);
+
+ if (inIndex == imageGridView_icons.selectedIndex) {
+ NSSize size = image.size;
+ NSRect fullRect = NSMakeRect(0, 0, size.width, size.height);
+ NSImage *selectedImage = [[NSImage alloc] initWithSize:size];
+ [selectedImage lockFocus];
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:fullRect
+ radius:6.0];
+ [[NSGradient selectedControlGradient] drawInBezierPath:path angle:90];
+ [image drawInRect:fullRect
+ fromRect:fullRect
+ operation:NSCompositeSourceOver
+ fraction:0.9];
+ [selectedImage unlockFocus];
+
+ image = [selectedImage autorelease];
}
+
+ return image;
}
- (void)imageGridViewSelectionDidChange:(NSNotification *)notification
More information about the commits
mailing list