mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[Settings] Added disabled state to FZ preview control (#15166)
* Added Disabled state * Added wallpaper image to installer file
This commit is contained in:
@@ -34,6 +34,11 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private void FancyZonesPreviewControl_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
SetEnabledState();
|
||||
}
|
||||
|
||||
public bool IsSystemTheme
|
||||
{
|
||||
get { return (bool)GetValue(IsSystemThemeProperty); }
|
||||
@@ -48,7 +53,7 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
||||
set { SetValue(WallpaperPathProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty WallpaperPathProperty = DependencyProperty.Register("WallpaperPath", typeof(string), typeof(FancyZonesPreviewControl), new PropertyMetadata("ms-appx:///Assets/wallpaper_placeholder.png"));
|
||||
public static readonly DependencyProperty WallpaperPathProperty = DependencyProperty.Register("WallpaperPath", typeof(string), typeof(FancyZonesPreviewControl), new PropertyMetadata("ms-appx:///Assets/Modules/Wallpaper.png"));
|
||||
|
||||
public Color CustomBorderColor
|
||||
{
|
||||
@@ -139,5 +144,17 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
||||
Zone2Number.Foreground = numberBrush;
|
||||
Zone3Number.Foreground = numberBrush;
|
||||
}
|
||||
|
||||
private void SetEnabledState()
|
||||
{
|
||||
VisualStateManager.GoToState(this, IsEnabled ? "Normal" : "Disabled", true);
|
||||
}
|
||||
|
||||
private void FancyZonesPreviewControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IsEnabledChanged -= FancyZonesPreviewControl_IsEnabledChanged;
|
||||
SetEnabledState();
|
||||
IsEnabledChanged += FancyZonesPreviewControl_IsEnabledChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user