fixed a bug of BlurWindow
This commit is contained in:
1 parent
05fa5719a3
commit
7417a1715b
5 files changed
+16
-4
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
|
||||
@@ -30,6 +31,10 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
var colorValue = ResourceHelper.GetResource<uint>(ResourceToken.BlurGradientValue);
|
||||
var color = ColorHelper.ToColor(colorValue);
|
||||
color = Color.FromRgb(color.R, color.G, color.B);
|
||||
window.Background = new SolidColorBrush(color);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Windows.Media;
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
@@ -9,5 +10,11 @@ namespace HandyControl.Tools
|
||||
private const int Win32BlueShift = 16;
|
||||
|
||||
public static int ToWin32(Color c) => c.R << Win32RedShift | c.G << Win32GreenShift | c.B << Win32BlueShift;
|
||||
|
||||
public static Color ToColor(uint c)
|
||||
{
|
||||
var bytes = BitConverter.GetBytes(c);
|
||||
return Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace HandyControlDemo.Data
|
||||
{
|
||||
public static string SavePath = $"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json";
|
||||
|
||||
public string Lang { get; set; } = "cn";
|
||||
public string Lang { get; set; } = "zh-cn";
|
||||
|
||||
public SkinType Skin { get; set; }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
x:Class="HandyControlDemo.UserControl.LeftMainContent"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
Background="Transparent"
|
||||
Background="{Binding Background,RelativeSource={RelativeSource FindAncestor,AncestorType=Window}}"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Button.Click="ButtonLangs_OnClick" Margin="10,10,0,10">
|
||||
<Button Tag="cn" Style="{StaticResource ButtonCustom}">
|
||||
<Button Tag="zh-cn" Style="{StaticResource ButtonCustom}">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/cn.png"/>
|
||||
</Button>
|
||||
<Button Tag="en" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
|
||||
Reference in new issue
Block a user