mirror of
https://github.com/Codeux-Software/Textual.git
synced 2026-06-16 13:24:32 +00:00
Add Big Sur specific appearance
All Mojave appearances have been renamed to "CommonModern" and Mojave and Big Sur inherits from this as the changes that will be made for Big Sur will be minimal.
This commit is contained in:
@@ -123,6 +123,14 @@ NSString * const TXSystemAppearanceChangedNotification = @"TXSystemAppearanceCha
|
||||
{
|
||||
return @"MojaveDark";
|
||||
}
|
||||
case TXAppearanceTypeBigSurLight:
|
||||
{
|
||||
return @"BigSurLight";
|
||||
}
|
||||
case TXAppearanceTypeBigSurDark:
|
||||
{
|
||||
return @"BigSurDark";
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
@@ -173,6 +181,7 @@ NSString * const TXSystemAppearanceChangedNotification = @"TXSystemAppearanceCha
|
||||
TXAppearanceType appearanceType;
|
||||
|
||||
BOOL onMojave = TEXTUAL_RUNNING_ON_MOJAVE;
|
||||
BOOL onBigSur = TEXTUAL_RUNNING_ON_BIGSUR;
|
||||
|
||||
BOOL isAppearanceDark = NO;
|
||||
|
||||
@@ -182,6 +191,8 @@ NSString * const TXSystemAppearanceChangedNotification = @"TXSystemAppearanceCha
|
||||
switch (preferredAppearance) {
|
||||
case TXPreferredAppearanceInherited:
|
||||
{
|
||||
/* OS Version checks are X or LATER which means we can
|
||||
cover Mojave and Big Sur together with one condition. */
|
||||
if (onMojave)
|
||||
{
|
||||
/* We only inherit from the system on Mojave.
|
||||
@@ -204,9 +215,31 @@ NSString * const TXSystemAppearanceChangedNotification = @"TXSystemAppearanceCha
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine best appearance and define other properties */
|
||||
/* Determine best appearance inheritance approach */
|
||||
/* Before Mojave, appearance needs to be applied to every view.
|
||||
After Mojave, views properly inherit the appearance of the parent
|
||||
window or the system. If the user selects a specific appearance,
|
||||
then we apply that to the parent window on Mojave and later to
|
||||
allow views to inherit that. If the user selects the system
|
||||
appearance, then we apply nothing and allow it to be inherited
|
||||
from the system. */
|
||||
TXAppKitAppearanceTarget appKitAppearanceTarget = TXAppKitAppearanceTargetNone;
|
||||
|
||||
if (onMojave == NO) {
|
||||
appKitAppearanceTarget = TXAppKitAppearanceTargetView;
|
||||
} else if (preferredAppearance != TXPreferredAppearanceInherited) {
|
||||
appKitAppearanceTarget = TXAppKitAppearanceTargetWindow;
|
||||
}
|
||||
|
||||
/* Determine best appearance */
|
||||
if (onBigSur)
|
||||
{
|
||||
if (isAppearanceDark) {
|
||||
appearanceType = TXAppearanceTypeBigSurDark;
|
||||
} else {
|
||||
appearanceType = TXAppearanceTypeBigSurLight;
|
||||
} // isAppearanceDark
|
||||
}
|
||||
if (onMojave)
|
||||
{
|
||||
if (isAppearanceDark) {
|
||||
@@ -214,17 +247,6 @@ NSString * const TXSystemAppearanceChangedNotification = @"TXSystemAppearanceCha
|
||||
} else {
|
||||
appearanceType = TXAppearanceTypeMojaveLight;
|
||||
} // isAppearanceDark
|
||||
|
||||
/* On Mojave, if the user doesn't select a specific appearance,
|
||||
then we don't set an NSAppearance object on anything. */
|
||||
/* When the user selects a specific appearance, we set the
|
||||
prefer the NSAppearance object be set on the window because
|
||||
visual effect views have correct inheritance as of Mojave
|
||||
which means they don't need to set the object on individual
|
||||
views, unlike earlier versions of macOS. */
|
||||
if (preferredAppearance != TXPreferredAppearanceInherited) {
|
||||
appKitAppearanceTarget = TXAppKitAppearanceTargetWindow;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -233,11 +255,6 @@ NSString * const TXSystemAppearanceChangedNotification = @"TXSystemAppearanceCha
|
||||
} else {
|
||||
appearanceType = TXAppearanceTypeYosemiteLight;
|
||||
} // isAppearanceDark
|
||||
|
||||
/* On Yosemite through to High Sierra, we set the NSAppearance
|
||||
object on individual views. We do this for dark and light
|
||||
appearance because we want to set vibrant light. Not aqua. */
|
||||
appKitAppearanceTarget = TXAppKitAppearanceTargetView;
|
||||
} // macOS Version
|
||||
|
||||
/* Test for changes */
|
||||
|
||||
@@ -43,6 +43,8 @@ typedef NS_ENUM(NSUInteger, TXAppearanceType)
|
||||
TXAppearanceTypeYosemiteDark,
|
||||
TXAppearanceTypeMojaveLight,
|
||||
TXAppearanceTypeMojaveDark,
|
||||
TXAppearanceTypeBigSurLight,
|
||||
TXAppearanceTypeBigSurDark,
|
||||
};
|
||||
|
||||
/* TXAppKitAppearanceTarget defines which items the NSAppearance
|
||||
|
||||
@@ -258,6 +258,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
switch (appearanceType) {
|
||||
case TXAppearanceTypeYosemiteLight:
|
||||
case TXAppearanceTypeMojaveLight:
|
||||
case TXAppearanceTypeBigSurLight:
|
||||
{
|
||||
/* When the window is not in focus, when this item is selected, and when we are not
|
||||
using vibrant dark mode; the outline view does not turn our icon to a light variant
|
||||
@@ -280,9 +281,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
} else {
|
||||
return @"channelRoomStatusIconLightInactive";
|
||||
}
|
||||
} // Yosemite, Mojave
|
||||
} // Yosemite, Mojave, Big Sur
|
||||
case TXAppearanceTypeYosemiteDark:
|
||||
case TXAppearanceTypeMojaveDark:
|
||||
case TXAppearanceTypeBigSurDark:
|
||||
{
|
||||
*treatAsTemplate = NO;
|
||||
|
||||
@@ -291,7 +293,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
} else {
|
||||
return @"channelRoomStatusIconDarkInactive";
|
||||
}
|
||||
} // Yosemite, Mojave
|
||||
} // Yosemite, Mojave, Big Sur
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -304,6 +306,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
switch (appearanceType) {
|
||||
case TXAppearanceTypeYosemiteLight:
|
||||
case TXAppearanceTypeMojaveLight:
|
||||
case TXAppearanceTypeBigSurLight:
|
||||
{
|
||||
*treatAsTemplate = YES;
|
||||
|
||||
@@ -312,9 +315,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
} else {
|
||||
return @"VibrantLightServerListViewPrivateMessageUserIconInactive";
|
||||
}
|
||||
} // Yosemite, Mojave
|
||||
} // Yosemite, Mojave, Big Sur
|
||||
case TXAppearanceTypeYosemiteDark:
|
||||
case TXAppearanceTypeMojaveDark:
|
||||
case TXAppearanceTypeBigSurDark:
|
||||
{
|
||||
*treatAsTemplate = NO;
|
||||
|
||||
@@ -323,7 +327,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
} else {
|
||||
return @"VibrantDarkServerListViewPrivateMessageUserIconInactive";
|
||||
}
|
||||
} // Yosemite, Mojave
|
||||
} // Yosemite, Mojave, Big Sur
|
||||
} // switch()
|
||||
}
|
||||
|
||||
|
||||
+38
-5
@@ -24,8 +24,10 @@
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<key>CommonModern</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Modern = Mojave and later</string>
|
||||
<key>inheritFrom</key>
|
||||
<string>Common</string>
|
||||
<key>Search Field</key>
|
||||
@@ -39,10 +41,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<key>CommonModernDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Search Result</key>
|
||||
<dict>
|
||||
<key>rowEmphasized</key>
|
||||
@@ -77,10 +79,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<key>CommonModernLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Search Result</key>
|
||||
<dict>
|
||||
<key>channelNameTextColor</key>
|
||||
@@ -113,6 +115,37 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
<key>BigSur</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>BigSurDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>BigSurLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Yosemite</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
|
||||
@@ -36,8 +36,10 @@
|
||||
<string>0.65</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<key>CommonModern</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Modern = Mojave and later</string>
|
||||
<key>inheritFrom</key>
|
||||
<string>Common</string>
|
||||
<key>titlebarAccessoryViewBackgroundColor</key>
|
||||
@@ -51,10 +53,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<key>CommonModernDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>loadingScreenBackgroundColor</key>
|
||||
<dict>
|
||||
<key>type</key>
|
||||
@@ -63,10 +65,10 @@
|
||||
<string>windowBackgroundColor</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<key>CommonModernLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>loadingScreenBackgroundColor</key>
|
||||
<dict>
|
||||
<key>type</key>
|
||||
@@ -75,6 +77,37 @@
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
<key>BigSur</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>BigSurDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>BigSurLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Yosemite</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
|
||||
+37
-5
@@ -20,8 +20,10 @@
|
||||
<integer>23</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<key>CommonModern</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Modern = Mojave and later</string>
|
||||
<key>inheritFrom</key>
|
||||
<string>Common</string>
|
||||
<key>Text View</key>
|
||||
@@ -56,10 +58,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<key>CommonModernDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Background View</key>
|
||||
<dict>
|
||||
<key>backgroundColor</key>
|
||||
@@ -146,10 +148,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<key>CommonModernLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Background View</key>
|
||||
<dict>
|
||||
<key>backgroundColor</key>
|
||||
@@ -303,6 +305,36 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>BigSur</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>BigSurDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>BigSurLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Yosemite</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
|
||||
@@ -16,8 +16,10 @@
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<key>CommonModern</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Modern = Mojave and later</string>
|
||||
<key>inheritFrom</key>
|
||||
<string>Common</string>
|
||||
<key>Member Cell</key>
|
||||
@@ -59,10 +61,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<key>CommonModernDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Member Cell</key>
|
||||
<dict>
|
||||
<key>rowEmphasized</key>
|
||||
@@ -191,10 +193,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<key>CommonModernLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Member Cell</key>
|
||||
<dict>
|
||||
<key>normalTextColor</key>
|
||||
@@ -321,6 +323,36 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>BigSur</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>BigSurDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>BigSurLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Yosemite</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<key>CommonModern</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Modern = Mojave and later</string>
|
||||
<key>inheritFrom</key>
|
||||
<string>Common</string>
|
||||
<key>Server Cell</key>
|
||||
@@ -85,10 +87,10 @@
|
||||
<integer>6</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<key>CommonModernDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Server Cell</key>
|
||||
<dict>
|
||||
<key>rowEmphasized</key>
|
||||
@@ -341,10 +343,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<key>CommonModernLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>Mojave</string>
|
||||
<string>CommonModern</string>
|
||||
<key>Server Cell</key>
|
||||
<dict>
|
||||
<key>normalTextColor</key>
|
||||
@@ -593,6 +595,36 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>BigSur</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>BigSurDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>BigSurLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Mojave</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModern</string>
|
||||
</dict>
|
||||
<key>MojaveDark</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernDark</string>
|
||||
</dict>
|
||||
<key>MojaveLight</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
<string>CommonModernLight</string>
|
||||
</dict>
|
||||
<key>Yosemite</key>
|
||||
<dict>
|
||||
<key>inheritFrom</key>
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
#define TEXTUAL_SYMBOL_USED __attribute__((used))
|
||||
|
||||
#define TEXTUAL_RUNNING_ON(version, name) COCOA_EXTENSIONS_RUNNING_ON(version, name)
|
||||
#define TEXTUAL_RUNNING_ON_BIGSUR TEXTUAL_RUNNING_ON(11.0, BigSur)
|
||||
#define TEXTUAL_RUNNING_ON_MOJAVE TEXTUAL_RUNNING_ON(10.14, Mojave)
|
||||
#define TEXTUAL_RUNNING_ON_HIGHSIERRA TEXTUAL_RUNNING_ON(10.13, HighSierra)
|
||||
#define TEXTUAL_RUNNING_ON_SIERRA TEXTUAL_RUNNING_ON(10.12, Sierra)
|
||||
|
||||
Reference in New Issue
Block a user