Skip to content

Commit

Permalink
Added tooltips in Color Window (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Aug 17, 2024
1 parent f5e4b87 commit 891d0df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
18 changes: 15 additions & 3 deletions ColorPicker/Windows/ColorDetailsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@
MouseEnter="PinBtn_MouseEnter"
MouseLeave="PinBtn_MouseLeave"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarButtonStyle}" />
Style="{StaticResource TitleBarButtonStyle}">
<Button.ToolTip>
<ToolTip x:Name="PinTooltip" Content="{x:Static lang:Resources.Pin}" />
</Button.ToolTip>
</Button>
<Button
x:Name="MinimizeBtn"
Grid.Column="2"
Expand All @@ -153,7 +157,11 @@
MouseEnter="PinBtn_MouseEnter"
MouseLeave="PinBtn_MouseLeave"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarButtonStyle}" />
Style="{StaticResource TitleBarButtonStyle}">
<Button.ToolTip>
<ToolTip Content="{x:Static lang:Resources.Minimize}" />
</Button.ToolTip>
</Button>
<Button
x:Name="CloseBtn"
Grid.Column="4"
Expand All @@ -165,7 +173,11 @@
FontFamily="/Fonts/#FluentSystemIcons-Regular"
FontSize="14"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarCloseButtonStyle}" />
Style="{StaticResource TitleBarCloseButtonStyle}">
<Button.ToolTip>
<ToolTip Content="{x:Static lang:Resources.Close}" />
</Button.ToolTip>
</Button>
</Grid>
</Border>
<Border
Expand Down
5 changes: 4 additions & 1 deletion ColorPicker/Windows/ColorDetailsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ private void InitUI()
XyzTxt.Text = $"{ColorInfo.XYZ.X}; {ColorInfo.XYZ.Y}; {ColorInfo.XYZ.Z}";
YiqTxt.Text = $"{ColorInfo.YIQ.Y}; {ColorInfo.YIQ.I}; {ColorInfo.YIQ.Q}";
YuvTxt.Text = $"{ColorInfo.YUV.Y}; {ColorInfo.YUV.U}; {ColorInfo.YUV.V}";

PinTooltip.Content = Topmost ? Properties.Resources.Unpin : Properties.Resources.Pin;
}

public static bool IsColorDark(int red, int green, int blue)
Expand Down Expand Up @@ -183,7 +185,8 @@ private void PinBtn_Click(object sender, RoutedEventArgs e)
isPinned = !isPinned;
Topmost = isPinned;
PinBtn.Content = isPinned ? "\uF604" : "\uF602";
}
PinTooltip.Content = isPinned ? Properties.Resources.Unpin : Properties.Resources.Pin;
}

private void PinBtn_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
{
Expand Down

0 comments on commit 891d0df

Please sign in to comment.