diff --git a/sources/editor/Stride.Assets.Presentation/AssetEditors/EntityHierarchyEditor/Views/EntityHierarchyEditorView.xaml b/sources/editor/Stride.Assets.Presentation/AssetEditors/EntityHierarchyEditor/Views/EntityHierarchyEditorView.xaml index 5fd8911f31..45dfb74686 100644 --- a/sources/editor/Stride.Assets.Presentation/AssetEditors/EntityHierarchyEditor/Views/EntityHierarchyEditorView.xaml +++ b/sources/editor/Stride.Assets.Presentation/AssetEditors/EntityHierarchyEditor/Views/EntityHierarchyEditorView.xaml @@ -249,12 +249,15 @@ + + + - - @@ -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/Settings/EditorSettings.cs b/sources/editor/Stride.Core.Assets.Editor/Settings/EditorSettings.cs index 66461f0d17..db424e374f 100644 --- a/sources/editor/Stride.Core.Assets.Editor/Settings/EditorSettings.cs +++ b/sources/editor/Stride.Core.Assets.Editor/Settings/EditorSettings.cs @@ -124,10 +124,13 @@ static EditorSettings() public static void Initialize() { profile = SettingsContainer.LoadSettingsProfile(EditorPath.EditorConfigPath, true) ?? SettingsContainer.CreateSettingsProfile(true); + Presentation.Themes.ThemesSettings.Initialize(); // Settings that requires a restart must register here: UseEffectCompilerServer.ChangesValidated += (s, e) => NeedRestart = true; Language.ChangesValidated += (s, e) => NeedRestart = true; + + Presentation.Themes.ThemesSettings.ThemeName.ChangesValidated += (s, e) => NeedRestart = true; } public static void Save() diff --git a/sources/editor/Stride.Core.Assets.Editor/Settings/ThemesSettings.cs b/sources/editor/Stride.Core.Assets.Editor/Settings/ThemesSettings.cs new file mode 100644 index 0000000000..889a546122 --- /dev/null +++ b/sources/editor/Stride.Core.Assets.Editor/Settings/ThemesSettings.cs @@ -0,0 +1,29 @@ +// Copyright (c) Stride contributors (https://stride3d.net) +// Distributed under the MIT license. See the LICENSE.md file in the project root for more information. +using Stride.Core.Assets.Editor.Settings; +using Stride.Core.Settings; +using Stride.Core.Translation; + +namespace Stride.Core.Presentation.Themes +{ + public static class ThemesSettings + { + // Categories + public static readonly string Themes = Tr._p("Settings", "Themes"); + + static ThemesSettings() + { + ThemeName = new SettingsKey("Themes/ThemeName", EditorSettings.SettingsContainer, ThemeType.ExpressionDark) + { + DisplayName = $"{Themes}/{Tr._p("Settings", "Theme Name")}" + }; + } + + public static SettingsKey ThemeName { get; } + + public static void Initialize() + { + ThemeController.CurrentTheme = ThemeName.GetValue(); + } + } +} diff --git a/sources/editor/Stride.Core.Assets.Editor/Themes/ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml b/sources/editor/Stride.Core.Assets.Editor/Themes/ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml index d270f020e9..5c45545319 100644 --- a/sources/editor/Stride.Core.Assets.Editor/Themes/ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml +++ b/sources/editor/Stride.Core.Assets.Editor/Themes/ExpressionDark/TableflowView.ExpressionDark.normalcolor.xaml @@ -20,7 +20,7 @@ - + diff --git a/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml b/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml new file mode 100644 index 0000000000..a9241e7ace --- /dev/null +++ b/sources/editor/Stride.Core.Assets.Editor/Themes/ThemeSelector.xaml @@ -0,0 +1,12 @@ + + + diff --git a/sources/editor/Stride.Core.Assets.Editor/Themes/generic.xaml b/sources/editor/Stride.Core.Assets.Editor/Themes/generic.xaml index d4d41b2470..1e77b1d0d6 100644 --- a/sources/editor/Stride.Core.Assets.Editor/Themes/generic.xaml +++ b/sources/editor/Stride.Core.Assets.Editor/Themes/generic.xaml @@ -6,7 +6,7 @@ xmlns:diagnostics="clr-namespace:Stride.Core.Assets.Diagnostics;assembly=Stride.Core.Assets"> - + diff --git a/sources/editor/Stride.Core.Assets.Editor/View/CommonResources.xaml b/sources/editor/Stride.Core.Assets.Editor/View/CommonResources.xaml index c4cc62f463..fe31bc2745 100644 --- a/sources/editor/Stride.Core.Assets.Editor/View/CommonResources.xaml +++ b/sources/editor/Stride.Core.Assets.Editor/View/CommonResources.xaml @@ -9,9 +9,9 @@ mc:Ignorable="d"> - - - + + + + + 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 9461bf2726..cef7240c99 100644 --- a/sources/editor/Stride.GameStudio/Theme.AvalonDock.xaml +++ b/sources/editor/Stride.GameStudio/Theme.AvalonDock.xaml @@ -27,10 +27,6 @@ - - - - @@ -41,6 +37,14 @@ + - + @@ -645,7 +639,8 @@ - + @@ -656,11 +651,11 @@ - + - + diff --git a/sources/editor/Stride.PrivacyPolicy/PrivacyPolicyWindow.xaml b/sources/editor/Stride.PrivacyPolicy/PrivacyPolicyWindow.xaml index 9124c34189..ccb8bfd30a 100644 --- a/sources/editor/Stride.PrivacyPolicy/PrivacyPolicyWindow.xaml +++ b/sources/editor/Stride.PrivacyPolicy/PrivacyPolicyWindow.xaml @@ -9,7 +9,7 @@ - + diff --git a/sources/launcher/Stride.Launcher/App.xaml b/sources/launcher/Stride.Launcher/App.xaml index e1fb089f61..21624885e8 100644 --- a/sources/launcher/Stride.Launcher/App.xaml +++ b/sources/launcher/Stride.Launcher/App.xaml @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + 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 new file mode 100644 index 0000000000..770a9e5e0d --- /dev/null +++ b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/DarkSteelTheme.xaml @@ -0,0 +1,144 @@ + + + + + #FF595959 + #FF393939 + #FF9BB1C5 + + + + + #FFFFFFFF + #FF737373 + + #FF000000 + #FFFFFFFF + + #FF00FF70 + + White + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #FF8ABB2E + + + #FFFFCF00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml new file mode 100644 index 0000000000..4a717c79d4 --- /dev/null +++ b/sources/presentation/Stride.Core.Presentation/Themes/Overrides/ExpressionDarkTheme.xaml @@ -0,0 +1,150 @@ + + + + + #FF595959 + #FF393939 + #FF9BB1C5 + + + + + #FFFFFFFF + #FF737373 + + #FF000000 + #FFFFFFFF + + #FF00FF70 + + White + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #FF8ABB2E + + + #FFFFCF00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/ThemeController.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeController.cs index ffe4a4a722..a06fc71be7 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ThemeController.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeController.cs @@ -26,5 +26,7 @@ public static void SetIsDark(DependencyObject obj, bool value) { obj.SetValue(IsDarkProperty, value); } + + public static ThemeType CurrentTheme { get; set; } } } diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs new file mode 100644 index 0000000000..d6edd5dde0 --- /dev/null +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeResourceDictionary.cs @@ -0,0 +1,61 @@ +// Copyright (c) Stride contributors (https://stride3d.net) +// Distributed under the MIT license. See the LICENSE.md file in the project root for more information. +using System; +using System.Windows; + +namespace Stride.Core.Presentation.Themes +{ + public class ThemeResourceDictionary : ResourceDictionary + { + private Uri expressionDarkSource; + private Uri darkSteelSource; + private Uri expressionLightSource; + + // New themes are added here as new properties. + + public Uri ExpressionDarkSource + { + get => expressionDarkSource; + set => SetValue(ref expressionDarkSource, value); + } + + public Uri DarkSteelSource + { + get => darkSteelSource; + set => SetValue(ref darkSteelSource, value); + } + + public Uri LightSteelBlueSource + { + get => expressionLightSource; + set => SetValue(ref expressionLightSource, value); + } + + public void UpdateSource(ThemeType themeType) + { + switch (themeType) + { + case ThemeType.ExpressionDark: + if (ExpressionDarkSource != null) + Source = ExpressionDarkSource; + break; + + case ThemeType.DarkSteel: + if (DarkSteelSource != null) + Source = DarkSteelSource; + break; + + case ThemeType.LightSteelBlue: + if (LightSteelBlueSource != null) + Source = LightSteelBlueSource; + break; + } + } + + private void SetValue(ref Uri sourceBackingField, Uri value) + { + sourceBackingField = value; + UpdateSource(ThemeController.CurrentTheme); + } + } +} diff --git a/sources/presentation/Stride.Core.Presentation/Themes/ExpressionDark/Theme.xaml b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml similarity index 97% rename from sources/presentation/Stride.Core.Presentation/Themes/ExpressionDark/Theme.xaml rename to sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml index 64a985e34b..15fc60fef1 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ExpressionDark/Theme.xaml +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml @@ -1,4 +1,8 @@ + - - - #FF595959 - #FF393939 - #FF9BB1C5 - - - - #FFFFFFFF - #FF737373 - - #FF000000 - #FFFFFFFF - - - - - - - - - - - - - - - - - - - - - - - - - - #FF8ABB2E - - - #FFFFCF00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 F1 M 40.3806,19.0027C 49.5637,19.0027 57.008,23.611 57.008,29.2958C 57.008,32.9008 54.0141,36.073 49.4815,37.9115C 50.4478,39.7772 52.1442,41.8291 53.8406,44.4135C 50.3128,43.1826 45.0382,41.9924 41.9082,39.546L 40.3806,39.5889C 31.1976,39.5889 23.7533,34.9805 23.7533,29.2958C 23.7533,23.611 31.1976,19.0027 40.3806,19.0027 Z M 44.3395,43.5477C 44.3395,48.3579 38.6677,52.2573 31.6711,52.2573L 30.7082,52.2325C 28.1329,54.6161 24.5589,57.008 20.5862,57.008C 21.5113,55.1577 23.5174,53.3075 24.7099,50.8257C 21.2717,49.2683 19.0026,46.5902 19.0026,43.5477C 19.0026,40.5065 21.27,37.8293 24.706,36.2715C 27.6472,39.1709 32.8586,41.0982 38.7973,41.0982L 40.3249,41.0553C 41.4454,41.9312 42.8409,42.646 44.3327,43.2594L 44.3395,43.5477 Z F1 M 38,19C 48.4934,19 57,27.5066 57,38C 57,48.4934 48.4934,57 38,57C 27.5066,57 19,48.4934 19,38C 19,27.5066 27.5066,19 38,19 Z M 33.25,33.25L 33.25,36.4167L 36.4166,36.4167L 36.4166,47.5L 33.25,47.5L 33.25,50.6667L 44.3333,50.6667L 44.3333,47.5L 41.1666,47.5L 41.1666,36.4167L 41.1666,33.25L 33.25,33.25 Z M 38.7917,25.3333C 37.48,25.3333 36.4167,26.3967 36.4167,27.7083C 36.4167,29.02 37.48,30.0833 38.7917,30.0833C 40.1033,30.0833 41.1667,29.02 41.1667,27.7083C 41.1667,26.3967 40.1033,25.3333 38.7917,25.3333 Z @@ -165,7 +70,6 @@ - @@ -510,7 +414,7 @@ - + @@ -1170,16 +1074,12 @@ - - - - - - - - - - + + @@ -1235,16 +1135,13 @@ - - - - - - - - - - + + + @@ -1290,7 +1187,7 @@ - + @@ -1325,7 +1222,7 @@ - + @@ -1423,7 +1320,17 @@ - + + + + + @@ -2835,7 +2742,7 @@ - + @@ -2893,7 +2800,22 @@ - + + + + + + + + + + + + + + @@ -2905,12 +2827,16 @@ + + + + @@ -4788,7 +4696,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/ExpressionDark/Theme.xaml.cs b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs similarity index 73% rename from sources/presentation/Stride.Core.Presentation/Themes/ExpressionDark/Theme.xaml.cs rename to sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs index 03bd47b79f..a3e7867c96 100644 --- a/sources/presentation/Stride.Core.Presentation/Themes/ExpressionDark/Theme.xaml.cs +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeSelector.xaml.cs @@ -5,11 +5,11 @@ using System.Windows.Controls; using System.Windows.Media; -namespace Stride.Core.Presentation.Themes.ExpressionDark +namespace Stride.Core.Presentation.Themes { - public partial class ExpressionDarkTheme : ResourceDictionary + public partial class ThemeSelector : ResourceDictionary { - public ExpressionDarkTheme() + public ThemeSelector() { InitializeComponent(); } @@ -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 new file mode 100644 index 0000000000..de09180f08 --- /dev/null +++ b/sources/presentation/Stride.Core.Presentation/Themes/ThemeType.cs @@ -0,0 +1,35 @@ +// Copyright (c) Stride contributors (https://stride3d.net) +// Distributed under the MIT license. See the LICENSE.md file in the project root for more information. + +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 + { + public static IconThemeSelector.ThemeBase GetThemeBase(this ThemeType themeType) + { + switch (themeType) + { + case ThemeType.ExpressionDark: + case ThemeType.DarkSteel: + default: + return IconThemeSelector.ThemeBase.Dark; + + case ThemeType.LightSteelBlue: + return IconThemeSelector.ThemeBase.Light; + } + } + } +}