Files
Nebula-Auth/NebulaAuth/Theme/WindowStyle/WindowStyle.xaml
T
achiez 8ff960189e 1.5.6 Bug fixes and code clean-ups
- Update: Added "Copy Password" to Mafile context menu (if available)
- Update: "Save Password" now pre-fills the current password in the "Login Again" dialog when encryption is enabled
- Fix: Prevented overlapping confirmation cycles in AutoConfirmer
- Fix: Added a Snackbar notification when a confirmation cycle is skipped due to a too frequent timer interval
- Fix: Fixed a rare bug where the previous proxy was used instead of the current one during session refresh
- Fix: Corrected "Session Permanently Expired" message showing on unrelated errors (e.g. network issues)
- UI-Fix: Fixed visual glitch where proxy input appeared non-empty when switching to a mafile-specific proxy
- Cleanup: Refactored and cleaned up codebase, improved styling and formatting via ReSharper
2025-05-02 23:29:24 +03:00

105 lines
5.2 KiB
XML

<ResourceDictionary x:Class="NebulaAuth.Theme.WindowStyle.WindowStyle"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:NebulaAuth.Theme.WindowStyle">
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
</Style>
<ControlTemplate x:Key="WindowTemplate" TargetType="{x:Type Window}">
<!--<i:Interaction.Behaviors>
<local:WindowChromeLoadedBehavior />
</i:Interaction.Behaviors>-->
<Grid>
<Border x:Name="RootBorder"
Margin="{x:Static local:WindowChromeHelper.LayoutOffsetThickness}"
BorderBrush="Transparent"
BorderThickness="1"
Background="{DynamicResource WindowBackground}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid x:Name="TitleBar"
Grid.Row="0"
Height="28"
Background="{DynamicResource WindowBackground}">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource PrimaryHueMidBrush}"
Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
FontSize="17" />
<!-- Window Buttons -->
<StackPanel
HorizontalAlignment="Right"
Orientation="Horizontal">
<StackPanel.Resources>
<Style TargetType="materialDesign:PackIcon">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</StackPanel.Resources>
<Button x:Name="MinimizeButton"
Click="OnMinimizeClick">
<materialDesign:PackIcon Kind="WindowMinimize" />
</Button>
<Button x:Name="MaximizeRestoreButton"
Click="OnMaximizeRestoreClick">
<materialDesign:PackIcon Kind="WindowMaximize" />
</Button>
<Button x:Name="CloseButton"
Click="OnCloseClick">
<materialDesign:PackIcon Kind="WindowClose" />
</Button>
</StackPanel>
</Grid>
<!-- Main Window Content -->
<Grid x:Name="MainGrid"
Grid.Row="1"
Background="{DynamicResource MainBackgroundBrush}">
<AdornerDecorator>
<ContentPresenter />
</AdornerDecorator>
</Grid>
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsActive" Value="True">
<Setter TargetName="RootBorder" Property="BorderBrush" Value="#1e1e24" />
</Trigger>
<Trigger Property="WindowState" Value="Maximized">
<Setter TargetName="RootBorder" Property="BorderThickness"
Value="{Binding Source={x:Static local:WindowChromeHelper.WindowResizeBorderThickness}}" />
<Setter TargetName="RootBorder" Property="BorderBrush" Value="Transparent" />
<Setter TargetName="MaximizeRestoreButton" Property="Content">
<Setter.Value>
<materialDesign:PackIcon Kind="WindowRestore" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="MainWindow" TargetType="{x:Type Window}">
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome
CaptionHeight="38"
CornerRadius="0"
GlassFrameThickness="0"
NonClientFrameEdges="None"
ResizeBorderThickness="5"
UseAeroCaptionButtons="False" />
</Setter.Value>
</Setter>
<Setter Property="Template" Value="{StaticResource WindowTemplate}" />
</Style>
</ResourceDictionary>