diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj index 74fa01979cba90b5188733e03a077d725c966a35..202e68201c8c75b921167dd0c42663b5dd1116b3 100644 --- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj +++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj @@ -108,6 +108,7 @@ 7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2E0ED920CD204D0033A221 /* VLCWindow.m */; }; 7D2E0EDE20CD206F0033A221 /* VLCVideoWindowCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2E0EDD20CD206F0033A221 /* VLCVideoWindowCommon.m */; }; 7D2FFA40227B8A5B0085D649 /* VLCLinearProgressIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2FFA3F227B8A5B0085D649 /* VLCLinearProgressIndicator.m */; }; + 7D404ABF2281892C00B28EF4 /* NSView+VLCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D404ABE2281892C00B28EF4 /* NSView+VLCAdditions.m */; }; 7D445D812202524000263D34 /* VLCPlaylistController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D445D802202524000263D34 /* VLCPlaylistController.m */; }; 7D445D842202524D00263D34 /* VLCPlaylistItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D445D832202524D00263D34 /* VLCPlaylistItem.m */; }; 7D445D872202574B00263D34 /* VLCPlaylistModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D445D862202574B00263D34 /* VLCPlaylistModel.m */; }; @@ -463,6 +464,8 @@ 7D2E0EDD20CD206F0033A221 /* VLCVideoWindowCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCVideoWindowCommon.m; sourceTree = "<group>"; }; 7D2FFA3E227B8A5B0085D649 /* VLCLinearProgressIndicator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLinearProgressIndicator.h; sourceTree = "<group>"; }; 7D2FFA3F227B8A5B0085D649 /* VLCLinearProgressIndicator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLinearProgressIndicator.m; sourceTree = "<group>"; }; + 7D404ABD2281892C00B28EF4 /* NSView+VLCAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSView+VLCAdditions.h"; sourceTree = "<group>"; }; + 7D404ABE2281892C00B28EF4 /* NSView+VLCAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSView+VLCAdditions.m"; sourceTree = "<group>"; }; 7D445D7F2202524000263D34 /* VLCPlaylistController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistController.h; sourceTree = "<group>"; }; 7D445D802202524000263D34 /* VLCPlaylistController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlaylistController.m; sourceTree = "<group>"; }; 7D445D822202524D00263D34 /* VLCPlaylistItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistItem.h; sourceTree = "<group>"; }; @@ -956,6 +959,8 @@ 7D28E6352275B4820098D30E /* NSColor+VLCAdditions.m */, 7D28E6372275B7340098D30E /* NSFont+VLCAdditions.h */, 7D28E6382275B7340098D30E /* NSFont+VLCAdditions.m */, + 7D404ABD2281892C00B28EF4 /* NSView+VLCAdditions.h */, + 7D404ABE2281892C00B28EF4 /* NSView+VLCAdditions.m */, ); path = extensions; sourceTree = "<group>"; @@ -1645,6 +1650,7 @@ 1C3113901E508C6900D4DD76 /* VLCHelpWindowController.m in Sources */, 1C3113921E508C6900D4DD76 /* VLCAddonListItem.m in Sources */, 7DFBDCB7226CDFD600B700A5 /* VLCImageView.m in Sources */, + 7D404ABF2281892C00B28EF4 /* NSView+VLCAdditions.m in Sources */, 7DE9C7DD220728420089108F /* VLCPlayerController.m in Sources */, 1C3113941E508C6900D4DD76 /* VLCAddonsWindowController.m in Sources */, 7D2E0EDE20CD206F0033A221 /* VLCVideoWindowCommon.m in Sources */, diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am index 84c887b340cd59d4b986f080a77370b2e6a6c953..499d0bf62084cc716b5c29fe7d6133f12d139396 100644 --- a/modules/gui/macosx/Makefile.am +++ b/modules/gui/macosx/Makefile.am @@ -40,6 +40,8 @@ libmacosx_plugin_la_SOURCES = \ gui/macosx/extensions/NSSound+VLCAdditions.m \ gui/macosx/extensions/NSString+Helpers.h \ gui/macosx/extensions/NSString+Helpers.m \ + gui/macosx/extensions/NSView+VLCAdditions.h \ + gui/macosx/extensions/NSView+VLCAdditions.m \ gui/macosx/extensions/VLCHexNumberFormatter.h \ gui/macosx/extensions/VLCHexNumberFormatter.m \ gui/macosx/extensions/misc.h \ diff --git a/modules/gui/macosx/extensions/NSView+VLCAdditions.h b/modules/gui/macosx/extensions/NSView+VLCAdditions.h new file mode 100644 index 0000000000000000000000000000000000000000..a97ad3c76fca966db06f9d5f88d9d70ec52d787e --- /dev/null +++ b/modules/gui/macosx/extensions/NSView+VLCAdditions.h @@ -0,0 +1,34 @@ +/***************************************************************************** + * NSView+VLCAdditions.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2013-2019 VLC authors and VideoLAN + * + * Authors: David Fuhrmann <dfuhrmann # videolan.org> + * Felix Paul Kühne <fkuehne at videolan dot org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#import <Cocoa/Cocoa.h> + +NS_ASSUME_NONNULL_BEGIN + +@interface NSView (VLCAdditions) + +- (void)enableSubviews:(BOOL)enabled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/extensions/NSView+VLCAdditions.m b/modules/gui/macosx/extensions/NSView+VLCAdditions.m new file mode 100644 index 0000000000000000000000000000000000000000..2609f0bd4fe5ea42a2c1c27308fce40d670c18d3 --- /dev/null +++ b/modules/gui/macosx/extensions/NSView+VLCAdditions.m @@ -0,0 +1,49 @@ +/***************************************************************************** + * NSView+VLCAdditions.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2013-2019 VLC authors and VideoLAN + * + * Authors: David Fuhrmann <dfuhrmann # videolan.org> + * Felix Paul Kühne <fkuehne at videolan dot org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#import "NSView+VLCAdditions.h" + +@implementation NSView (VLCAdditions) + +- (void)enableSubviews:(BOOL)enabled +{ + for (NSView *view in [self subviews]) { + [view enableSubviews:enabled]; + + // enable NSControl + if ([view respondsToSelector:@selector(setEnabled:)]) { + [(NSControl *)view setEnabled:enabled]; + } + // also "enable / disable" text views + if ([view respondsToSelector:@selector(setTextColor:)]) { + if (enabled == NO) { + [(NSTextField *)view setTextColor:[NSColor disabledControlTextColor]]; + } else { + [(NSTextField *)view setTextColor:[NSColor controlTextColor]]; + } + } + + } +} + +@end diff --git a/modules/gui/macosx/extensions/misc.h b/modules/gui/macosx/extensions/misc.h index 531e889b662e68196b52e023076084a43c91f77a..afe4fdfe9bcf33f9d5bc37b97d2bd902da8e119d 100644 --- a/modules/gui/macosx/extensions/misc.h +++ b/modules/gui/macosx/extensions/misc.h @@ -67,14 +67,6 @@ @end -/***************************************************************************** - * NSView addition - *****************************************************************************/ - -@interface NSView (EnableSubviews) -- (void)enableSubviews:(BOOL)b_enable; -@end - /***************************************************************************** * VLCByteCountFormatter addition *****************************************************************************/ diff --git a/modules/gui/macosx/extensions/misc.m b/modules/gui/macosx/extensions/misc.m index 24abc60fec683f49457a334cce30cfc1daf0c861..793346e956f814b290f448a2af647662dff03c0e 100644 --- a/modules/gui/macosx/extensions/misc.m +++ b/modules/gui/macosx/extensions/misc.m @@ -195,31 +195,6 @@ @end -@implementation NSView (EnableSubviews) - -- (void)enableSubviews:(BOOL)b_enable -{ - for (NSView *o_view in [self subviews]) { - [o_view enableSubviews:b_enable]; - - // enable NSControl - if ([o_view respondsToSelector:@selector(setEnabled:)]) { - [(NSControl *)o_view setEnabled:b_enable]; - } - // also "enable / disable" text views - if ([o_view respondsToSelector:@selector(setTextColor:)]) { - if (b_enable == NO) { - [(NSTextField *)o_view setTextColor:[NSColor disabledControlTextColor]]; - } else { - [(NSTextField *)o_view setTextColor:[NSColor controlTextColor]]; - } - } - - } -} - -@end - /***************************************************************************** * VLCByteCountFormatter addition *****************************************************************************/ diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m index 8dd78e251882428801088d02ac4bd9bfb79ddebd..7bf2f0f6ef661731f63c03b516fa9f16c480b56f 100644 --- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m +++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m @@ -34,6 +34,7 @@ #import "../../../audio_filter/equalizer_presets.h" #import "extensions/NSString+Helpers.h" +#import "extensions/NSView+VLCAdditions.h" #import "main/VLCMain.h" #import "main/CompatibilityFixes.h" #import "panels/dialogs/VLCPopupPanelController.h" diff --git a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m index 223d92bb5a4a7f17a2fe8abd639eb8a8b1356f9d..4c13a4c48e1d4427b642542848e4c1723cf85084 100644 --- a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m +++ b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m @@ -22,7 +22,7 @@ #import "VLCConvertAndSaveWindowController.h" -#import "extensions/misc.h" +#import "extensions/NSView+VLCAdditions.h" #import "main/VLCMain.h" #import "panels/dialogs/VLCPopupPanelController.h" #import "panels/dialogs/VLCTextfieldPanelController.h" diff --git a/po/POTFILES.in b/po/POTFILES.in index a665fbd8d47d4a23772987e9ad800aba55a7166a..b7dbe7f1a632efb2feca672e2acb235a5c12565e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -462,6 +462,8 @@ modules/gui/macosx/extensions/NSSound+VLCAdditions.h modules/gui/macosx/extensions/NSSound+VLCAdditions.m modules/gui/macosx/extensions/NSString+Helpers.h modules/gui/macosx/extensions/NSString+Helpers.m +modules/gui/macosx/extensions/NSView+VLCAdditions.h +modules/gui/macosx/extensions/NSView+VLCAdditions.m modules/gui/macosx/extensions/VLCHexNumberFormatter.h modules/gui/macosx/extensions/VLCHexNumberFormatter.m modules/gui/macosx/extensions/misc.h