mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
FIx inconsistent WPF theming (#2621)
This commit is contained in:
parent
d9f8cace43
commit
943acd78e8
@ -96,7 +96,6 @@ namespace Bloxstrap
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool confirmed = false;
|
||||
bool keepData = true;
|
||||
|
||||
|
@ -11,10 +11,15 @@ using Wpf.Ui.Mvvm.Services;
|
||||
|
||||
namespace Bloxstrap.UI.Elements.Base
|
||||
{
|
||||
public class WpfUiWindow : UiWindow
|
||||
public abstract class WpfUiWindow : UiWindow
|
||||
{
|
||||
private readonly IThemeService _themeService = new ThemeService();
|
||||
|
||||
public WpfUiWindow()
|
||||
{
|
||||
ApplyTheme();
|
||||
}
|
||||
|
||||
public void ApplyTheme()
|
||||
{
|
||||
_themeService.SetTheme(App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Dark ? ThemeType.Dark : ThemeType.Light);
|
||||
|
@ -78,7 +78,6 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
public ClassicFluentDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
|
||||
_viewModel = new ClassicFluentDialogViewModel(this);
|
||||
DataContext = _viewModel;
|
||||
|
@ -88,7 +88,6 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
public FluentDialog(bool aero)
|
||||
{
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
|
||||
_viewModel = new FluentDialogViewModel(this, aero);
|
||||
DataContext = _viewModel;
|
||||
|
@ -31,7 +31,6 @@ namespace Bloxstrap.UI.Elements.ContextMenu
|
||||
public MenuContainer(ActivityWatcher? activityWatcher, DiscordRichPresence? richPresenceHandler, int? processId)
|
||||
{
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
|
||||
_activityWatcher = activityWatcher;
|
||||
_richPresenceHandler = richPresenceHandler;
|
||||
|
@ -1,9 +1,10 @@
|
||||
<ui:UiWindow x:Class="Bloxstrap.UI.Elements.ContextMenu.ServerInformation"
|
||||
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.ContextMenu.ServerInformation"
|
||||
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:local="clr-namespace:Bloxstrap.UI.Elements.ContextMenu"
|
||||
xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:models="clr-namespace:Bloxstrap.UI.ViewModels.ContextMenu"
|
||||
xmlns:resources="clr-namespace:Bloxstrap.Resources"
|
||||
@ -56,4 +57,4 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:UiWindow>
|
||||
</base:WpfUiWindow>
|
||||
|
@ -1,10 +1,11 @@
|
||||
<ui:UiWindow x:Class="Bloxstrap.UI.Elements.Dialogs.AddFastFlagDialog"
|
||||
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.Dialogs.AddFastFlagDialog"
|
||||
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:local="clr-namespace:Bloxstrap.UI.Elements.Dialogs"
|
||||
xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
|
||||
xmlns:resources="clr-namespace:Bloxstrap.Resources"
|
||||
xmlns:converters="clr-namespace:Bloxstrap.UI.Converters"
|
||||
mc:Ignorable="d"
|
||||
@ -101,4 +102,4 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:UiWindow>
|
||||
</base:WpfUiWindow>
|
||||
|
@ -1,10 +1,11 @@
|
||||
<ui:UiWindow x:Class="Bloxstrap.UI.Elements.Dialogs.FluentMessageBox"
|
||||
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.Dialogs.FluentMessageBox"
|
||||
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:local="clr-namespace:Bloxstrap.UI.Elements.Dialogs"
|
||||
xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
|
||||
mc:Ignorable="d"
|
||||
Title="Bloxstrap"
|
||||
d:DesignWidth="480"
|
||||
@ -43,4 +44,4 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:UiWindow>
|
||||
</base:WpfUiWindow>
|
||||
|
@ -26,7 +26,6 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
||||
|
||||
DataContext = viewModel;
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
|
||||
viewModel.CloseRequestEvent += (_, _) => Close();
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
||||
DataContext = viewModel;
|
||||
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
||||
DataContext = viewModel;
|
||||
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,6 @@ namespace Bloxstrap.UI.Elements.Installer
|
||||
|
||||
DataContext = _viewModel;
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
|
||||
App.Logger.WriteLine("MainWindow::MainWindow", "Initializing installer");
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.Settings.MainWindow"
|
||||
x:Name="ConfigurationWindow"
|
||||
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"
|
||||
|
@ -18,7 +18,6 @@ namespace Bloxstrap.UI.Elements.Settings
|
||||
DataContext = viewModel;
|
||||
|
||||
InitializeComponent();
|
||||
ApplyTheme();
|
||||
|
||||
App.Logger.WriteLine("MainWindow::MainWindow", "Initializing menu");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user