From e4a0b6b162fce311af1d47bc459eaa9d28f00c27 Mon Sep 17 00:00:00 2001 From: Basewq Date: Sat, 28 Mar 2020 19:24:51 +1300 Subject: [PATCH 1/4] [Editor] Change Editor settings properties panel's background color to be consistent with the Component properties panel --- .../editor/Stride.Core.Assets.Editor/View/SettingsWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/editor/Stride.Core.Assets.Editor/View/SettingsWindow.xaml b/sources/editor/Stride.Core.Assets.Editor/View/SettingsWindow.xaml index 2b5bdaed24..d33a123d27 100644 --- a/sources/editor/Stride.Core.Assets.Editor/View/SettingsWindow.xaml +++ b/sources/editor/Stride.Core.Assets.Editor/View/SettingsWindow.xaml @@ -57,7 +57,7 @@ - + - - @@ -201,25 +199,25 @@ + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Padding="{TemplateBinding Padding}" + SnapsToDevicePixels="true"> + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + we don't want a gray selection background when the ListBox doesn't have focus + --> + Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> + Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/> @@ -246,9 +244,9 @@ - + diff --git a/sources/editor/Stride.Assets.Presentation/AssetEditors/ScriptEditor/SimpleCodeTextEditor.cs b/sources/editor/Stride.Assets.Presentation/AssetEditors/ScriptEditor/SimpleCodeTextEditor.cs index e11e80ace4..58f5a47d4f 100644 --- a/sources/editor/Stride.Assets.Presentation/AssetEditors/ScriptEditor/SimpleCodeTextEditor.cs +++ b/sources/editor/Stride.Assets.Presentation/AssetEditors/ScriptEditor/SimpleCodeTextEditor.cs @@ -10,6 +10,7 @@ using RoslynPad.Roslyn.BraceMatching; using RoslynPad.Roslyn.Diagnostics; using RoslynPad.Roslyn.QuickInfo; +using Stride.Core.Presentation.Themes; namespace Stride.Assets.Presentation.AssetEditors.ScriptEditor { @@ -70,7 +71,7 @@ public void BindSourceTextContainer(RoslynWorkspace workspace, AvalonEditTextCon TextArea.Caret.PositionChanged += CaretOnPositionChanged; // Syntax highlighting - var classificationHighlightColors = new ClassificationHighlightColorsDark(); + var classificationHighlightColors = ThemeController.CurrentTheme.GetThemeBase() == IconThemeSelector.ThemeBase.Dark ? new ClassificationHighlightColorsDark() : new ClassificationHighlightColors(); syntaxHighlightingColorizer = new RoslynHighlightingColorizer(documentId, workspace.Host, classificationHighlightColors); TextArea.TextView.LineTransformers.Insert(0, syntaxHighlightingColorizer); diff --git a/sources/editor/Stride.Assets.Presentation/Themes/Generic.xaml b/sources/editor/Stride.Assets.Presentation/Themes/Generic.xaml index a41cc747a7..735e1732a8 100644 --- a/sources/editor/Stride.Assets.Presentation/Themes/Generic.xaml +++ b/sources/editor/Stride.Assets.Presentation/Themes/Generic.xaml @@ -212,7 +212,7 @@ - + diff --git a/sources/editor/Stride.Assets.Presentation/View/SkeletonPropertyTemplates.xaml b/sources/editor/Stride.Assets.Presentation/View/SkeletonPropertyTemplates.xaml index 72a3fb27c0..8221227f43 100644 --- a/sources/editor/Stride.Assets.Presentation/View/SkeletonPropertyTemplates.xaml +++ b/sources/editor/Stride.Assets.Presentation/View/SkeletonPropertyTemplates.xaml @@ -28,7 +28,7 @@ Command="{Binding SkeletonNodePreserveAll}" CommandParameter="{sd:False}"/> - diff --git a/sources/editor/Stride.Core.Assets.Editor/View/DefaultPropertyTemplateProviders.xaml b/sources/editor/Stride.Core.Assets.Editor/View/DefaultPropertyTemplateProviders.xaml index 30a831ed49..a534d47415 100644 --- a/sources/editor/Stride.Core.Assets.Editor/View/DefaultPropertyTemplateProviders.xaml +++ b/sources/editor/Stride.Core.Assets.Editor/View/DefaultPropertyTemplateProviders.xaml @@ -197,7 +197,7 @@ - - @@ -282,7 +282,8 @@ + Text="{Binding DisplayName, Mode=OneWay}" HorizontalAlignment="Left" VerticalAlignment="Center" + Foreground="{StaticResource SelectedTextBrush}"/> diff --git a/sources/editor/Stride.GameStudio/GameStudioWindow.xaml b/sources/editor/Stride.GameStudio/GameStudioWindow.xaml index d2be386ca2..b7a7ec0cd7 100644 --- a/sources/editor/Stride.GameStudio/GameStudioWindow.xaml +++ b/sources/editor/Stride.GameStudio/GameStudioWindow.xaml @@ -23,6 +23,15 @@ + + + + ConverterParameter={x:Static FontWeights.Bold}, FallbackValue={x:Static FontWeights.Normal}}" + Foreground="{StaticResource SelectedTextBrush}"> @@ -634,7 +644,8 @@ + ConverterParameter={x:Static FontWeights.Bold}, FallbackValue={x:Static FontWeights.Normal}}" + Foreground="{StaticResource SelectedTextBrush}"> @@ -749,7 +760,6 @@ ItemsSource="{Binding Session.ActiveProperties.ViewModel.RootNode.Children}" Visibility="{Binding Session.ActiveProperties.CanDisplayProperties, Converter={sd:VisibleOrCollapsed}}"> - Ctrl+Shift+V @@ -838,7 +848,7 @@ - + @@ -918,6 +928,15 @@ + + + + @@ -932,15 +951,17 @@ - - + + + + - + diff --git a/sources/editor/Stride.GameStudio/Theme.AvalonDock.xaml b/sources/editor/Stride.GameStudio/Theme.AvalonDock.xaml index c355ebbb46..cef7240c99 100644 --- a/sources/editor/Stride.GameStudio/Theme.AvalonDock.xaml +++ b/sources/editor/Stride.GameStudio/Theme.AvalonDock.xaml @@ -37,6 +37,14 @@ + - + @@ -641,7 +639,8 @@ - + @@ -652,11 +651,11 @@ - + - + diff --git a/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ImageExtension.cs b/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ImageExtension.cs index 4789509e09..1916af9402 100644 --- a/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ImageExtension.cs +++ b/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ImageExtension.cs @@ -47,7 +47,7 @@ public override object ProvideValue(IServiceProvider serviceProvider) { image.Source = new DrawingImage() { - Drawing = ImageThemingUtilities.TransformDrawing((source as DrawingImage)?.Drawing, IconThemeSelector.KnownThemes.Dark.GetIconTheme()) + Drawing = ImageThemingUtilities.TransformDrawing((source as DrawingImage)?.Drawing, ThemeController.CurrentTheme.GetThemeBase().GetIconTheme()) }; } diff --git a/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ThemedSourceExtension.cs b/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ThemedSourceExtension.cs index 581e6cefd7..ae8e40dbc5 100644 --- a/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ThemedSourceExtension.cs +++ b/sources/presentation/Stride.Core.Presentation/MarkupExtensions/ThemedSourceExtension.cs @@ -16,7 +16,7 @@ public class ThemedSourceExtension : MarkupExtension { public ThemedSourceExtension() { } - public ThemedSourceExtension(ImageSource source, KnownThemes theme) + public ThemedSourceExtension(ImageSource source, ThemeBase theme) { Source = source; Theme = theme.GetIconTheme(); diff --git a/sources/presentation/Stride.Core.Presentation/Themes/IconThemeSelector.cs b/sources/presentation/Stride.Core.Presentation/Themes/IconThemeSelector.cs index d33651473f..553294f74a 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/IconThemeSelector.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/IconThemeSelector.cs @@ -10,20 +10,20 @@ namespace Stride.Core.Presentation.Themes /// public static class IconThemeSelector { - public enum KnownThemes + public enum ThemeBase { Light, Dark } - public static IconTheme GetIconTheme(this KnownThemes theme) + public static IconTheme GetIconTheme(this ThemeBase theme) { switch (theme) { - case KnownThemes.Dark: + case ThemeBase.Dark: return new IconTheme("Dark", Color.FromRgb(16, 16, 17)); - case KnownThemes.Light: + case ThemeBase.Light: return new IconTheme("Light", Color.FromRgb(245, 245, 245)); default: diff --git a/sources/presentation/Stride.Core.Presentation/Themes/Overrides/DarkSteelTheme.xaml b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/DarkSteelTheme.xaml index 794c9fb0c7..770a9e5e0d 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/Overrides/DarkSteelTheme.xaml +++ b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/DarkSteelTheme.xaml @@ -13,8 +13,9 @@ #FF595959 #FF393939 #FF9BB1C5 - + + #FFFFFFFF #FF737373 @@ -22,9 +23,12 @@ #FF000000 #FFFFFFFF - - - + #FF00FF70 + + White + + + @@ -33,10 +37,11 @@ + - - - + + + @@ -49,6 +54,7 @@ + #FF8ABB2E @@ -75,6 +81,7 @@ + @@ -99,6 +106,19 @@ + + + + + + + + + + + + + diff --git a/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml index 77fa0ad10e..4a717c79d4 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml +++ b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml @@ -19,8 +19,9 @@ #FF595959 #FF393939 #FF9BB1C5 - + + #FFFFFFFF #FF737373 @@ -28,9 +29,12 @@ #FF000000 #FFFFFFFF - - - + #FF00FF70 + + White + + + @@ -39,10 +43,11 @@ + - - - + + + @@ -55,6 +60,7 @@ + #FF8ABB2E @@ -81,6 +87,7 @@ + @@ -105,6 +112,19 @@ + + + + + + + + + + + + + diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml index 48b39f6507..603570eea2 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml @@ -336,7 +336,7 @@ - + @@ -400,7 +400,7 @@ @@ -413,7 +413,7 @@ - + @@ -1073,16 +1073,12 @@ - - - - - - - - - - + + @@ -1138,16 +1134,13 @@ - - - - - - - - - - + + + @@ -1193,7 +1186,7 @@ - + @@ -1228,7 +1221,7 @@ - + @@ -1326,7 +1319,17 @@ - + + + + + @@ -2738,7 +2741,7 @@ - + @@ -2796,7 +2799,22 @@ - + + + + + + + + + + + + + + @@ -2808,12 +2826,16 @@ + + + + @@ -4691,7 +4695,17 @@ ContentSource="Header" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" - SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" /> + SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" > + + + + diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs index 6b3f36788e..a3e7867c96 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs @@ -20,7 +20,7 @@ private void Image_Loaded(object sender, RoutedEventArgs e) { img.Source = new DrawingImage { - Drawing = ImageThemingUtilities.TransformDrawing(drawingImage.Drawing, IconThemeSelector.KnownThemes.Dark.GetIconTheme()) + Drawing = ImageThemingUtilities.TransformDrawing(drawingImage.Drawing, ThemeController.CurrentTheme.GetThemeBase().GetIconTheme()) }; } } diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs index ff24a791a4..aa34763bf8 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs @@ -10,4 +10,18 @@ public enum ThemeType [Display("Dark Steel")] DarkSteel, } + + public static class ThemeTypeExtensions + { + public static IconThemeSelector.ThemeBase GetThemeBase(this ThemeType themeType) + { + switch (themeType) + { + case ThemeType.ExpressionDark: + case ThemeType.DarkSteel: + default: + return IconThemeSelector.ThemeBase.Dark; + } + } + } } From 41bea14ceeb978bd9df33235a2181b9ba5f578c6 Mon Sep 17 00:00:00 2001 From: Basewq Date: Sun, 12 Apr 2020 15:04:10 +1200 Subject: [PATCH 4/4] [Editor] Add light theme (experimental) --- .../Themes/ThemeSelector.xaml | 3 +- .../Themes/Overrides/LightSteelBlueTheme.xaml | 144 ++++++++++++++++++ .../Themes/ThemeResourceDictionary.cs | 12 ++ .../Themes/ThemeSelector.xaml | 3 +- .../Themes/ThemeType.cs | 8 + 5 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 sources/presentation/Stride.Core.Presentation/Themes/Overrides/LightSteelBlueTheme.xaml diff --git a/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml b/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml index 2c5c0b6de2..a9241e7ace 100644 --- a/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml +++ b/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml @@ -7,5 +7,6 @@ xmlns:themes="clr-namespace:Stride.Core.Presentation.Themes;assembly=Stride.Core.Presentation" Source="ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml" ExpressionDarkSource="ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml" - DarkSteelSource="ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml"> + DarkSteelSource="ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml" + LightSteelBlueSource="ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml"> diff --git a/sources/presentation/Stride.Core.Presentation/Themes/Overrides/LightSteelBlueTheme.xaml b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/LightSteelBlueTheme.xaml new file mode 100644 index 0000000000..b4c419ea7c --- /dev/null +++ b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/LightSteelBlueTheme.xaml @@ -0,0 +1,144 @@ + + + + + #FF939393 + #FFAAAAAA + #FF9BB1C5 + + + + + #FFFFFFFF + #FF999999 + + #FF000000 + #FFFFFFFF + + DarkGreen + + Black + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #FF8ABB2E + + + #FFFFCF00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs index 7ced3208a9..d6edd5dde0 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs @@ -9,6 +9,7 @@ public class ThemeResourceDictionary : ResourceDictionary { private Uri expressionDarkSource; private Uri darkSteelSource; + private Uri expressionLightSource; // New themes are added here as new properties. @@ -24,6 +25,12 @@ public Uri DarkSteelSource set => SetValue(ref darkSteelSource, value); } + public Uri LightSteelBlueSource + { + get => expressionLightSource; + set => SetValue(ref expressionLightSource, value); + } + public void UpdateSource(ThemeType themeType) { switch (themeType) @@ -37,6 +44,11 @@ public void UpdateSource(ThemeType themeType) if (DarkSteelSource != null) Source = DarkSteelSource; break; + + case ThemeType.LightSteelBlue: + if (LightSteelBlueSource != null) + Source = LightSteelBlueSource; + break; } } diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml index 603570eea2..15fc60fef1 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml @@ -36,7 +36,8 @@ --> + DarkSteelSource="Overrides/DarkSteelTheme.xaml" + LightSteelBlueSource="Overrides/LightSteelBlueTheme.xaml" /> F1 M 46.5,19C 47.8807,19 49,20.1193 49,21.5C 49,22.8807 47.8807,24 46.5,24L 45.8641,23.9184L 43.5566,26.8718C 45.1489,28.0176 46.5309,29.6405 47.6023,31.6025C 44.8701,32.4842 41.563,33 38,33C 34.4369,33 31.1299,32.4842 28.3977,31.6025C 29.4333,29.7061 30.7591,28.1265 32.2844,26.9882L 29.9221,23.9646C 29.7849,23.9879 29.6438,24 29.5,24C 28.1193,24 27,22.8808 27,21.5C 27,20.1193 28.1193,19 29.5,19C 30.8807,19 32,20.1193 32,21.5C 32,22.0018 31.8521,22.4691 31.5976,22.8607L 34.0019,25.938C 35.2525,25.3305 36.5982,25 38,25C 39.3339,25 40.617,25.2993 41.8156,25.8516L 44.2947,22.6786C 44.1066,22.3274 44,21.9262 44,21.5C 44,20.1193 45.1193,19 46.5,19 Z M 54.5,40C 55.3284,40 56,40.6716 56,41.5C 56,42.3284 55.3284,43 54.5,43L 49.9511,43C 49.88,44.0847 49.7325,45.1391 49.5162,46.1531L 54.8059,48.6197C 55.5567,48.9698 55.8815,49.8623 55.5314,50.6131C 55.1813,51.3639 54.2889,51.6887 53.5381,51.3386L 48.6665,49.067C 46.8161,53.9883 43.2172,57.4651 39,57.9435L 39,34.9864C 42.541,34.8897 45.7913,34.283 48.4239,33.3201L 48.6187,33.8074L 53.73,31.8454C 54.5034,31.5485 55.371,31.9348 55.6679,32.7082C 55.9648,33.4816 55.5785,34.3492 54.8051,34.6461L 49.482,36.6895C 49.717,37.7515 49.8763,38.859 49.9511,40L 54.5,40 Z M 21.5,40L 26.0489,40C 26.1237,38.859 26.2829,37.7516 26.518,36.6895L 21.1949,34.6461C 20.4215,34.3492 20.0352,33.4816 20.332,32.7082C 20.6289,31.9348 21.4966,31.5485 22.27,31.8454L 27.3812,33.8074L 27.5761,33.3201C 30.2087,34.283 33.4589,34.8897 37,34.9864L 37,57.9435C 32.7827,57.4651 29.1838,53.9883 27.3335,49.067L 22.4618,51.3387C 21.711,51.6888 20.8186,51.3639 20.4685,50.6131C 20.1184,49.8623 20.4432,48.9699 21.194,48.6198L 26.4838,46.1531C 26.2674,45.1392 26.12,44.0847 26.0489,43L 21.5,43C 20.6716,43 20,42.3285 20,41.5C 20,40.6716 20.6716,40 21.5,40 Z diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs index aa34763bf8..de09180f08 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs @@ -5,10 +5,15 @@ namespace Stride.Core.Presentation.Themes { public enum ThemeType { + // Dark themes [Display("Expression Dark (Default)")] ExpressionDark, [Display("Dark Steel")] DarkSteel, + + // Light themes + [Display("Light Steel Blue (Experimental)")] + LightSteelBlue, } public static class ThemeTypeExtensions @@ -21,6 +26,9 @@ public static IconThemeSelector.ThemeBase GetThemeBase(this ThemeType themeType) case ThemeType.DarkSteel: default: return IconThemeSelector.ThemeBase.Dark; + + case ThemeType.LightSteelBlue: + return IconThemeSelector.ThemeBase.Light; } } }