Layouts - Round LEDs and device size

Tray - Use dark icon for for light Windows theme
This commit is contained in:
Robert committed 2021-05-15 13:50:01 +02:00
1 parent 96c55e5c03
commit c7c78dfecc
5 files changed
+57 -40

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d">
<tb:TaskbarIcon IconSource="/Resources/Images/Logo/bow-white.ico"
<tb:TaskbarIcon IconSource="{Binding Icon}"
MenuActivation="LeftOrRightClick"
PopupActivation="DoubleClick"
DoubleClickCommand="{s:Action TrayBringToForeground}"
+16 -1
View File
@@ -1,6 +1,8 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Events;
@@ -27,6 +29,7 @@ namespace Artemis.UI.Screens
private RootViewModel _rootViewModel;
private SplashViewModel _splashViewModel;
private TaskbarIcon _taskBarIcon;
private ImageSource _icon;
public TrayViewModel(IKernel kernel,
IWindowManager windowManager,
@@ -90,6 +93,12 @@ namespace Artemis.UI.Screens
OnMainWindowOpened();
}
public ImageSource Icon
{
get => _icon;
set => SetAndNotify(ref _icon, value);
}
public void TrayActivateSidebarItem(string sidebarItem)
{
TrayBringToForeground();
@@ -168,9 +177,15 @@ namespace Artemis.UI.Screens
private void ApplyWindowsTheme(ThemeWatcher.WindowsTheme windowsTheme)
{
Execute.PostToUIThread(() =>
{
Icon = windowsTheme == ThemeWatcher.WindowsTheme.Dark
? new BitmapImage(new Uri("pack://application:,,,/Artemis.UI;component/Resources/Images/Logo/bow-white.ico"))
: new BitmapImage(new Uri("pack://application:,,,/Artemis.UI;component/Resources/Images/Logo/bow-black.ico"));
});
if (_colorScheme.Value != ApplicationColorScheme.Automatic)
return;
if (windowsTheme == ThemeWatcher.WindowsTheme.Dark)
ChangeMaterialColors(ApplicationColorScheme.Dark);
else