From 8849252e2b045d748118360350582f52bd2a5675 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 12 Dec 2019 23:29:32 +0100 Subject: [PATCH] Tweaked splash window look & behaviour --- src/Artemis.UI/Screens/Splash/SplashView.xaml | 9 ++++++--- src/Artemis.UI/Screens/Splash/SplashViewModel.cs | 12 +++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Artemis.UI/Screens/Splash/SplashView.xaml b/src/Artemis.UI/Screens/Splash/SplashView.xaml index 4b41f103f..552234c83 100644 --- a/src/Artemis.UI/Screens/Splash/SplashView.xaml +++ b/src/Artemis.UI/Screens/Splash/SplashView.xaml @@ -5,13 +5,16 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:splash="clr-namespace:Artemis.UI.Screens.Splash" xmlns:controls="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions" + xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" - Title="Artemis" - WindowStyle="None" + Title=" " + ResizeMode="NoResize" + BorderBackgroundBrush="{DynamicResource PrimaryHueMidBrush}" Height="450" Width="400" - WindowStartupLocation="CenterScreen" + WindowStartupLocation="CenterScreen" FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto" + MouseDown="{s:Action MouseDown}" d:DataContext="{d:DesignInstance splash:SplashViewModel}"> diff --git a/src/Artemis.UI/Screens/Splash/SplashViewModel.cs b/src/Artemis.UI/Screens/Splash/SplashViewModel.cs index 7760a92b0..e4f95549a 100644 --- a/src/Artemis.UI/Screens/Splash/SplashViewModel.cs +++ b/src/Artemis.UI/Screens/Splash/SplashViewModel.cs @@ -1,4 +1,6 @@ -using Artemis.Core.Services.Interfaces; +using System.Windows.Input; +using Artemis.Core.Services.Interfaces; +using MaterialDesignExtensions.Controls; using Ninject; using Stylet; @@ -23,5 +25,13 @@ namespace Artemis.UI.Screens.Splash pluginService.PluginLoading += (sender, args) => Status = "Loading plugin: " + args.PluginInfo.Name; pluginService.PluginLoaded += (sender, args) => Status = "Initializing UI"; } + + // ReSharper disable once UnusedMember.Global - Called from view + public void MouseDown(object sender, MouseButtonEventArgs e) + { + // Allow dragging the window by clicking anywhere + if (e.ChangedButton == MouseButton.Left) + ((MaterialWindow) View).DragMove(); + } } } \ No newline at end of file