Add minimize & background option for progress box ex

This commit is contained in:
Jack251970 2025-02-22 16:12:41 +08:00
parent 54a49d68f3
commit 156668e109
3 changed files with 39 additions and 4 deletions

View file

@ -367,6 +367,7 @@
<system:String x:Key="commonOK">OK</system:String>
<system:String x:Key="commonYes">Yes</system:String>
<system:String x:Key="commonNo">No</system:String>
<system:String x:Key="commonBackground">Background</system:String>
<!-- Crash Reporter -->
<system:String x:Key="reportWindow_version">Version</system:String>

View file

@ -35,9 +35,32 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Click="Button_Minimize"
RenderOptions.EdgeMode="Aliased"
Style="{DynamicResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,15 H 28"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
<Button
Grid.Column="2"
Click="Button_Cancel"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
@ -94,11 +117,17 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="btnBackground"
MinWidth="120"
Margin="5 0 5 0"
Click="Button_Background"
Content="{DynamicResource commonBackground}" />
<Button
x:Name="btnCancel"
MinWidth="120"
Margin="5 0 5 0"
Click="Button_Click"
Click="Button_Cancel"
Content="{DynamicResource commonCancel}" />
</WrapPanel>
</Border>

View file

@ -95,14 +95,19 @@ namespace Flow.Launcher
ForceClose();
}
private void Button_Click(object sender, RoutedEventArgs e)
private void Button_Cancel(object sender, RoutedEventArgs e)
{
ForceClose();
}
private void Button_Cancel(object sender, RoutedEventArgs e)
private void Button_Minimize(object sender, RoutedEventArgs e)
{
ForceClose();
WindowState = WindowState.Minimized;
}
private void Button_Background(object sender, RoutedEventArgs e)
{
Hide();
}
private void ForceClose()