Skip to content

Commit

Permalink
Added the possibility to pin "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 a8f8991 commit c9d7055
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ColorPicker/Windows/ColorDetailsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
x:Name="PinBtn"
Grid.Column="1"
Width="46"
Height="32"
Background="Transparent"
Click="PinBtn_Click"
Content="&#xF602;"
FontFamily="/Fonts/#FluentSystemIcons-Regular"
FontSize="14"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarButtonStyle}" />
<Button
x:Name="MinimizeBtn"
Grid.Column="2"
Expand Down
8 changes: 8 additions & 0 deletions ColorPicker/Windows/ColorDetailsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,12 @@ private void CopyDecBtn_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText(DecTxt.Text);
}

bool isPinned = false;
private void PinBtn_Click(object sender, RoutedEventArgs e)
{
isPinned = !isPinned;
Topmost = isPinned;
PinBtn.Content = isPinned ? "\uF604" : "\uF602";
}
}

0 comments on commit c9d7055

Please sign in to comment.