UI tweaks, mid fan support

This commit is contained in:
seerge
2023-03-21 13:14:53 +01:00
parent cdb633be04
commit 9ff572b8f6
11 changed files with 102 additions and 63 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.Win32;
using GHelper;
using Microsoft.Win32;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
@@ -19,7 +20,7 @@ namespace CustomControls
[DllImport("DwmApi")] //System.Runtime.InteropServices
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);
public bool darkTheme = false;
public bool darkTheme;
private static bool IsDarkTheme()
{
@@ -39,8 +40,12 @@ namespace CustomControls
if (setDPI)
ControlHelper.Resize(this);
DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
ControlHelper.Adjust(this, darkTheme, changed);
if (changed)
{
DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
ControlHelper.Adjust(this, darkTheme, changed);
}
}
}
@@ -235,13 +240,18 @@ namespace CustomControls
{
//Fields
private int borderSize = 5;
private int borderRadius = 5;
private bool activated = false;
private bool secondary = false;
public int BorderRadius
{
get { return borderRadius; }
set
{
borderRadius = value;
}
}
private Color borderColor = Color.Transparent;
public Color BorderColor
{
get { return borderColor; }
@@ -252,6 +262,7 @@ namespace CustomControls
}
private bool activated = false;
public bool Activated
{
get { return activated; }
@@ -264,6 +275,7 @@ namespace CustomControls
}
}
private bool secondary = false;
public bool Secondary
{
get { return secondary; }