mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Updated accent color (#10257)
Co-authored-by: Niels Laute <niels9001@hotmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ namespace FancyZonesEditor
|
|||||||
private const string ObjectDependencyID = "IsSelected";
|
private const string ObjectDependencyID = "IsSelected";
|
||||||
private const string GridZoneBackgroundBrushID = "GridZoneBackgroundBrush";
|
private const string GridZoneBackgroundBrushID = "GridZoneBackgroundBrush";
|
||||||
private const string SecondaryForegroundBrushID = "SecondaryForegroundBrush";
|
private const string SecondaryForegroundBrushID = "SecondaryForegroundBrush";
|
||||||
|
private const string AccentColorBrushID = "SystemControlBackgroundAccentBrush";
|
||||||
|
|
||||||
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(ObjectDependencyID, typeof(bool), typeof(GridZone), new PropertyMetadata(false, OnSelectionChanged));
|
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(ObjectDependencyID, typeof(bool), typeof(GridZone), new PropertyMetadata(false, OnSelectionChanged));
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
private void OnSelectionChanged()
|
private void OnSelectionChanged()
|
||||||
{
|
{
|
||||||
Background = IsSelected ? SystemParameters.WindowGlassBrush : App.Current.Resources[GridZoneBackgroundBrushID] as SolidColorBrush;
|
Background = IsSelected ? Application.Current.Resources[AccentColorBrushID] as SolidColorBrush : Application.Current.Resources[GridZoneBackgroundBrushID] as SolidColorBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsSelected
|
public bool IsSelected
|
||||||
@@ -65,7 +66,7 @@ namespace FancyZonesEditor
|
|||||||
OnSelectionChanged();
|
OnSelectionChanged();
|
||||||
_splitter = new Rectangle
|
_splitter = new Rectangle
|
||||||
{
|
{
|
||||||
Fill = SystemParameters.WindowGlassBrush,
|
Fill = Application.Current.Resources[AccentColorBrushID] as SolidColorBrush,
|
||||||
};
|
};
|
||||||
Body.Children.Add(_splitter);
|
Body.Children.Add(_splitter);
|
||||||
|
|
||||||
@@ -139,8 +140,8 @@ namespace FancyZonesEditor
|
|||||||
enabled = _canSplit(Orientation.Horizontal, _snappedPositionY);
|
enabled = _canSplit(Orientation.Horizontal, _snappedPositionY);
|
||||||
}
|
}
|
||||||
|
|
||||||
Brush disabledBrush = App.Current.Resources[SecondaryForegroundBrushID] as SolidColorBrush;
|
Brush disabledBrush = Application.Current.Resources[SecondaryForegroundBrushID] as SolidColorBrush;
|
||||||
Brush enabledBrush = SystemParameters.WindowGlassBrush; // Active Accent color
|
Brush enabledBrush = Application.Current.Resources[AccentColorBrushID] as SolidColorBrush;
|
||||||
_splitter.Fill = enabled ? enabledBrush : disabledBrush;
|
_splitter.Fill = enabled ? enabledBrush : disabledBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +149,7 @@ namespace FancyZonesEditor
|
|||||||
{
|
{
|
||||||
_hovering = true;
|
_hovering = true;
|
||||||
UpdateSplitter();
|
UpdateSplitter();
|
||||||
_splitter.Fill = SystemParameters.WindowGlassBrush;
|
_splitter.Fill = Application.Current.Resources[AccentColorBrushID] as SolidColorBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseLeave(MouseEventArgs e)
|
protected override void OnMouseLeave(MouseEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user