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