mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
Adjust fluent bootstrapper styles
Fix drag bug, fix sizing (because matt sucks at ui design), fix header colour being shown
This commit is contained in:
parent
a194bf937e
commit
a2261c5e92
@ -1,31 +1,41 @@
|
||||
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.Bootstrapper.ClassicFluentDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
|
||||
xmlns:resources="clr-namespace:Bloxstrap.Resources"
|
||||
mc:Ignorable="d"
|
||||
Width="420"
|
||||
MinHeight="0"
|
||||
SizeToContent="Height"
|
||||
ResizeMode="NoResize"
|
||||
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
WindowBackdropType="Mica"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Closing="UiWindow_Closing">
|
||||
<base:WpfUiWindow
|
||||
x:Class="Bloxstrap.UI.Elements.Bootstrapper.ClassicFluentDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resources="clr-namespace:Bloxstrap.Resources"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:vms="clr-namespace:Bloxstrap.UI.ViewModels.Bootstrapper"
|
||||
Width="420"
|
||||
Height="190"
|
||||
MinHeight="0"
|
||||
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
|
||||
Closing="UiWindow_Closing"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
ResizeMode="NoResize"
|
||||
WindowBackdropType="Mica"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="None"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:TitleBar Grid.Row="0" x:Name="RootTitleBar" Padding="8" Title="{Binding Title, Mode=OneTime}" ShowMinimize="False" ShowMaximize="False" CanMaximize="False" ShowClose="False" />
|
||||
|
||||
<Grid Grid.Row="1" Margin="16,8,16,16">
|
||||
|
||||
<ui:TitleBar
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Top"
|
||||
CanMaximize="False"
|
||||
ShowClose="False"
|
||||
ShowMaximize="False"
|
||||
ShowMinimize="False" />
|
||||
|
||||
<Grid Grid.Row="1" Margin="16,0,16,0" VerticalAlignment="Top">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
@ -8,12 +8,11 @@
|
||||
xmlns:resources="clr-namespace:Bloxstrap.Resources"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:vms="clr-namespace:Bloxstrap.UI.ViewModels.Bootstrapper"
|
||||
Width="500"
|
||||
Height="280"
|
||||
Width="520"
|
||||
Height="320"
|
||||
MinHeight="0"
|
||||
d:DataContext="{d:DesignInstance vms:FluentDialogViewModel,
|
||||
IsDesignTimeCreatable=True}"
|
||||
AllowsTransparency="True"
|
||||
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
|
||||
Closing="UiWindow_Closing"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
@ -43,17 +42,16 @@
|
||||
|
||||
<Image
|
||||
Grid.Row="0"
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="0,30,0,0"
|
||||
Width="96"
|
||||
Height="96"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
VerticalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Source="{Binding Icon, Mode=OneWay}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,8"
|
||||
Margin="0,0,0,16"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
|
@ -94,6 +94,10 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
DataContext = _viewModel;
|
||||
Title = App.Settings.Prop.BootstrapperTitle;
|
||||
Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource();
|
||||
|
||||
// setting this to true for mica results in the window being undraggable
|
||||
if (aero)
|
||||
AllowsTransparency = true;
|
||||
}
|
||||
|
||||
private void UiWindow_Closing(object sender, CancelEventArgs e)
|
||||
|
@ -11,6 +11,7 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper
|
||||
public class FluentDialogViewModel : BootstrapperDialogViewModel
|
||||
{
|
||||
public BackgroundType WindowBackdropType { get; set; } = BackgroundType.Mica;
|
||||
|
||||
public SolidColorBrush BackgroundColourBrush { get; set; } = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
|
||||
|
||||
[Obsolete("Do not use this! This is for the designer only.", true)]
|
||||
@ -24,9 +25,11 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper
|
||||
WindowBackdropType = aero ? BackgroundType.Aero : BackgroundType.Mica;
|
||||
|
||||
if (aero)
|
||||
{
|
||||
BackgroundColourBrush = App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Light ?
|
||||
new SolidColorBrush(Color.FromArgb(alpha, 225, 225, 225)) :
|
||||
new SolidColorBrush(Color.FromArgb(alpha, 30, 30, 30));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user