From 14ee7015e659f3deebe704515fc2350ef902cb17 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:25:35 +0100 Subject: [PATCH] improve window border stuff --- .../UI/Elements/Bootstrapper/CustomDialog.Creator.cs | 12 +++++++++++- wpfui | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index e1c4f82..96f3fed 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -636,8 +636,18 @@ namespace Bloxstrap.UI.Elements.Bootstrapper dialog.Effect = null; var theme = ParseXmlAttribute(xmlElement, "Theme", Theme.Default); + if (theme == Theme.Default) + theme = App.Settings.Prop.Theme; + + var wpfUiTheme = theme.GetFinal() == Theme.Dark ? Wpf.Ui.Appearance.ThemeType.Dark : Wpf.Ui.Appearance.ThemeType.Light; + dialog.Resources.MergedDictionaries.Clear(); - dialog.Resources.MergedDictionaries.Add(new ThemesDictionary() { Theme = theme.GetFinal() == Theme.Dark ? Wpf.Ui.Appearance.ThemeType.Dark : Wpf.Ui.Appearance.ThemeType.Light }); + dialog.Resources.MergedDictionaries.Add(new ThemesDictionary() { Theme = wpfUiTheme }); + dialog.DefaultBorderThemeOverwrite = wpfUiTheme; + + // disable default window border if border is modified + if (xmlElement.Attribute("BorderBrush") != null || xmlElement.Attribute("BorderThickness") != null) + dialog.DefaultBorderEnabled = false; // set the margin & padding on the element grid dialog.ElementGrid.Margin = dialog.Margin; diff --git a/wpfui b/wpfui index c4c58c5..cdc5d64 160000 --- a/wpfui +++ b/wpfui @@ -1 +1 @@ -Subproject commit c4c58c589970a66b27a9de41ab1b6b6539918b52 +Subproject commit cdc5d6455ea313a19a048ae1d746b3825465f341