diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-01-03 22:44:37 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-01-11 23:19:25 +0300 |
commit | 71ad75860e1c5b6c33163d390988dbfbf409b4ac (patch) | |
tree | 80f6ed1ac0a1a0face888e3481f802f4d328a312 /Xamarin.PropertyEditing.Mac.Standalone | |
parent | 104acbcc9c62e1a90e9e43cb7630583cb2b49ca4 (diff) |
[mac] Revamp theming
This commit:
- Drops outdated CG* editors
- Drops ThemeManager
- Introduces IHostResourceProvider
- Moves all images to new API
- Starts implementing colors
Diffstat (limited to 'Xamarin.PropertyEditing.Mac.Standalone')
13 files changed, 291 insertions, 15 deletions
diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Checkerboard0.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Checkerboard0.colorset/Contents.json new file mode 100644 index 0000000..a0724b3 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Checkerboard0.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xFF", + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0.149", + "alpha" : "1.000", + "blue" : "0.149", + "green" : "0.149" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Checkerboard1.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Checkerboard1.colorset/Contents.json new file mode 100644 index 0000000..954a6bf --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Checkerboard1.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xD9", + "alpha" : "1.000", + "blue" : "0xD9", + "green" : "0xD9" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x00", + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Contents.json index 4caf392..da4a164 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Contents.json +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/Contents.json @@ -1,4 +1,4 @@ -{ +{ "info" : { "version" : 1, "author" : "xcode" diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/DescriptionLabelColor.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/DescriptionLabelColor.colorset/Contents.json new file mode 100644 index 0000000..48a0385 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/DescriptionLabelColor.colorset/Contents.json @@ -0,0 +1,14 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "reference" : "secondaryLabelColor" + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/ForegroundColor.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/ForegroundColor.colorset/Contents.json new file mode 100644 index 0000000..a673516 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/ForegroundColor.colorset/Contents.json @@ -0,0 +1,14 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "reference" : "labelColor" + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/PadBackgroundColor.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/PadBackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..70d3b65 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/PadBackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xF0", + "alpha" : "1.000", + "blue" : "0xF3", + "green" : "0xF1" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x26", + "alpha" : "1.000", + "blue" : "0x26", + "green" : "0x26" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/PopoverContentBackground.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/PopoverContentBackground.colorset/Contents.json new file mode 100644 index 0000000..028eb81 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/PopoverContentBackground.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xFF", + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x3D", + "alpha" : "1.000", + "blue" : "0x3D", + "green" : "0x3D" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/SelectionBackgroundColor.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/SelectionBackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..01ee64f --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/SelectionBackgroundColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x51", + "alpha" : "1.000", + "blue" : "0xED", + "green" : "0x89" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/SelectionUnfocusedBackgroundColor.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/SelectionUnfocusedBackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..0570f77 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/SelectionUnfocusedBackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xD8", + "alpha" : "1.000", + "blue" : "0xF3", + "green" : "0xE2" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x3F", + "alpha" : "1.000", + "blue" : "0x5E", + "green" : "0x4A" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/ValueBlockBackgroundColor.colorset/Contents.json b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/ValueBlockBackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..7052754 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac.Standalone/Assets.xcassets/ValueBlockBackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0.000", + "alpha" : "0.080", + "blue" : "0.000", + "green" : "0.000" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "1.000", + "alpha" : "0.100", + "blue" : "1.000", + "green" : "1.000" + } + } + } + ] +}
\ No newline at end of file diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Main.storyboard b/Xamarin.PropertyEditing.Mac.Standalone/Main.storyboard index fe8e29a..c5bfe6c 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/Main.storyboard +++ b/Xamarin.PropertyEditing.Mac.Standalone/Main.storyboard @@ -720,8 +720,8 @@ <segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="qr0-t0-q16"> <font key="font" metaFont="system"/> <segments> - <segment label="Dark" width="61" selected="YES"/> - <segment label="Light" width="61" tag="1"/> + <segment label="Dark" width="61"/> + <segment label="Light" width="61" selected="YES" tag="1"/> <segment label="None"/> </segments> </segmentedCell> diff --git a/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs b/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs index 7a269f4..3b79ef7 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs @@ -83,18 +83,9 @@ namespace Xamarin.PropertyEditing.Mac.Standalone // If theme toggled, then notify our manager partial void OnThemeChanged (NSObject sender) { - var themeControl = sender as NSSegmentedControl; - switch (themeControl.SelectedSegment) { - case 0: - PropertyEditorPanel.ThemeManager.Theme = Themes.PropertyEditorTheme.Dark; - break; - case 1: - PropertyEditorPanel.ThemeManager.Theme = Themes.PropertyEditorTheme.Light; - break; - case 2: - PropertyEditorPanel.ThemeManager.Theme = Themes.PropertyEditorTheme.None; - break; - } + var themeControl = (NSSegmentedControl)sender; + + View.Appearance = NSAppearance.GetAppearance ((themeControl.SelectedSegment == 0) ? NSAppearance.NameVibrantDark : NSAppearance.NameAqua); } } } diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj b/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj index 654928c..df6d05f 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj +++ b/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj @@ -68,6 +68,15 @@ <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512%402x.png" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\Checkerboard0.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\Checkerboard1.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\ForegroundColor.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\PadBackgroundColor.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\PopoverContentBackground.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\SelectionBackgroundColor.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\SelectionUnfocusedBackgroundColor.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\ValueBlockBackgroundColor.colorset\Contents.json" />
+ <ImageAsset Include="Assets.xcassets\DescriptionLabelColor.colorset\Contents.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
|