Added dark mode 🦇

This commit is contained in:
Robert committed 2019-12-06 17:34:06 +01:00
1 parent e5b23075dd
commit 9ae3a4d87e
12 files changed
+207 -33

No files matched your search

@@ -6,6 +6,7 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:visualization="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.Visualization"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type visualization:ProfileDeviceViewModel}}"
d:DesignHeight="450" d:DesignWidth="800">
@@ -20,7 +21,9 @@
</Grid.LayoutTransform>
<!-- Device image with fallback -->
<Image Source="{Binding Device.RgbDevice.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Border Effect="{StaticResource MaterialDesignShadowDepth3}" VerticalAlignment="Top" HorizontalAlignment="Left" >
<Image Source="{Binding Device.RgbDevice.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}"/>
</Border>
<Rectangle Fill="{DynamicResource ControlBackgroundBrush}"
Stroke="{DynamicResource ControlBorderBrush}"
@@ -51,7 +51,7 @@
<Grid.Background>
<VisualBrush TileMode="Tile" Stretch="Uniform" Viewport="{Binding PanZoomViewModel.BackgroundViewport}" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Width="20" Height="20">
<Grid Width="25" Height="25">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
@@ -60,10 +60,10 @@
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Rectangle Grid.Row="0" Grid.Column="0" Fill="LightGray" />
<Rectangle Grid.Row="0" Grid.Column="0" Fill="{DynamicResource MaterialDesignPaper}" />
<Rectangle Grid.Row="0" Grid.Column="1" />
<Rectangle Grid.Row="1" Grid.Column="0" />
<Rectangle Grid.Row="1" Grid.Column="1" Fill="LightGray" />
<Rectangle Grid.Row="1" Grid.Column="0" />
<Rectangle Grid.Row="1" Grid.Column="1" Fill="{DynamicResource MaterialDesignPaper}" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
+5 -1
View File
@@ -12,7 +12,11 @@
Icon="/Artemis.UI;component/Resources/logo-512.png"
Title="Artemis"
GlowBrush="{DynamicResource AccentColorBrush}"
FontFamily="{StaticResource DefaultFont}"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
SaveWindowPosition="True"
UseLayoutRounding="True"
Deactivated="{s:Action WindowDeactivated}"
+15
View File
@@ -13,6 +13,8 @@ using Artemis.UI.Screens.News;
using Artemis.UI.Screens.Settings;
using Artemis.UI.Screens.SurfaceEditor;
using Artemis.UI.Screens.Workshop;
using Artemis.UI.Utilities;
using MaterialDesignThemes.Wpf;
using Stylet;
namespace Artemis.UI.Screens
@@ -47,6 +49,19 @@ namespace Artemis.UI.Screens
_pluginService.PluginDisabled += PluginServiceOnPluginDisabled;
PropertyChanged += OnSelectedModuleChanged;
PropertyChanged += OnSelectedPageChanged;
var themeWatcher = new ThemeWatcher();
themeWatcher.ThemeChanged += (sender, args) => ApplyWindowsTheme(args.Theme);
ApplyWindowsTheme(themeWatcher.GetWindowsTheme());
}
private void ApplyWindowsTheme(ThemeWatcher.WindowsTheme windowsTheme)
{
var paletteHelper = new PaletteHelper();
var theme = paletteHelper.GetTheme();
theme.SetBaseTheme(windowsTheme == ThemeWatcher.WindowsTheme.Dark ? Theme.Dark : Theme.Light);
paletteHelper.SetTheme(theme);
}
public IObservableCollection<Core.Plugins.Abstract.Module> Modules { get; set; }
@@ -8,6 +8,6 @@
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBlock>Work work!</TextBlock>
<TextBlock Style="{DynamicResource MaterialDesignBody1TextBlock}">Work work!</TextBlock>
</Grid>
</UserControl>