From: Felix Paul Kühne Date: Sun, 25 Dec 2011 14:19:45 +0000 (+0100) Subject: macosx: added a basic traffic lights icon set for the dark window and the related... X-Git-Tag: 2.1.0-git~6579 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6e77944124447121dd655340513c7e882b5432c1;p=vlc macosx: added a basic traffic lights icon set for the dark window and the related implementation --- diff --git a/Makefile.am b/Makefile.am index 358ac5f9bc..c3e9008efe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -279,6 +279,15 @@ EXTRA_DIST += \ extras/package/macosx/Resources/mainwindow_dark/volume-low_dark.png \ extras/package/macosx/Resources/mainwindow_dark/volume-slider-knob_dark.png \ extras/package/macosx/Resources/mainwindow_dark/volume-slider-track_dark.png \ + extras/package/macosx/Resources/mainwindow_dark/window-close-on.png \ + extras/package/macosx/Resources/mainwindow_dark/window-close-over.png \ + extras/package/macosx/Resources/mainwindow_dark/window-close.png \ + extras/package/macosx/Resources/mainwindow_dark/window-minimize-on.png \ + extras/package/macosx/Resources/mainwindow_dark/window-minimize-over.png \ + extras/package/macosx/Resources/mainwindow_dark/window-minimize.png \ + extras/package/macosx/Resources/mainwindow_dark/window-zoom-on.png \ + extras/package/macosx/Resources/mainwindow_dark/window-zoom-over.png \ + extras/package/macosx/Resources/mainwindow_dark/window-zoom.png \ extras/package/macosx/Resources/noart.png \ extras/package/macosx/Resources/prefs/spref_cone_Audio_64.png \ extras/package/macosx/Resources/prefs/spref_cone_Hotkeys_64.png \ diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib index d40e77c34b..359d5e4d79 100644 --- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib +++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib @@ -21,12 +21,12 @@ YES - - + + + - @@ -4016,6 +4016,7 @@ LCAuLi4 {{1, 1}, {498, 102}} + @@ -4044,6 +4045,7 @@ LCAuLi4 {{92, 96}, {500, 104}} + 133650 @@ -4497,14 +4499,14 @@ LCAuLi4 _NS:610 YES - -2080244224 + 67239424 134217728 _NS:610 - -2038284033 - 134 + -2046672641 + 6 200 @@ -4514,7 +4516,7 @@ LCAuLi4 268 - {{48, 4.93359375}, {12, 12}} + {{48, 3.93359375}, {15, 14}} _NS:610 YES @@ -4525,8 +4527,8 @@ LCAuLi4 _NS:610 - -2038284033 - 134 + -2046672641 + 6 200 @@ -4536,7 +4538,7 @@ LCAuLi4 268 - {{28, 5}, {12, 12}} + {{28, 4}, {15, 14}} _NS:610 YES @@ -4547,8 +4549,8 @@ LCAuLi4 _NS:610 - -2038284033 - 134 + -2046672641 + 6 200 @@ -4558,7 +4560,7 @@ LCAuLi4 268 - {{8, 5}, {12, 12}} + {{8, 4}, {15, 14}} _NS:610 YES @@ -4569,8 +4571,8 @@ LCAuLi4 _NS:610 - -2038284033 - 134 + -2046672641 + 6 200 @@ -10861,12 +10863,15 @@ LCAuLi4 4758.IBViewBoundsToFrameTransform 4759.IBPluginDependency 4759.IBViewBoundsToFrameTransform + 4760.CustomClassName 4760.IBPluginDependency 4761.IBPluginDependency 4761.IBViewBoundsToFrameTransform + 4762.CustomClassName 4762.IBPluginDependency 4763.IBPluginDependency 4763.IBViewBoundsToFrameTransform + 4764.CustomClassName 4764.IBPluginDependency 4765.IBPluginDependency 4765.IBViewBoundsToFrameTransform @@ -11110,9 +11115,9 @@ LCAuLi4 {{430, 565}, {137, 103}} com.apple.InterfaceBuilder.CocoaPlugin - {{329, 301}, {604, 310}} + {{246, 101}, {604, 310}} com.apple.InterfaceBuilder.CocoaPlugin - {{329, 301}, {604, 310}} + {{246, 101}, {604, 310}} @@ -11699,16 +11704,19 @@ LCAuLi4 P4AAAL+AAABBAAAAwXAAAA + VLCWindowButtonCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin P4AAAL+AAABB4AAAwXAAAA + VLCWindowButtonCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin P4AAAL+AAABCQAAAwXAAAA + VLCWindowButtonCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -16713,7 +16721,7 @@ LCAuLi4 - + IBDocumentRelativeSource ../../../../../modules/gui/macosx/MainWindowTitle.h @@ -16731,6 +16739,11 @@ LCAuLi4 ../../../../../modules/gui/macosx/misc.h + + VLCWindowButtonCell + NSButtonCell + + YES diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-close-on.png b/extras/package/macosx/Resources/mainwindow_dark/window-close-on.png new file mode 100644 index 0000000000..e931f200c1 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-close-on.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-close-over.png b/extras/package/macosx/Resources/mainwindow_dark/window-close-over.png new file mode 100644 index 0000000000..a2a53de115 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-close-over.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-close.png b/extras/package/macosx/Resources/mainwindow_dark/window-close.png new file mode 100644 index 0000000000..26d7eef518 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-close.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-minimize-on.png b/extras/package/macosx/Resources/mainwindow_dark/window-minimize-on.png new file mode 100644 index 0000000000..4dcd2a5da9 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-minimize-on.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-minimize-over.png b/extras/package/macosx/Resources/mainwindow_dark/window-minimize-over.png new file mode 100644 index 0000000000..0b17d7f8b2 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-minimize-over.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-minimize.png b/extras/package/macosx/Resources/mainwindow_dark/window-minimize.png new file mode 100644 index 0000000000..b8c039a33c Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-minimize.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-zoom-on.png b/extras/package/macosx/Resources/mainwindow_dark/window-zoom-on.png new file mode 100644 index 0000000000..34116116d0 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-zoom-on.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-zoom-over.png b/extras/package/macosx/Resources/mainwindow_dark/window-zoom-over.png new file mode 100644 index 0000000000..6e5911734e Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-zoom-over.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/window-zoom.png b/extras/package/macosx/Resources/mainwindow_dark/window-zoom.png new file mode 100644 index 0000000000..6c4c8907e1 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/window-zoom.png differ diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj index 9b994c21f9..6cb1c97e8a 100644 --- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj +++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj @@ -150,6 +150,15 @@ CC0433D213B28C8C00D7D52E /* spref_cone_Interface_64.png in Resources */ = {isa = PBXBuildFile; fileRef = CC0433CC13B28C8C00D7D52E /* spref_cone_Interface_64.png */; }; CC0433D313B28C8C00D7D52E /* spref_cone_Subtitles_64.png in Resources */ = {isa = PBXBuildFile; fileRef = CC0433CD13B28C8C00D7D52E /* spref_cone_Subtitles_64.png */; }; CC0433D413B28C8C00D7D52E /* spref_cone_Video_64.png in Resources */ = {isa = PBXBuildFile; fileRef = CC0433CE13B28C8C00D7D52E /* spref_cone_Video_64.png */; }; + CC2DB09A14A7550D0050A055 /* window-close-on.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09114A7550D0050A055 /* window-close-on.png */; }; + CC2DB09B14A7550D0050A055 /* window-close-over.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09214A7550D0050A055 /* window-close-over.png */; }; + CC2DB09C14A7550D0050A055 /* window-close.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09314A7550D0050A055 /* window-close.png */; }; + CC2DB09D14A7550D0050A055 /* window-minimize-on.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09414A7550D0050A055 /* window-minimize-on.png */; }; + CC2DB09E14A7550D0050A055 /* window-minimize-over.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09514A7550D0050A055 /* window-minimize-over.png */; }; + CC2DB09F14A7550D0050A055 /* window-minimize.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09614A7550D0050A055 /* window-minimize.png */; }; + CC2DB0A014A7550D0050A055 /* window-zoom-on.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09714A7550D0050A055 /* window-zoom-on.png */; }; + CC2DB0A114A7550D0050A055 /* window-zoom-over.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09814A7550D0050A055 /* window-zoom-over.png */; }; + CC2DB0A214A7550D0050A055 /* window-zoom.png in Resources */ = {isa = PBXBuildFile; fileRef = CC2DB09914A7550D0050A055 /* window-zoom.png */; }; CC3F9F861350B2A000B0E885 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC3F9F851350B2A000B0E885 /* Growl.framework */; }; CC402EB80E00ABBB006A4BA4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F69B0CA602E24F6401A80112 /* InfoPlist.strings */; }; CC402EB90E00ABBB006A4BA4 /* vlc.scriptSuite in Resources */ = {isa = PBXBuildFile; fileRef = 8EBF3FA303F13FFB0059A3A7 /* vlc.scriptSuite */; }; @@ -420,6 +429,15 @@ CC0CD0E213DE0EAE00B0D90D /* PXSourceListDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PXSourceListDelegate.h; path = ../../../modules/gui/macosx/PXSourceListDelegate.h; sourceTree = ""; }; CC1941240B9C1F8400635F6B /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; CC1C41D00D9BAD7F002728FA /* noart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = noart.png; path = Resources/noart.png; sourceTree = ""; }; + CC2DB09114A7550D0050A055 /* window-close-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-close-on.png"; path = "Resources/mainwindow_dark/window-close-on.png"; sourceTree = ""; }; + CC2DB09214A7550D0050A055 /* window-close-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-close-over.png"; path = "Resources/mainwindow_dark/window-close-over.png"; sourceTree = ""; }; + CC2DB09314A7550D0050A055 /* window-close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-close.png"; path = "Resources/mainwindow_dark/window-close.png"; sourceTree = ""; }; + CC2DB09414A7550D0050A055 /* window-minimize-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-minimize-on.png"; path = "Resources/mainwindow_dark/window-minimize-on.png"; sourceTree = ""; }; + CC2DB09514A7550D0050A055 /* window-minimize-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-minimize-over.png"; path = "Resources/mainwindow_dark/window-minimize-over.png"; sourceTree = ""; }; + CC2DB09614A7550D0050A055 /* window-minimize.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-minimize.png"; path = "Resources/mainwindow_dark/window-minimize.png"; sourceTree = ""; }; + CC2DB09714A7550D0050A055 /* window-zoom-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-zoom-on.png"; path = "Resources/mainwindow_dark/window-zoom-on.png"; sourceTree = ""; }; + CC2DB09814A7550D0050A055 /* window-zoom-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-zoom-over.png"; path = "Resources/mainwindow_dark/window-zoom-over.png"; sourceTree = ""; }; + CC2DB09914A7550D0050A055 /* window-zoom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-zoom.png"; path = "Resources/mainwindow_dark/window-zoom.png"; sourceTree = ""; }; CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; CC3F9F851350B2A000B0E885 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = ../../../contrib/Growl.framework; sourceTree = ""; }; CC402F4B0E00ABBB006A4BA4 /* VLC.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VLC.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -793,6 +811,15 @@ CC04323813B246DF00D7D52E /* volume-low_dark.png */, CC04323913B246DF00D7D52E /* volume-slider-knob_dark.png */, CC04323A13B246DF00D7D52E /* volume-slider-track_dark.png */, + CC2DB09114A7550D0050A055 /* window-close-on.png */, + CC2DB09214A7550D0050A055 /* window-close-over.png */, + CC2DB09314A7550D0050A055 /* window-close.png */, + CC2DB09414A7550D0050A055 /* window-minimize-on.png */, + CC2DB09514A7550D0050A055 /* window-minimize-over.png */, + CC2DB09614A7550D0050A055 /* window-minimize.png */, + CC2DB09714A7550D0050A055 /* window-zoom-on.png */, + CC2DB09814A7550D0050A055 /* window-zoom-over.png */, + CC2DB09914A7550D0050A055 /* window-zoom.png */, ); name = "dark variant"; sourceTree = ""; @@ -1304,6 +1331,15 @@ CCC4A92914A40340006731E4 /* pictures.png in Resources */, CCC4A92A14A40340006731E4 /* playlist.png in Resources */, CCC4A92B14A40340006731E4 /* podcast.png in Resources */, + CC2DB09A14A7550D0050A055 /* window-close-on.png in Resources */, + CC2DB09B14A7550D0050A055 /* window-close-over.png in Resources */, + CC2DB09C14A7550D0050A055 /* window-close.png in Resources */, + CC2DB09D14A7550D0050A055 /* window-minimize-on.png in Resources */, + CC2DB09E14A7550D0050A055 /* window-minimize-over.png in Resources */, + CC2DB09F14A7550D0050A055 /* window-minimize.png in Resources */, + CC2DB0A014A7550D0050A055 /* window-zoom-on.png in Resources */, + CC2DB0A114A7550D0050A055 /* window-zoom-over.png in Resources */, + CC2DB0A214A7550D0050A055 /* window-zoom.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/modules/gui/macosx/MainWindowTitle.h b/modules/gui/macosx/MainWindowTitle.h index d48317e3ac..6720f10912 100644 --- a/modules/gui/macosx/MainWindowTitle.h +++ b/modules/gui/macosx/MainWindowTitle.h @@ -39,5 +39,11 @@ - (IBAction)buttonAction:(id)sender; - (void)setWindowTitle:(NSString *)title; - (void)setFullscreenButtonHidden:(BOOL)b_value; +- (void)setWindowButtonOver:(BOOL)b_value; @end + +@interface VLCWindowButtonCell : NSButtonCell +{ +} +@end diff --git a/modules/gui/macosx/MainWindowTitle.m b/modules/gui/macosx/MainWindowTitle.m index 76a9ef6c54..528cd736b7 100644 --- a/modules/gui/macosx/MainWindowTitle.m +++ b/modules/gui/macosx/MainWindowTitle.m @@ -40,7 +40,15 @@ [self setImage: [NSImage imageNamed:@"bottom-background_dark"]]; [self setAutoresizesSubviews: YES]; - /* TODO: icon setters */ + [o_red_btn setImage: [NSImage imageNamed:@"window-close"]]; + [o_red_btn setAlternateImage: [NSImage imageNamed:@"window-close-on"]]; + [[o_red_btn cell] setShowsBorderOnlyWhileMouseInside: YES]; + [o_yellow_btn setImage: [NSImage imageNamed:@"window-minimize"]]; + [o_yellow_btn setAlternateImage: [NSImage imageNamed:@"window-minimize-on"]]; + [[o_yellow_btn cell] setShowsBorderOnlyWhileMouseInside: YES]; + [o_green_btn setImage: [NSImage imageNamed:@"window-zoom"]]; + [o_green_btn setAlternateImage: [NSImage imageNamed:@"window-zoom-on"]]; + [[o_green_btn cell] setShowsBorderOnlyWhileMouseInside: YES]; } - (BOOL)mouseDownCanMoveWindow @@ -72,4 +80,34 @@ [o_fullscreen_btn setHidden: b_value]; } +- (void)setWindowButtonOver:(BOOL)b_value +{ + if( b_value ) + { + [o_red_btn setImage: [NSImage imageNamed:@"window-close-over"]]; + [o_yellow_btn setImage: [NSImage imageNamed:@"window-minimize-over"]]; + [o_green_btn setImage: [NSImage imageNamed:@"window-zoom-over"]]; + } + else + { + [o_red_btn setImage: [NSImage imageNamed:@"window-close"]]; + [o_yellow_btn setImage: [NSImage imageNamed:@"window-minimize"]]; + [o_green_btn setImage: [NSImage imageNamed:@"window-zoom"]]; + } +} + +@end + +@implementation VLCWindowButtonCell + +- (void)mouseEntered:(NSEvent *)theEvent +{ + [(VLCMainWindowTitleView *)[[self controlView] superview] setWindowButtonOver: YES]; +} + +- (void)mouseExited:(NSEvent *)theEvent +{ + [(VLCMainWindowTitleView *)[[self controlView] superview] setWindowButtonOver: NO]; +} + @end