Skip to content

Commit df9ddb0

Browse files
committed
Add Custom TitleBar
1 parent 3785a90 commit df9ddb0

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

Flow.Launcher/WelcomeWindow.xaml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,75 @@
99
Title="Welcome to Flow Launcher"
1010
Width="550"
1111
Height="650"
12+
Background="{DynamicResource PopuBGColor}"
13+
Foreground="{DynamicResource PopupTextColor}"
14+
ResizeMode="NoResize"
1215
WindowStartupLocation="CenterScreen"
1316
mc:Ignorable="d">
14-
<Grid />
17+
<WindowChrome.WindowChrome>
18+
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
19+
</WindowChrome.WindowChrome>
20+
<Grid>
21+
<Grid.RowDefinitions>
22+
<RowDefinition />
23+
<RowDefinition Height="80" />
24+
</Grid.RowDefinitions>
25+
<StackPanel Grid.Row="0">
26+
<StackPanel>
27+
<Grid>
28+
<Grid.ColumnDefinitions>
29+
<ColumnDefinition Width="Auto" />
30+
<ColumnDefinition Width="*" />
31+
<ColumnDefinition Width="Auto" />
32+
<ColumnDefinition Width="Auto" />
33+
<ColumnDefinition Width="Auto" />
34+
</Grid.ColumnDefinitions>
35+
<Image
36+
Grid.Column="0"
37+
Width="16"
38+
Height="16"
39+
Margin="10,4,4,4"
40+
RenderOptions.BitmapScalingMode="HighQuality"
41+
Source="/Images/app.png" />
42+
<TextBlock
43+
Grid.Column="1"
44+
Margin="4,0,0,0"
45+
VerticalAlignment="Center"
46+
FontSize="12"
47+
Foreground="{DynamicResource Color05B}"
48+
Text="Welcome to Flow Launcher" />
49+
50+
<Button
51+
Grid.Column="4"
52+
Click="BtnCancel_OnClick"
53+
Style="{StaticResource TitleBarCloseButtonStyle}">
54+
<Path
55+
Width="46"
56+
Height="32"
57+
Data="M 18,11 27,20 M 18,20 27,11"
58+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
59+
StrokeThickness="1">
60+
<Path.Style>
61+
<Style TargetType="Path">
62+
<Style.Triggers>
63+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
64+
<Setter Property="Opacity" Value="0.5" />
65+
</DataTrigger>
66+
</Style.Triggers>
67+
</Style>
68+
</Path.Style>
69+
</Path>
70+
</Button>
71+
</Grid>
72+
</StackPanel>
73+
<StackPanel Margin="26,12,26,0" />
74+
</StackPanel>
75+
<Border
76+
Grid.Row="1"
77+
Background="{DynamicResource PopupButtonAreaBGColor}"
78+
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
79+
BorderThickness="0,1,0,0">
80+
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" />
81+
</Border>
82+
</Grid>
1583
</Window>

Flow.Launcher/WelcomeWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,10 @@ public WelcomeWindow()
2323
{
2424
InitializeComponent();
2525
}
26+
27+
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
28+
{
29+
Close();
30+
}
2631
}
2732
}

0 commit comments

Comments
 (0)