mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-24 02:00:55 +08:00
Separate TopMost and Pin buttons
This commit is contained in:
@@ -110,17 +110,33 @@
|
||||
</TextBlock>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button DockPanel.Dock="Left" x:Name="buttonTop" Tag="Auto">
|
||||
<Button.Resources>
|
||||
<Grid x:Key="ContentTop">
|
||||
<TextBlock></TextBlock>
|
||||
<TextBlock></TextBlock>
|
||||
</Grid>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
|
||||
<Setter Property="Content" Value="" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Tag" Value="Auto">
|
||||
<Setter Property="Content" Value="" />
|
||||
</Trigger>
|
||||
<Trigger Property="Tag" Value="Top">
|
||||
<Setter Property="Content" Value="{StaticResource ContentTop}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button DockPanel.Dock="Left" x:Name="buttonPin" Tag="Auto">
|
||||
<Button.Resources>
|
||||
<Grid x:Key="ContentPin">
|
||||
<TextBlock></TextBlock>
|
||||
<TextBlock></TextBlock>
|
||||
</Grid>
|
||||
<Grid x:Key="ContentPinTop">
|
||||
<TextBlock></TextBlock>
|
||||
<TextBlock></TextBlock>
|
||||
<TextBlock></TextBlock>
|
||||
</Grid>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
|
||||
@@ -129,9 +145,6 @@
|
||||
<Trigger Property="Tag" Value="Auto">
|
||||
<Setter Property="Content" Value="" />
|
||||
</Trigger>
|
||||
<Trigger Property="Tag" Value="PinTop">
|
||||
<Setter Property="Content" Value="{StaticResource ContentPinTop}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Tag" Value="Pin">
|
||||
<Setter Property="Content" Value="{StaticResource ContentPin}" />
|
||||
</Trigger>
|
||||
|
||||
@@ -63,14 +63,17 @@ namespace QuickLook
|
||||
|
||||
windowFrameContainer.PreviewMouseMove += ShowWindowCaptionContainer;
|
||||
|
||||
buttonTop.Click += (sender, e) =>
|
||||
{
|
||||
Topmost = !Topmost;
|
||||
buttonTop.Tag = Topmost ? "Top" : "Auto";
|
||||
};
|
||||
|
||||
buttonPin.Click += (sender, e) =>
|
||||
{
|
||||
if (Pinned)
|
||||
{
|
||||
Topmost = !Topmost;
|
||||
buttonPin.Tag = Topmost ? "PinTop" : "Pin";
|
||||
return;
|
||||
}
|
||||
|
||||
Pinned = true;
|
||||
buttonPin.Tag = "Pin";
|
||||
ViewWindowManager.GetInstance().ForgetCurrentWindow();
|
||||
|
||||
Reference in New Issue
Block a user