Skip to content

Commit

Permalink
Added new hover effects in "Details" window (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Peyronnet committed May 5, 2024
1 parent c9d7055 commit c532266
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ColorPicker/Windows/ColorDetailsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
RecognizesAccessKey="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{DynamicResource WindowButtonsHover1}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{DynamicResource WindowButtonsPressed1}" />
</Trigger>
Expand Down Expand Up @@ -139,6 +136,8 @@
Content="&#xF602;"
FontFamily="/Fonts/#FluentSystemIcons-Regular"
FontSize="14"
MouseEnter="PinBtn_MouseEnter"
MouseLeave="PinBtn_MouseLeave"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarButtonStyle}" />
<Button
Expand All @@ -151,6 +150,8 @@
Content="&#xFC75;"
FontFamily="/Fonts/#FluentSystemIcons-Regular"
FontSize="14"
MouseEnter="PinBtn_MouseEnter"
MouseLeave="PinBtn_MouseLeave"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarButtonStyle}" />
<Button
Expand Down
11 changes: 11 additions & 0 deletions ColorPicker/Windows/ColorDetailsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private void InitUI()
CopyYuvBtn.Background = bgBtn;

MinimizeBtn.Foreground = bgBtn;
PinBtn.Foreground = bgBtn;
CloseBtn.Foreground = bgBtn;

CopyRgbBtn.Foreground = BackgroundSolidBrush;
Expand Down Expand Up @@ -183,4 +184,14 @@ private void PinBtn_Click(object sender, RoutedEventArgs e)
Topmost = isPinned;
PinBtn.Content = isPinned ? "\uF604" : "\uF602";
}

private void PinBtn_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
{
((Button)sender).Background = HoverForegroundSolidBrush;
}

private void PinBtn_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
{
((Button)sender).Background = null;
}
}

0 comments on commit c532266

Please sign in to comment.