changed messagebox + updatebox design to fit the rest

This commit is contained in:
WeeXnes 2022-10-02 16:01:21 +02:00
parent 0b689a177b
commit b9a0096cb7
9 changed files with 189 additions and 42 deletions

View file

@ -16,7 +16,7 @@ namespace WeeXnes.Core
public static string encryptionKey = "8zf5#RdyQ]$4x4_";
public static string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "WeeXnes");
public static string SettingsFileName = "settings.ini";
public static string version = "3.6.3";
public static string version = "3.6.4";
public static bool info_isRpcRunning = false;
public static bool info_RpcAutoStart;
public static string apiUrl = "http://weexnes.com:5169/";

View file

@ -318,7 +318,7 @@ namespace WeeXnes.MVVM.View
}
catch (Exception ex)
{
Misc.Message message = new Misc.Message(ex.ToString());
Misc.CriticalMessage message = new Misc.CriticalMessage(ex.ToString());
message.Show();
}
}

View file

@ -0,0 +1,53 @@
<Window x:Class="WeeXnes.Misc.CriticalMessage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WeeXnes.Misc"
mc:Ignorable="d"
Title="Message" Height="150" Width="300"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
SizeToContent="WidthAndHeight"
Background="Transparent"
AllowsTransparency="True"
WindowStyle="None">
<Border CornerRadius="4"
Margin="16"
MouseDown="UIElement_OnMouseDown">
<Border.Background>
<LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.2" Color="#8a1c2c" />
<GradientStop Offset="1" Color="#751e2c" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Border.Effect>
<DropShadowEffect BlurRadius="15" Direction="-90"
RenderingBias="Quality" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Content="Placeholder"
Name="MessageLabel"
Foreground="White"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="100,20,100,20"/>
<Button Grid.Row="1"
Style="{StaticResource UniversalMaterialButton}"
Content="OK"
Width="140"
Height="40"
Background="#520b16"
Name="okButton"
Click="okButton_Click"
Margin="0,0,0,20"/>
</Grid>
</Border>
</Window>

View file

@ -0,0 +1,26 @@
using System.Windows;
using System.Windows.Input;
namespace WeeXnes.Misc
{
public partial class CriticalMessage : Window
{
public CriticalMessage(string _message, string _title = "Message")
{
InitializeComponent();
MessageLabel.Content = _message;
this.Title = _title;
}
private void okButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
}
}

View file

@ -7,10 +7,27 @@
mc:Ignorable="d"
Title="Message" Height="150" Width="300"
ResizeMode="NoResize"
Background="#272537"
WindowStartupLocation="CenterScreen"
SizeToContent="WidthAndHeight">
<Grid>
SizeToContent="WidthAndHeight"
Background="Transparent"
AllowsTransparency="True"
WindowStyle="None">
<Border CornerRadius="4"
Margin="16"
MouseDown="UIElement_OnMouseDown">
<Border.Background>
<LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.2" Color="#212329" />
<GradientStop Offset="1" Color="#1f2026" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Border.Effect>
<DropShadowEffect BlurRadius="15" Direction="-90"
RenderingBias="Quality" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
@ -20,15 +37,17 @@
Name="MessageLabel"
Foreground="White"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
HorizontalAlignment="Center"
Padding="100,20,100,20"/>
<Button Grid.Row="1"
Style="{StaticResource UniversalMaterialButton}"
Content="OK"
Width="140"
Height="40"
Background="#353340"
Background="#2f313b"
Name="okButton"
Click="okButton_Click"/>
Click="okButton_Click"
Margin="0,0,0,20"/>
</Grid>
</Grid>
</Border>
</Window>

View file

@ -30,5 +30,11 @@ namespace WeeXnes.Misc
{
this.Close();
}
private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
}
}

View file

@ -5,41 +5,73 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WeeXnes.Misc"
mc:Ignorable="d"
Title="Message" Height="150" Width="300"
Title="Message" Height="158" Width="308"
ResizeMode="NoResize"
Background="#272537"
Background="Transparent"
AllowsTransparency="True"
WindowStyle="None"
WindowStartupLocation="CenterScreen"
SizeToContent="WidthAndHeight">
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Content="Placeholder"
Name="MessageLabel"
Foreground="White"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
<Window.Resources>
<Style TargetType="Image">
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality" />
</Style>
</Window.Resources>
<Border CornerRadius="4"
Margin="16"
MouseDown="UIElement_OnMouseDown">
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Grid.Row="1"
Style="{StaticResource UniversalMaterialButton}"
Content="OK"
Width="140"
Height="40"
Background="#353340"
Name="okButton"
Click="OkButton_OnClick"/>
<Button Grid.Row="1"
Style="{StaticResource UniversalMaterialButton}"
Content="CANCEL"
Width="140"
Height="40"
Background="#353340"
Name="cancelButton"
Click="CancelButton_OnClick"/>
</StackPanel>
</Grid>
</Grid>
<Border.Background>
<LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.2" Color="#212329" />
<GradientStop Offset="1" Color="#1f2026" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Border.Effect>
<DropShadowEffect BlurRadius="15" Direction="-90"
RenderingBias="Quality" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Content="Placeholder"
Name="MessageLabel"
Foreground="White"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="100,20,100,20"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Grid.Row="1"
Style="{StaticResource UniversalMaterialButton}"
Content="OK"
Width="140"
Height="40"
Background="#2f313b"
Name="okButton"
Click="OkButton_OnClick"
Margin="0,0,10,20"/>
<Button Grid.Row="1"
Style="{StaticResource UniversalMaterialButton}"
Content="CANCEL"
Width="140"
Height="40"
Background="#2f313b"
Name="cancelButton"
Click="CancelButton_OnClick"
Margin="10,0,0,20"/>
</StackPanel>
</Grid>
</Border>
</Window>

View file

@ -3,6 +3,7 @@ using System.Diagnostics;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Input;
using WeeXnes.Core;
using Application = System.Windows.Forms.Application;
@ -57,5 +58,11 @@ namespace WeeXnes.Misc
{
this.Close();
}
private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
}
}

View file

@ -61,6 +61,9 @@
</ApplicationDefinition>
<Compile Include="Core\ApiResponse.cs" />
<Compile Include="Core\customEvent.cs" />
<Compile Include="Misc\CriticalMessage.xaml.cs">
<DependentUpon>CriticalMessage.xaml</DependentUpon>
</Compile>
<Compile Include="Misc\UpdateMessage.xaml.cs">
<DependentUpon>UpdateMessage.xaml</DependentUpon>
</Compile>
@ -82,6 +85,7 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Misc\CriticalMessage.xaml" />
<Page Include="Misc\Message.xaml" />
<Page Include="Misc\UpdateMessage.xaml" />
<Page Include="MVVM\View\DiscordRpcView.xaml" />