Revision: 4824
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4824&view=rev
Author:   hofman
Date:     2008-10-19 19:50:34 +0000 (Sun, 19 Oct 2008)

Log Message:
-----------
Remove left cap segment image, instead use a mirrored right cap

Modified Paths:
--------------
    trunk/NSImage_SKExtensions.h
    trunk/NSImage_SKExtensions.m
    trunk/SKSegmentedControl.m
    trunk/Skim.xcodeproj/project.pbxproj

Removed Paths:
-------------
    trunk/Images/Segment_LeftCap.tiff
    trunk/Images/Segment_LeftCapPress.tiff

Deleted: trunk/Images/Segment_LeftCap.tiff
===================================================================
(Binary files differ)

Deleted: trunk/Images/Segment_LeftCapPress.tiff
===================================================================
(Binary files differ)

Modified: trunk/NSImage_SKExtensions.h
===================================================================
--- trunk/NSImage_SKExtensions.h        2008-10-19 19:41:41 UTC (rev 4823)
+++ trunk/NSImage_SKExtensions.h        2008-10-19 19:50:34 UTC (rev 4824)
@@ -141,6 +141,10 @@
 - (void)drawFlippedInRect:(NSRect)dstRect fromRect:(NSRect)srcRect 
operation:(NSCompositingOperation)op fraction:(float)delta;
 - (void)drawFlipped:(BOOL)isFlipped inRect:(NSRect)dstRect 
fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op 
fraction:(float)delta;
 
+- (void)drawMirroredInRect:(NSRect)dstRect fromRect:(NSRect)srcRect 
operation:(NSCompositingOperation)op fraction:(float)delta;
+- (void)drawMirroredAndFlippedInRect:(NSRect)dstRect fromRect:(NSRect)srcRect 
operation:(NSCompositingOperation)op fraction:(float)delta;
+- (void)drawMirroredAndFlipped:(BOOL)isFlipped inRect:(NSRect)dstRect 
fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op 
fraction:(float)delta;
+
 - (NSBitmapImageRep *)bestImageRepForSize:(NSSize)preferredSize 
device:(NSDictionary *)deviceDescription;
 
 @end

Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m        2008-10-19 19:41:41 UTC (rev 4823)
+++ trunk/NSImage_SKExtensions.m        2008-10-19 19:50:34 UTC (rev 4824)
@@ -2005,6 +2005,35 @@
         [self drawInRect:dstRect fromRect:srcRect operation:op fraction:delta];
 }
 
+- (void)drawMirroredInRect:(NSRect)dstRect fromRect:(NSRect)srcRect 
operation:(NSCompositingOperation)op fraction:(float)delta {
+    [NSGraphicsContext saveGraphicsState];
+    NSAffineTransform *transform = [NSAffineTransform transform];
+    [transform translateXBy:NSMaxX(dstRect) yBy:0.0];
+    [transform scaleXBy:-1.0 yBy:1.0];
+    [transform translateXBy:-NSMinX(dstRect) yBy:0.0];
+    [transform concat];
+    [self drawInRect:dstRect fromRect:srcRect operation:op fraction:delta];
+    [NSGraphicsContext restoreGraphicsState];
+}
+
+- (void)drawMirroredAndFlippedInRect:(NSRect)dstRect fromRect:(NSRect)srcRect 
operation:(NSCompositingOperation)op fraction:(float)delta {
+    [NSGraphicsContext saveGraphicsState];
+    NSAffineTransform *transform = [NSAffineTransform transform];
+    [transform translateXBy:NSMaxX(dstRect) yBy:NSMaxY(dstRect)];
+    [transform scaleXBy:-1.0 yBy:-1.0];
+    [transform translateXBy:-NSMinX(dstRect) yBy:-NSMinY(dstRect)];
+    [transform concat];
+    [self drawInRect:dstRect fromRect:srcRect operation:op fraction:delta];
+    [NSGraphicsContext restoreGraphicsState];
+}
+
+- (void)drawMirroredAndFlipped:(BOOL)isFlipped inRect:(NSRect)dstRect 
fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op 
fraction:(float)delta {
+    if (isFlipped)
+        [self drawMirroredAndFlippedInRect:dstRect fromRect:srcRect 
operation:op fraction:delta];
+    else
+        [self drawMirroredInRect:dstRect fromRect:srcRect operation:op 
fraction:delta];
+}
+
 static NSComparisonResult compareImageRepWidths(NSBitmapImageRep *r1, 
NSBitmapImageRep *r2, void *ctxt)
 {
     NSSize s1 = [r1 size];

Modified: trunk/SKSegmentedControl.m
===================================================================
--- trunk/SKSegmentedControl.m  2008-10-19 19:41:41 UTC (rev 4823)
+++ trunk/SKSegmentedControl.m  2008-10-19 19:50:34 UTC (rev 4824)
@@ -113,8 +113,8 @@
         if (i == 0) {
             rect.size.width += SEGMENT_CAP_EXTRA_WIDTH;
             NSDivideRect(rect, &sideRect, &midRect, SEGMENT_CAP_WIDTH, 
NSMinXEdge);
-            image = [NSImage imageNamed:isPressed ? @"Segment_LeftCapPress" : 
@"Segment_LeftCap"];
-            [image drawFlipped:[controlView isFlipped] inRect:sideRect 
fromRect:capRect operation:NSCompositeSourceOver fraction:1.0];
+            image = [NSImage imageNamed:isPressed ? @"Segment_RightCapPress" : 
@"Segment_RightCap"];
+            [image drawMirroredAndFlipped:[controlView isFlipped] 
inRect:sideRect fromRect:capRect operation:NSCompositeSourceOver fraction:1.0];
         }
         if (i == count - 1) {
             rect.size.width += SEGMENT_CAP_EXTRA_WIDTH;

Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj        2008-10-19 19:41:41 UTC (rev 
4823)
+++ trunk/Skim.xcodeproj/project.pbxproj        2008-10-19 19:50:34 UTC (rev 
4824)
@@ -266,8 +266,6 @@
                CE4F9DEE0BC1BE3A005BE0A1 /* Localizable.strings in Resources */ 
= {isa = PBXBuildFile; fileRef = CE4F9DEC0BC1BE3A005BE0A1 /* 
Localizable.strings */; };
                CE51630A0EAB5A1A009FA237 /* SKSegmentedControl.h in Headers */ 
= {isa = PBXBuildFile; fileRef = CE5163080EAB5A1A009FA237 /* 
SKSegmentedControl.h */; };
                CE51630B0EAB5A1A009FA237 /* SKSegmentedControl.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE5163090EAB5A1A009FA237 /* 
SKSegmentedControl.m */; };
-               CE5163350EAB5EE2009FA237 /* Segment_LeftCap.tiff in Resources 
*/ = {isa = PBXBuildFile; fileRef = CE5163290EAB5EE2009FA237 /* 
Segment_LeftCap.tiff */; };
-               CE5163370EAB5EE2009FA237 /* Segment_LeftCapPress.tiff in 
Resources */ = {isa = PBXBuildFile; fileRef = CE51632B0EAB5EE2009FA237 /* 
Segment_LeftCapPress.tiff */; };
                CE5163380EAB5EE2009FA237 /* Segment_RightCap.tiff in Resources 
*/ = {isa = PBXBuildFile; fileRef = CE51632C0EAB5EE2009FA237 /* 
Segment_RightCap.tiff */; };
                CE51633A0EAB5EE2009FA237 /* Segment_RightCapPress.tiff in 
Resources */ = {isa = PBXBuildFile; fileRef = CE51632E0EAB5EE2009FA237 /* 
Segment_RightCapPress.tiff */; };
                CE51633C0EAB5EE2009FA237 /* Segment_SeparatorPress.tiff in 
Resources */ = {isa = PBXBuildFile; fileRef = CE5163300EAB5EE2009FA237 /* 
Segment_SeparatorPress.tiff */; };
@@ -779,8 +777,6 @@
                CE4F9DED0BC1BE3A005BE0A1 /* English */ = {isa = 
PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; 
name = English; path = English.lproj/Localizable.strings; sourceTree = 
"<group>"; };
                CE5163080EAB5A1A009FA237 /* SKSegmentedControl.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKSegmentedControl.h; sourceTree = "<group>"; };
                CE5163090EAB5A1A009FA237 /* SKSegmentedControl.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKSegmentedControl.m; sourceTree = "<group>"; };
-               CE5163290EAB5EE2009FA237 /* Segment_LeftCap.tiff */ = {isa = 
PBXFileReference; lastKnownFileType = image.tiff; path = Segment_LeftCap.tiff; 
sourceTree = "<group>"; };
-               CE51632B0EAB5EE2009FA237 /* Segment_LeftCapPress.tiff */ = {isa 
= PBXFileReference; lastKnownFileType = image.tiff; path = 
Segment_LeftCapPress.tiff; sourceTree = "<group>"; };
                CE51632C0EAB5EE2009FA237 /* Segment_RightCap.tiff */ = {isa = 
PBXFileReference; lastKnownFileType = image.tiff; path = Segment_RightCap.tiff; 
sourceTree = "<group>"; };
                CE51632E0EAB5EE2009FA237 /* Segment_RightCapPress.tiff */ = 
{isa = PBXFileReference; lastKnownFileType = image.tiff; path = 
Segment_RightCapPress.tiff; sourceTree = "<group>"; };
                CE5163300EAB5EE2009FA237 /* Segment_SeparatorPress.tiff */ = 
{isa = PBXFileReference; lastKnownFileType = image.tiff; path = 
Segment_SeparatorPress.tiff; sourceTree = "<group>"; };
@@ -1597,8 +1593,6 @@
                                CEAFFD9C0C40F2A800C3ECBB /* ToolbarLines.tiff 
*/,
                                CE6DC8890D68C657003A072F /* 
ToolbarMoveTool.tiff */,
                                CE6A5BB10D663771003B7CC3 /* ToolbarPrint.tiff 
*/,
-                               CE5163290EAB5EE2009FA237 /* 
Segment_LeftCap.tiff */,
-                               CE51632B0EAB5EE2009FA237 /* 
Segment_LeftCapPress.tiff */,
                                CE51632C0EAB5EE2009FA237 /* 
Segment_RightCap.tiff */,
                                CE51632E0EAB5EE2009FA237 /* 
Segment_RightCapPress.tiff */,
                                CE5163310EAB5EE2009FA237 /* 
Segment_Separator.tiff */,
@@ -2187,8 +2181,6 @@
                                CEAF36D70E672BB900491E3B /* MainWindow.nib in 
Resources */,
                                CEAF371A0E676EC300491E3B /* BookmarksWindow.nib 
in Resources */,
                                CE39C6E70E9BCA7B003FF992 /* NotesDocument.nib 
in Resources */,
-                               CE5163350EAB5EE2009FA237 /* 
Segment_LeftCap.tiff in Resources */,
-                               CE5163370EAB5EE2009FA237 /* 
Segment_LeftCapPress.tiff in Resources */,
                                CE5163380EAB5EE2009FA237 /* 
Segment_RightCap.tiff in Resources */,
                                CE51633A0EAB5EE2009FA237 /* 
Segment_RightCapPress.tiff in Resources */,
                                CE51633C0EAB5EE2009FA237 /* 
Segment_SeparatorPress.tiff in Resources */,


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to