diff --git a/Medianno.xcodeproj/project.pbxproj b/Medianno.xcodeproj/project.pbxproj index e1b9f6c..64678c5 100644 --- a/Medianno.xcodeproj/project.pbxproj +++ b/Medianno.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 950BB7A713F467A400D8E669 /* MAAddMedia.xib in Resources */ = {isa = PBXBuildFile; fileRef = 950BB7A513F467A400D8E669 /* MAAddMedia.xib */; }; 950BB7AA13F46BAF00D8E669 /* MAAddMediaSheet.mm in Sources */ = {isa = PBXBuildFile; fileRef = 950BB7A913F46BAF00D8E669 /* MAAddMediaSheet.mm */; }; 950BB7AD13F46ECF00D8E669 /* MAAppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 950BB7AC13F46ECF00D8E669 /* MAAppController.mm */; }; + 9556F185140426EB00B81D2E /* MAToolbarButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9556F184140426EB00B81D2E /* MAToolbarButton.mm */; }; 95BCFA2113F76A04000F650F /* app.icns in Resources */ = {isa = PBXBuildFile; fileRef = 95BCFA1F13F76A04000F650F /* app.icns */; }; 95BCFA2213F76A04000F650F /* doc.icns in Resources */ = {isa = PBXBuildFile; fileRef = 95BCFA2013F76A04000F650F /* doc.icns */; }; 95BCFA2E13F8A3AD000F650F /* MAShortenQTTime.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95BCFA2D13F8A3AD000F650F /* MAShortenQTTime.mm */; }; @@ -77,6 +78,8 @@ 950BB7A913F46BAF00D8E669 /* MAAddMediaSheet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MAAddMediaSheet.mm; sourceTree = ""; }; 950BB7AB13F46ECF00D8E669 /* MAAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAAppController.h; sourceTree = ""; }; 950BB7AC13F46ECF00D8E669 /* MAAppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MAAppController.mm; sourceTree = ""; }; + 9556F183140426EB00B81D2E /* MAToolbarButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAToolbarButton.h; sourceTree = ""; }; + 9556F184140426EB00B81D2E /* MAToolbarButton.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MAToolbarButton.mm; sourceTree = ""; }; 95BCFA1F13F76A04000F650F /* app.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = app.icns; path = Resources/app.icns; sourceTree = ""; }; 95BCFA2013F76A04000F650F /* doc.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = doc.icns; path = Resources/doc.icns; sourceTree = ""; }; 95BCFA2C13F8A3AD000F650F /* MAShortenQTTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAShortenQTTime.h; sourceTree = ""; }; @@ -235,6 +238,8 @@ 95E2027C13FE9BF500369B31 /* MAMovieWindow.m */, 95D8038914012D7A000C0779 /* MADragging.h */, 95D8038A14012D7A000C0779 /* MADragging.mm */, + 9556F183140426EB00B81D2E /* MAToolbarButton.h */, + 9556F184140426EB00B81D2E /* MAToolbarButton.mm */, ); name = Classes; sourceTree = ""; @@ -335,6 +340,7 @@ 95CB69711400112A005A0346 /* MATagWindow.mm in Sources */, 95CB697814001F26005A0346 /* MAColorForTag.mm in Sources */, 95D8038B14012D7A000C0779 /* MADragging.mm in Sources */, + 9556F185140426EB00B81D2E /* MAToolbarButton.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Medianno/MADocWindow.mm b/Medianno/MADocWindow.mm index 0a9752e..40017cd 100644 --- a/Medianno/MADocWindow.mm +++ b/Medianno/MADocWindow.mm @@ -291,20 +291,17 @@ static const char * kMADocWindowObserver = "MADocWindowObserver"; title = NSLocalizedString(@"Pause", @"Pause playback"); else title = NSLocalizedString(@"Play", @"Start playback"); - if ([item isKindOfClass:[NSToolbarItem class]]) { - [item setLabel:title]; + if ([(NSObject *)item isKindOfClass:[NSToolbarItem class]]) { + NSToolbarItem * toolbarItem = (NSToolbarItem *)item; + [toolbarItem setLabel:title]; if ([currentMovie rate] > 0.0f) - [item setImage:[NSImage imageNamed:@"pause.icns"]]; + [toolbarItem setImage:[NSImage imageNamed:@"pause.icns"]]; else - [item setImage:[NSImage imageNamed:@"play.icns"]]; + [toolbarItem setImage:[NSImage imageNamed:@"play.icns"]]; } else { - [item setTitle:title]; + [(NSMenuItem *)item setTitle:title]; } } - if ([item action] == @selector(mediaSkipForward:) - || [item action] == @selector(mediaSkipBackward:) - ) - [[item _button] setContinuous:YES]; return [mediaController selectionIndex] != NSNotFound; } diff --git a/Medianno/MAToolbarButton.h b/Medianno/MAToolbarButton.h new file mode 100644 index 0000000..aa50636 --- /dev/null +++ b/Medianno/MAToolbarButton.h @@ -0,0 +1,13 @@ +// +// MAToolbarButton.h +// Medianno +// +// Created by Matthias Neeracher on 8/23/11. +// Copyright 2011 Matthias Neeracher. All rights reserved. +// + +#import + +@interface MAToolbarButton : NSButton + +@end diff --git a/Medianno/MAToolbarButton.mm b/Medianno/MAToolbarButton.mm new file mode 100644 index 0000000..54bad98 --- /dev/null +++ b/Medianno/MAToolbarButton.mm @@ -0,0 +1,21 @@ +// +// MAToolbarButton.mm +// Medianno +// +// Created by Matthias Neeracher on 8/23/11. +// Copyright 2011 Matthias Neeracher. All rights reserved. +// + +#import "MAToolbarButton.h" + +@implementation MAToolbarButton + +- (void)awakeFromNib +{ + NSButtonCell * cell = [self cell]; + [cell setHighlightsBy:NSPushInCellMask]; + [cell setShowsStateBy:NSContentsCellMask]; + [cell setBackgroundStyle:NSBackgroundStyleRaised]; +} + +@end diff --git a/Medianno/en.lproj/MADocument.xib b/Medianno/en.lproj/MADocument.xib index a64896a..b73f517 100644 --- a/Medianno/en.lproj/MADocument.xib +++ b/Medianno/en.lproj/MADocument.xib @@ -93,11 +93,11 @@ YES 10408ABC-594E-48CD-9161-E21F2A53A796 - 18B482DB-2594-4103-B3B2-1AFF904C6AC8 18FD3E74-6E8C-445B-B04D-55EDA8F7ECE7 - 4F6A0E70-BC8D-4D4C-8BEF-E1534A157008 + 50E0FA3B-2905-4F98-A78B-101A3698D85B 664414C9-912C-4CDB-AA38-3FE2DED268DC 8C60B854-069F-498C-B9DA-51102A7886FD + B6B844F6-1F51-4108-8EE4-3DBAF516ED46 D1B223FD-2B2A-471D-A6A4-0230D2846698 F098D458-9396-4287-B8C8-F9F580B07CFA NSToolbarFlexibleSpaceItem @@ -128,28 +128,6 @@ YES 0 - - - 18B482DB-2594-4103-B3B2-1AFF904C6AC8 - - << - << - - - - NSImage - rev - - - - {0, 0} - {0, 0} - YES - YES - 101 - YES - 0 - 18FD3E74-6E8C-445B-B04D-55EDA8F7ECE7 @@ -172,25 +150,52 @@ YES 0 - + - 4F6A0E70-BC8D-4D4C-8BEF-E1534A157008 + 50E0FA3B-2905-4F98-A78B-101A3698D85B - >> - >> - - - - NSImage - fwd + << + << + + + + 268 + {{0, 14}, {32, 32}} + + + _NS:1491 + YES + + 67763712 + 134217728 + + + LucidaGrande + 13 + 1044 + + _NS:1491 + + -2042347265 + 134 + + NSImage + rev + + + + 400 + 75 + + - {0, 0} - {0, 0} + {32, 32} + {32, 32} YES YES - 103 + 0 YES 0 @@ -238,6 +243,51 @@ YES 0 + + + B6B844F6-1F51-4108-8EE4-3DBAF516ED46 + + >> + >> + + + + 268 + {{0, 14}, {32, 32}} + + + _NS:1491 + YES + + 67763712 + 134217728 + + + _NS:1491 + + -2042347265 + 134 + + NSImage + fwd + + + + 400 + 75 + + + + + + {32, 32} + {32, 32} + YES + YES + 0 + YES + 0 + D1B223FD-2B2A-471D-A6A4-0230D2846698 @@ -268,9 +318,11 @@ Search - + 268 {{0, 14}, {96, 22}} + + _NS:123 100 YES @@ -278,11 +330,7 @@ 343014976 268436544 - - LucidaGrande - 13 - 1044 - + _NS:123 YES @@ -450,21 +498,21 @@ - + YES - - - + - + - + + + - + YES @@ -472,9 +520,9 @@ - + - + @@ -508,7 +556,7 @@ {1279, 183} - + _NS:1197 YES @@ -733,7 +781,7 @@ {1281, 201} - + _NS:1193 133682 @@ -795,7 +843,7 @@ {1278, 565} - + _NS:1197 YES @@ -942,6 +990,7 @@ {{1, 566}, {1279, 15}} + _NS:1216 1 @@ -967,7 +1016,7 @@ {1280, 583} - + _NS:1193 133682 @@ -1045,7 +1094,7 @@ - {{0, 0}, {1440, 878}} + {{0, 0}, {2560, 1418}} {450, 478} {10000000000000, 10000000000000} 128 @@ -1736,14 +1785,6 @@ 100262 - - - mediaSkipBackward: - - - - 100274 - toggleMediaPlay: @@ -1752,14 +1793,6 @@ 100275 - - - mediaSkipForward: - - - - 100276 - addAnnotation: @@ -1792,6 +1825,84 @@ 100289 + + + mediaSkipForward: + + + + 100293 + + + + enabled: selection.@count + + + + + + enabled: selection.@count + enabled + selection.@count + + YES + + YES + NSMultipleValuesPlaceholder + NSNoSelectionPlaceholder + NSNullPlaceholder + + + YES + + + + + + 2 + + + 100302 + + + + enabled: selection.@count + + + + + + enabled: selection.@count + enabled + selection.@count + + YES + + YES + NSMultipleValuesPlaceholder + NSNoSelectionPlaceholder + NSNullPlaceholder + + + YES + + + + + + 2 + + + 100307 + + + + mediaSkipBackward: + + + + 100308 + @@ -2189,14 +2300,14 @@ - - + + @@ -2215,21 +2326,11 @@ - - 100271 - - - 100272 - - 100273 - - - 100278 @@ -2273,6 +2374,53 @@ + + 100292 + + + YES + + + + + + 100290 + + + YES + + + + + + 100291 + + + + + 100303 + + + YES + + + + + + 100304 + + + YES + + + + Toolbar Button + + + 100305 + + + @@ -2341,9 +2489,7 @@ 100267.IBPluginDependency 100268.IBPluginDependency 100269.IBPluginDependency - 100271.IBPluginDependency 100272.IBPluginDependency - 100273.IBPluginDependency 100278.IBPluginDependency 100279.IBPluginDependency 100280.IBPluginDependency @@ -2351,6 +2497,14 @@ 100283.IBPluginDependency 100286.IBPluginDependency 100287.IBPluginDependency + 100290.CustomClassName + 100290.IBPluginDependency + 100291.IBPluginDependency + 100292.IBPluginDependency + 100303.IBPluginDependency + 100304.CustomClassName + 100304.IBPluginDependency + 100305.IBPluginDependency 5.IBNSWindowAutoPositionCentersHorizontal 5.IBNSWindowAutoPositionCentersVertical 5.IBPluginDependency @@ -2438,6 +2592,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + MAToolbarButton + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + MAToolbarButton com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2459,7 +2619,7 @@ - 100289 + 100308 @@ -2736,6 +2896,14 @@ ./Classes/MATokenFieldCell.h + + MAToolbarButton + NSButton + + IBProjectSource + ./Classes/MAToolbarButton.h + + 0