Skip to content

Commit 156668e

Browse files
committed
Add minimize & background option for progress box ex
1 parent 54a49d6 commit 156668e

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
<system:String x:Key="commonOK">OK</system:String>
368368
<system:String x:Key="commonYes">Yes</system:String>
369369
<system:String x:Key="commonNo">No</system:String>
370+
<system:String x:Key="commonBackground">Background</system:String>
370371

371372
<!-- Crash Reporter -->
372373
<system:String x:Key="reportWindow_version">Version</system:String>

Flow.Launcher/ProgressBoxEx.xaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,32 @@
3535
<Grid.ColumnDefinitions>
3636
<ColumnDefinition Width="*" />
3737
<ColumnDefinition Width="Auto" />
38+
<ColumnDefinition Width="Auto" />
3839
</Grid.ColumnDefinitions>
3940
<Button
4041
Grid.Column="1"
42+
Click="Button_Minimize"
43+
RenderOptions.EdgeMode="Aliased"
44+
Style="{DynamicResource TitleBarCloseButtonStyle}">
45+
<Path
46+
Width="46"
47+
Height="32"
48+
Data="M 18,15 H 28"
49+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
50+
StrokeThickness="1">
51+
<Path.Style>
52+
<Style TargetType="Path">
53+
<Style.Triggers>
54+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
55+
<Setter Property="Opacity" Value="0.5" />
56+
</DataTrigger>
57+
</Style.Triggers>
58+
</Style>
59+
</Path.Style>
60+
</Path>
61+
</Button>
62+
<Button
63+
Grid.Column="2"
4164
Click="Button_Cancel"
4265
Style="{StaticResource TitleBarCloseButtonStyle}">
4366
<Path
@@ -94,11 +117,17 @@
94117
HorizontalAlignment="Center"
95118
VerticalAlignment="Center"
96119
Orientation="Horizontal">
120+
<Button
121+
x:Name="btnBackground"
122+
MinWidth="120"
123+
Margin="5 0 5 0"
124+
Click="Button_Background"
125+
Content="{DynamicResource commonBackground}" />
97126
<Button
98127
x:Name="btnCancel"
99128
MinWidth="120"
100129
Margin="5 0 5 0"
101-
Click="Button_Click"
130+
Click="Button_Cancel"
102131
Content="{DynamicResource commonCancel}" />
103132
</WrapPanel>
104133
</Border>

Flow.Launcher/ProgressBoxEx.xaml.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,19 @@ private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
9595
ForceClose();
9696
}
9797

98-
private void Button_Click(object sender, RoutedEventArgs e)
98+
private void Button_Cancel(object sender, RoutedEventArgs e)
9999
{
100100
ForceClose();
101101
}
102102

103-
private void Button_Cancel(object sender, RoutedEventArgs e)
103+
private void Button_Minimize(object sender, RoutedEventArgs e)
104104
{
105-
ForceClose();
105+
WindowState = WindowState.Minimized;
106+
}
107+
108+
private void Button_Background(object sender, RoutedEventArgs e)
109+
{
110+
Hide();
106111
}
107112

108113
private void ForceClose()

0 commit comments

Comments
 (0)