[vlc-commits] macosx: add template classes for colors and fonts

Felix Paul Kühne git at videolan.org
Mon Apr 29 19:27:05 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sun Apr 28 12:35:31 2019 +0200| [ff756796eafb3a12eedc22119dcfeeaf5d9a0186] | committer: Felix Paul Kühne

macosx: add template classes for colors and fonts

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ff756796eafb3a12eedc22119dcfeeaf5d9a0186
---

 .../package/macosx/VLC.xcodeproj/project.pbxproj   | 12 +++++
 modules/gui/macosx/Makefile.am                     |  4 ++
 .../gui/macosx/extensions/NSColor+VLCAdditions.h   | 38 +++++++++++++
 .../gui/macosx/extensions/NSColor+VLCAdditions.m   | 57 ++++++++++++++++++++
 .../gui/macosx/extensions/NSFont+VLCAdditions.h    | 39 ++++++++++++++
 .../gui/macosx/extensions/NSFont+VLCAdditions.m    | 62 ++++++++++++++++++++++
 po/POTFILES.in                                     |  4 ++
 7 files changed, 216 insertions(+)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 8907b37bf2..d9c698f778 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -103,6 +103,8 @@
 		7D0F63FF2201F63400FDB91F /* VLCPlaylistTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0F63FE2201F63400FDB91F /* VLCPlaylistTableCellView.m */; };
 		7D0F64062202047900FDB91F /* VLCLibraryCollectionViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0F64042202047900FDB91F /* VLCLibraryCollectionViewItem.m */; };
 		7D0F640C2202163E00FDB91F /* VLCPlaylistDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0F640B2202163E00FDB91F /* VLCPlaylistDataSource.m */; };
+		7D28E6362275B4820098D30E /* NSColor+VLCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D28E6352275B4820098D30E /* NSColor+VLCAdditions.m */; };
+		7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D28E6382275B7340098D30E /* NSFont+VLCAdditions.m */; };
 		7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2E0ED920CD204D0033A221 /* VLCWindow.m */; };
 		7D2E0EDE20CD206F0033A221 /* VLCVideoWindowCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2E0EDD20CD206F0033A221 /* VLCVideoWindowCommon.m */; };
 		7D445D812202524000263D34 /* VLCPlaylistController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D445D802202524000263D34 /* VLCPlaylistController.m */; };
@@ -441,6 +443,10 @@
 		7D0F64092202058700FDB91F /* libraryCellGradient at 2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "libraryCellGradient at 2x.png"; path = "../librarywindow/libraryCellGradient at 2x.png"; sourceTree = "<group>"; };
 		7D0F640A2202163E00FDB91F /* VLCPlaylistDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistDataSource.h; sourceTree = "<group>"; };
 		7D0F640B2202163E00FDB91F /* VLCPlaylistDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlaylistDataSource.m; sourceTree = "<group>"; };
+		7D28E6342275B4820098D30E /* NSColor+VLCAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSColor+VLCAdditions.h"; sourceTree = "<group>"; };
+		7D28E6352275B4820098D30E /* NSColor+VLCAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSColor+VLCAdditions.m"; sourceTree = "<group>"; };
+		7D28E6372275B7340098D30E /* NSFont+VLCAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSFont+VLCAdditions.h"; sourceTree = "<group>"; };
+		7D28E6382275B7340098D30E /* NSFont+VLCAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSFont+VLCAdditions.m"; sourceTree = "<group>"; };
 		7D2E0ED920CD204D0033A221 /* VLCWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCWindow.m; sourceTree = "<group>"; };
 		7D2E0EDA20CD204D0033A221 /* VLCWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCWindow.h; sourceTree = "<group>"; };
 		7D2E0EDC20CD206F0033A221 /* VLCVideoWindowCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCVideoWindowCommon.h; sourceTree = "<group>"; };
@@ -930,6 +936,10 @@
 				6B397C4E216C8EB200403ED0 /* NSString+Helpers.m */,
 				6B7F1FDD1F07DA920002BDD8 /* VLCHexNumberFormatter.h */,
 				6B7F1FDE1F07DA920002BDD8 /* VLCHexNumberFormatter.m */,
+				7D28E6342275B4820098D30E /* NSColor+VLCAdditions.h */,
+				7D28E6352275B4820098D30E /* NSColor+VLCAdditions.m */,
+				7D28E6372275B7340098D30E /* NSFont+VLCAdditions.h */,
+				7D28E6382275B7340098D30E /* NSFont+VLCAdditions.m */,
 			);
 			path = extensions;
 			sourceTree = "<group>";
@@ -1618,6 +1628,7 @@
 				7D445D8E2203375100263D34 /* VLCPlaylistMenuController.m in Sources */,
 				1C31139A1E508C6900D4DD76 /* VLCBookmarksWindowController.m in Sources */,
 				6B0AB0F01F1AC8B3003A1B4E /* VLCSlider.m in Sources */,
+				7D28E6362275B4820098D30E /* NSColor+VLCAdditions.m in Sources */,
 				6BF5C5041EFE66EF008A9C12 /* VLCHUDTableView.m in Sources */,
 				6BBB05E01EEFF165003A1019 /* VLCHUDTableCornerView.m in Sources */,
 				1C31139D1E508C6900D4DD76 /* VLCControlsBarCommon.m in Sources */,
@@ -1637,6 +1648,7 @@
 				7D66D4362200BC340040D04A /* VLCClickerManager.m in Sources */,
 				1C3113B11E508C6900D4DD76 /* VLCFSPanelDraggableView.m in Sources */,
 				1C3113B41E508C6900D4DD76 /* VLCPlaybackContinuityController.m in Sources */,
+				7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */,
 				1C3113B61E508C6900D4DD76 /* VLCMain+OldPrefs.m in Sources */,
 				1C3113B81E508C6900D4DD76 /* VLCMain.m in Sources */,
 				1CAC3EE820CD1B3B00613DB2 /* VLCVideoOutputProvider.m in Sources */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index 425fc14523..658215ceb4 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -30,6 +30,10 @@ libmacosx_plugin_la_SOURCES = \
 	gui/macosx/coreinteraction/VLCHotkeysController.m \
 	gui/macosx/coreinteraction/VLCVideoFilterHelper.h \
 	gui/macosx/coreinteraction/VLCVideoFilterHelper.m \
+	gui/macosx/extensions/NSColor+VLCAdditions.h \
+	gui/macosx/extensions/NSColor+VLCAdditions.m \
+	gui/macosx/extensions/NSFont+VLCAdditions.h \
+	gui/macosx/extensions/NSFont+VLCAdditions.m \
 	gui/macosx/extensions/NSScreen+VLCAdditions.h \
 	gui/macosx/extensions/NSScreen+VLCAdditions.m \
 	gui/macosx/extensions/NSSound+VLCAdditions.h \
diff --git a/modules/gui/macosx/extensions/NSColor+VLCAdditions.h b/modules/gui/macosx/extensions/NSColor+VLCAdditions.h
new file mode 100644
index 0000000000..0c46aff91a
--- /dev/null
+++ b/modules/gui/macosx/extensions/NSColor+VLCAdditions.h
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * NSColor+VLCAdditions.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * Authors: Felix Paul Kühne <fkuehne # 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
+
+ at interface NSColor (VLCAdditions)
+
++ (instancetype)VLClibraryHighlightColor;
++ (instancetype)VLClibraryLightTitleColor;
++ (instancetype)VLClibraryDarkTitleColor;
++ (instancetype)VLClibrarySubtitleColor;
++ (instancetype)VLClibrarySeparatorLightColor;
++ (instancetype)VLClibrarySeparatorDarkColor;
+
+ at end
+
+NS_ASSUME_NONNULL_END
diff --git a/modules/gui/macosx/extensions/NSColor+VLCAdditions.m b/modules/gui/macosx/extensions/NSColor+VLCAdditions.m
new file mode 100644
index 0000000000..33b3723fa1
--- /dev/null
+++ b/modules/gui/macosx/extensions/NSColor+VLCAdditions.m
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * NSColor+VLCAdditions.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * Authors: Felix Paul Kühne <fkuehne # 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 "NSColor+VLCAdditions.h"
+
+ at implementation NSColor (VLCAdditions)
+
++ (instancetype)VLClibraryHighlightColor
+{
+    return [NSColor colorWithRed:0.96 green:0.5 blue:.0 alpha:1.];
+}
+
++ (instancetype)VLClibraryLightTitleColor
+{
+    return [NSColor colorWithRed:0.15 green:0.16 blue:0.17 alpha:1.];
+}
+
++ (instancetype)VLClibraryDarkTitleColor
+{
+    return [NSColor colorWithRed:0.85 green:0.84 blue:0.83 alpha:1.];
+}
+
++ (instancetype)VLClibrarySubtitleColor
+{
+    return [NSColor colorWithRed:0.52 green:0.57 blue:0.61 alpha:1.];
+}
+
++ (instancetype)VLClibrarySeparatorLightColor
+{
+    return [NSColor colorWithRed:0.89 green:0.91 blue:0.93 alpha:1.];
+}
+
++ (instancetype)VLClibrarySeparatorDarkColor
+{
+    return [NSColor colorWithRed:0.11 green:0.09 blue:0.07 alpha:1.];
+}
+
+ at end
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
new file mode 100644
index 0000000000..d7821528a6
--- /dev/null
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * NSFont+VLCAdditions.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * Authors: Felix Paul Kühne <fkuehne # 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
+
+ at interface NSFont (VLCAdditions)
+
++ (instancetype)VLClibrarySectionHeaderFont;
++ (instancetype)VLClibraryHighlightCellTitleFont;
++ (instancetype)VLClibraryHighlightCellSubtitleFont;
++ (instancetype)VLClibraryHighlightCellHighlightLabelFont;
++ (instancetype)VLClibraryCellTitleFont;
++ (instancetype)VLClibraryCellSubtitleFont;
++ (instancetype)VLClibraryCellAnnotationFont;
+
+ at end
+
+NS_ASSUME_NONNULL_END
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
new file mode 100644
index 0000000000..ad81f37ef7
--- /dev/null
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * NSFont+VLCAdditions.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * Authors: Felix Paul Kühne <fkuehne # 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 "NSFont+VLCAdditions.h"
+
+ at implementation NSFont (VLCAdditions)
+
++ (instancetype)VLClibrarySectionHeaderFont
+{
+    return [NSFont systemFontOfSize:24. weight:NSFontWeightBold];
+}
+
++ (instancetype)VLClibraryHighlightCellTitleFont
+{
+    return [NSFont systemFontOfSize:21. weight:NSFontWeightMedium];
+}
+
++ (instancetype)VLClibraryHighlightCellSubtitleFont
+{
+    return [NSFont systemFontOfSize:13. weight:NSFontWeightSemibold];
+}
+
++ (instancetype)VLClibraryHighlightCellHighlightLabelFont
+{
+    return [NSFont systemFontOfSize:11. weight:NSFontWeightBold];
+}
+
++ (instancetype)VLClibraryCellTitleFont
+{
+    return [NSFont systemFontOfSize:17. weight:NSFontWeightMedium];
+}
+
++ (instancetype)VLClibraryCellSubtitleFont
+{
+    return [NSFont systemFontOfSize:13. weight:NSFontWeightSemibold];
+}
+
++ (instancetype)VLClibraryCellAnnotationFont
+{
+    return [NSFont systemFontOfSize:15. weight:NSFontWeightBold];
+}
+
+ at end
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 532066fed1..3e9fdaf746 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -452,6 +452,10 @@ modules/gui/macosx/coreinteraction/VLCHotkeysController.h
 modules/gui/macosx/coreinteraction/VLCHotkeysController.m
 modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.h
 modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m
+modules/gui/macosx/extensions/NSColor+VLCAdditions.h
+modules/gui/macosx/extensions/NSColor+VLCAdditions.m
+modules/gui/macosx/extensions/NSFont+VLCAdditions.h
+modules/gui/macosx/extensions/NSFont+VLCAdditions.m
 modules/gui/macosx/extensions/NSScreen+VLCAdditions.h
 modules/gui/macosx/extensions/NSScreen+VLCAdditions.m
 modules/gui/macosx/extensions/NSSound+VLCAdditions.h



More information about the vlc-commits mailing list