mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Make AbstractUIGroupDialog title bar dark
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:ZuneModdingHelper"
|
||||
xmlns:absui="clr-namespace:OwlCore.Wpf.AbstractUI.Controls;assembly=OwlCore.Wpf"
|
||||
mc:Ignorable="d"
|
||||
Title="Options" Height="475" Width="800"
|
||||
Title="Options" Height="400" Width="700"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Foreground="White">
|
||||
<Window.Resources>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using OwlCore.AbstractUI.Models;
|
||||
using OwlCore.AbstractUI.ViewModels;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace ZuneModdingHelper
|
||||
{
|
||||
@@ -9,6 +12,25 @@ namespace ZuneModdingHelper
|
||||
/// </summary>
|
||||
public partial class AbstractUIGroupDialog : Window
|
||||
{
|
||||
[LibraryImport("DwmApi")]
|
||||
private static partial int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);
|
||||
|
||||
protected override void OnSourceInitialized(EventArgs e)
|
||||
{
|
||||
base.OnSourceInitialized(e);
|
||||
|
||||
// TODO: Move this entire control into a proper dialog.
|
||||
var isAtLeastWin10 = Environment.OSVersion.Version > new Version(10, 0);
|
||||
if (isAtLeastWin10)
|
||||
{
|
||||
var handle = new WindowInteropHelper(this).EnsureHandle();
|
||||
|
||||
if (DwmSetWindowAttribute(handle, 19, [1], 4) != 0)
|
||||
_ = DwmSetWindowAttribute(handle, 20, [1], 4);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public AbstractUIGroupDialog(AbstractUICollectionViewModel viewModel)
|
||||
{
|
||||
ViewModel = viewModel;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<Platforms>x64;x86</Platforms>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ApplicationIcon>Assets\ZMH_Icon.ico</ApplicationIcon>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user