Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Files.App.Controls/ThemedIcon/ThemedIcon.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ protected virtual void OnOutlineIconPropertyChanged(string oldValue, string newV
protected virtual void OnColorPropertyChanged(Brush oldValue, Brush newValue)
{
OnIconTypeChanged();
UpdateColor(newValue);
}

protected virtual void OnIconTypePropertyChanged(ThemedIconTypes oldValue, ThemedIconTypes newValue)
Expand Down
9 changes: 9 additions & 0 deletions src/Files.App.Controls/ThemedIcon/ThemedIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,14 @@ private void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArg
{
UpdateVisualStates();
}

private void UpdateColor(Brush newColor)
{
if (GetTemplateChild(OutlineIconPath) is Path outlinePath)
outlinePath.Fill = newColor;

if (GetTemplateChild(FilledIconPath) is Path fillPath)
fillPath.Fill = newColor;
}
}
}
4 changes: 2 additions & 2 deletions src/Files.App.Controls/ThemedIcon/ThemedIcon.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
</VisualState>
<VisualState x:Name="Custom">
<VisualState.Setters>
<Setter Target="PART_OutlinePath.Fill" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Color}" />
<Setter Target="PART_FilledPath.Fill" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Color}" />
<Setter Target="PART_OutlinePath.Fill" Value="{Binding Color, Mode=OneTime}" />
<Setter Target="PART_FilledPath.Fill" Value="{Binding Color, Mode=OneTime}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Toggle">
Expand Down