mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
*forgot to stage files on last commit
This commit is contained in:
@@ -53,10 +53,11 @@ namespace Wox.Core.Theme
|
||||
}
|
||||
}
|
||||
|
||||
UserSettingStorage.Instance.Theme = themeName;
|
||||
UserSettingStorage.Instance.Save();
|
||||
|
||||
ResourceMerger.ApplyThemeResource(this);
|
||||
|
||||
UserSettingStorage.Instance.Theme = themeName;
|
||||
UserSettingStorage.Instance.ThemeAccentMode = (int)Application.Current.Resources["WindowsAccentMode"];
|
||||
UserSettingStorage.Instance.Save();
|
||||
}
|
||||
|
||||
public ResourceDictionary GetResourceDictionary()
|
||||
@@ -89,7 +90,6 @@ namespace Wox.Core.Theme
|
||||
Setter[] setters = new Setter[] { fontFamily, fontStyle, fontWeight, fontStretch };
|
||||
Array.ForEach(new Style[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ namespace Wox.Core.UserSettings
|
||||
[JsonProperty]
|
||||
public string ResultItemFontStretch { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public int ThemeAccentMode { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public double WindowLeft { get; set; }
|
||||
|
||||
@@ -117,6 +120,8 @@ namespace Wox.Core.UserSettings
|
||||
get { return "config"; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void IncreaseActivateTimes()
|
||||
{
|
||||
ActivateTimes++;
|
||||
|
||||
@@ -121,13 +121,13 @@ namespace Wox.Helper
|
||||
}
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
|
||||
public static void EnableBlur(Window wind)
|
||||
public static void SetWindowAccent(Window wind, int themeAccentMode)
|
||||
{
|
||||
if (themeAccentMode < 0 || themeAccentMode > 3)
|
||||
themeAccentMode = 0;
|
||||
var windowHelper = new WindowInteropHelper(wind);
|
||||
|
||||
var accent = new AccentPolicy();
|
||||
accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND;
|
||||
accent.GradientColor = 16711680;
|
||||
accent.AccentState = (AccentState) themeAccentMode;
|
||||
var accentStructSize = Marshal.SizeOf(accent);
|
||||
|
||||
var accentPtr = Marshal.AllocHGlobal(accentStructSize);
|
||||
|
||||
@@ -460,6 +460,7 @@ namespace Wox
|
||||
Dispatcher.DelayInvoke("delayChangeTheme", () =>
|
||||
{
|
||||
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
WindowIntelopHelper.SetWindowAccent(MainWindow, UserSettingStorage.Instance.ThemeAccentMode);
|
||||
}, TimeSpan.FromMilliseconds(100));
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,10 @@
|
||||
<Setter Property="Stroke" Value="Blue" />
|
||||
</Style>
|
||||
|
||||
<!-- Windows Accent Mode: 0 - none, 1 - Accent color, 2 - Accent with transparency, 3 - Blur -->
|
||||
<system:Int32 x:Key="WindowsAccentMode">0</system:Int32>
|
||||
|
||||
|
||||
<!-- Item Style -->
|
||||
<Style x:Key="BaseItemTitleStyle" TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="#FFFFF8" />
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
|
||||
</Style>
|
||||
|
||||
|
||||
|
||||
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
|
||||
</Style>
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<ResourceDictionary Source="Base.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- Windows Accent Mode: 0 - none, 1 - Accent color, 2 - Accent with transparency, 3 - Blur -->
|
||||
<system:Int32 x:Key="WindowsAccentMode">3</system:Int32>
|
||||
|
||||
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
</Style>
|
||||
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
<ResourceDictionary Source="Base.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- Windows Accent Mode: 0 - none, 1 - Accent color, 2 - Accent with transparency, 3 - Blur -->
|
||||
<system:Int32 x:Key="WindowsAccentMode">3</system:Int32>
|
||||
|
||||
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Background" Value="#FFBBBBBB"></Setter>
|
||||
<Setter Property="Background" Value="Transparent"></Setter>
|
||||
<Setter Property="Foreground" Value="Black"></Setter>
|
||||
<Setter Property="FontFamily" Value="Helvetica"/>
|
||||
<Setter Property="FontSize" Value="32"/>
|
||||
@@ -50,7 +53,7 @@
|
||||
<Setter Property="Foreground" Value="#656565"></Setter>
|
||||
<Setter Property="FontFamily" Value="Helvetica"/>
|
||||
</Style>
|
||||
<Color x:Key="ItemSelectedBackgroundColor">#FFBBBBBB</Color>
|
||||
<Color x:Key="ItemSelectedBackgroundColor">Transparent</Color>
|
||||
|
||||
<!-- button style in the middle of the scrollbar -->
|
||||
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
|
||||
|
||||
@@ -258,6 +258,11 @@
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Page Include="Themes\Accent.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Themes\SimpleBlur.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -266,6 +271,7 @@
|
||||
<Page Include="Themes\Test.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="WoxUpdate.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
Reference in New Issue
Block a user