[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Add asset catalog with accent color

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Feb 7 08:33:14 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d4557132 by Claudio Cambra at 2023-02-07T08:05:50+00:00
macosx: Add asset catalog with accent color

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
bb6a8afa by Marvin Scholz at 2023-02-07T08:05:50+00:00
configure: check for actool on macOS

- - - - -
82ec7e12 by Claudio Cambra at 2023-02-07T08:05:50+00:00
macosx: Compile asset catalog

Co-Authored-By: Claudio Cambra <developer at claudiocambra.com>

- - - - -
ed7a83af by Claudio Cambra at 2023-02-07T08:05:50+00:00
macosx: Add NSAccentColorName prop to Info.plist.in

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e64ddd5f by Claudio Cambra at 2023-02-07T08:05:50+00:00
macosx: Make VLCAccentColor respect system-set accent color

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


8 changed files:

- configure.ac
- extras/package/macosx/VLC.xcodeproj/project.pbxproj
- extras/package/macosx/package.mak
- modules/gui/macosx/Makefile.am
- + modules/gui/macosx/Resources/Assets.xcassets/Contents.json
- + modules/gui/macosx/Resources/Assets.xcassets/VLCAccentColor.colorset/Contents.json
- modules/gui/macosx/extensions/NSColor+VLCAdditions.m
- share/Info.plist.in


Changes:

=====================================
configure.ac
=====================================
@@ -4140,6 +4140,25 @@ then
       AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
     ])
   ])
+
+  dnl
+  dnl If possible, use xcrun to find the right actool
+  dnl
+
+  AS_IF([test ! "${XCRUN}" = "no"], [
+    AC_MSG_CHECKING([for actool (using xcrun)])
+    ACTOOL="$(eval $XCRUN -f actool 2>/dev/null || echo no)"
+    AC_MSG_RESULT([${ACTOOL}])
+  ], [
+    AC_MSG_WARN([Looking for tools without using xcrun])
+  ])
+
+  AS_IF([test "${ACTOOL}" = "no"], [
+    AC_PATH_PROG(ACTOOL, [actool], [no])
+    AS_IF([test "${ACTOOL}" = "no"], [
+      AC_MSG_ERROR([actool was not found, but is required for --enable-macosx])
+    ])
+  ])
 fi
 AM_CONDITIONAL([ENABLE_MACOSX_UI], [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
 


=====================================
extras/package/macosx/VLC.xcodeproj/project.pbxproj
=====================================
@@ -291,6 +291,7 @@
 		53903D3929576ED500D0B308 /* VLCLibraryAudioGroupDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAudioGroupDataSource.m; sourceTree = "<group>"; };
 		539BA79D298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCAspectRatioRetainingVideoWindow.h; sourceTree = "<group>"; };
 		539BA79E298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCAspectRatioRetainingVideoWindow.m; sourceTree = "<group>"; };
+		536EFC3A295F828000F4CB13 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		53B447C82939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibrarySongsTableViewSongPlayingTableCellView.h; sourceTree = "<group>"; };
 		53B447C92939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibrarySongsTableViewSongPlayingTableCellView.m; sourceTree = "<group>"; };
 		53B447EC293BB47A00857588 /* VLCLibraryVideoCollectionViewContainerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryVideoCollectionViewContainerView.m; sourceTree = "<group>"; };
@@ -830,6 +831,7 @@
 				6B8229FF1E4D2DD100833BE1 /* vlc.scriptSuite */,
 				6B822A001E4D2DD100833BE1 /* vlc.scriptTerminology */,
 				7DB5D7E820CD851F00326DFE /* Info.plist */,
+				536EFC3A295F828000F4CB13 /* Assets.xcassets */,
 			);
 			name = Resources;
 			path = ../../../modules/gui/macosx/Resources;


=====================================
extras/package/macosx/package.mak
=====================================
@@ -9,6 +9,7 @@ endif
 pseudo-bundle:
 	$(MKDIR_P) $(top_builddir)/bin/Contents/Resources/
 	$(LN_S) -nf $(abs_top_builddir)/modules/gui/macosx/UI $(top_builddir)/bin/Contents/Resources/Base.lproj
+	$(LN_S) -nf $(abs_top_builddir)/modules/gui/macosx/Resources/Assets.car $(top_builddir)/bin/Contents/Resources/Assets.car
 	$(LN_S) -nf $(abs_top_builddir)/share/macosx/Info.plist $(top_builddir)/bin/Contents/Info.plist
 	$(LN_S) -nf $(CONTRIB_DIR)/Frameworks
 	cd $(top_builddir)/bin/Contents/Resources/ && find $(abs_top_srcdir)/modules/gui/macosx/Resources/ -type f -not -path "*.lproj/*" -exec $(LN_S) -f {} \;
@@ -28,6 +29,8 @@ VLC.app: macos-install
 	## Copy .strings file and .nib files
 	cp -R "$(srcdir)/modules/gui/macosx/Resources/"*.lproj $@/Contents/Resources/
 	cp -R "$(top_builddir)/modules/gui/macosx/UI/." $@/Contents/Resources/Base.lproj/
+	## Copy Asset catalog
+	cp "$(top_builddir)/modules/gui/macosx/Resources/Assets.car" $@/Contents/Resources/Assets.car
 	## Copy Info.plist and convert to binary
 	cp -R "$(top_builddir)/share/macosx/Info.plist" $@/Contents/
 	xcrun plutil -convert binary1 $@/Contents/Info.plist


=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -1,3 +1,27 @@
+actool_verbose = $(actool_verbose_$(V))
+actool_verbose_ = $(actool_verbose__$(AM_DEFAULT_VERBOSITY))
+actool_verbose_0 = @echo "  ACTOOL  " $@;
+actool_verbose__0 = $(actool_verbose_0)
+
+# All content of the asset catalog should be listed below
+# so that it is properly rebuilt when its content changes.
+ASSET_CATALOG_DEPS = \
+	gui/macosx/Resources/Assets.xcassets/Contents.json \
+	gui/macosx/Resources/Assets.xcassets/VLCAccentColor.colorset/Contents.json
+
+gui/macosx/Resources/Assets.car: gui/macosx/Resources/Assets.xcassets $(ASSET_CATALOG_DEPS)
+	$(AM_V_at)$(MKDIR_P) "gui/macosx/Resources"
+	$(actool_verbose)$(ACTOOL) --errors --warnings --notices \
+	  --platform macosx --target-device mac --skip-app-store-deployment \
+	  --minimum-deployment-target 10.11 --output-format human-readable-text \
+	  --compile $(@D) $<
+
+if ENABLE_MACOSX_UI
+BUILT_SOURCES += gui/macosx/Resources/Assets.car
+endif
+
+EXTRA_DIST += $(ASSET_CATALOG_DEPS)
+
 SUFFIXES += .xib .nib
 
 xib_verbose = $(xib_verbose_$(V))


=====================================
modules/gui/macosx/Resources/Assets.xcassets/Contents.json
=====================================
@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}


=====================================
modules/gui/macosx/Resources/Assets.xcassets/VLCAccentColor.colorset/Contents.json
=====================================
@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0.040",
+          "green" : "0.380",
+          "red" : "1.000"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0.040",
+          "green" : "0.380",
+          "red" : "1.000"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}


=====================================
modules/gui/macosx/extensions/NSColor+VLCAdditions.m
=====================================
@@ -26,7 +26,11 @@
 
 + (instancetype)VLCAccentColor
 {
-     return [NSColor VLCOrangeElementColor];
+    if (@available(macOS 10.14, *)) {
+        return [NSColor controlAccentColor];
+    }
+
+    return [NSColor VLCOrangeElementColor];
 }
 
 + (instancetype)VLCOrangeElementColor


=====================================
share/Info.plist.in
=====================================
@@ -55,6 +55,8 @@
 	<string>VLCApplication</string>
 	<key>NSSupportsAutomaticGraphicsSwitching</key>
 	<true/>
+	<key>NSAccentColorName</key>
+	<string>VLCAccentColor</string>
 	<key>SUFeedURL</key>
 	<string>https://update.videolan.org/vlc/sparkle/vlc-intel64.xml</string>
 	<key>SUPublicDSAKeyFile</key>



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2568dc7df306dfd4c6c3c9106e442d55142b833f...e64ddd5f10983b5beeb26a5f09300fd04d91bfa9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2568dc7df306dfd4c6c3c9106e442d55142b833f...e64ddd5f10983b5beeb26a5f09300fd04d91bfa9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list