-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
167 lines (159 loc) · 8.15 KB
/
Copy pathMainWindow.xaml
File metadata and controls
167 lines (159 loc) · 8.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<Window x:Class="PresentationPrompter.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="PresentationPrompter"
Icon="提示.png"
WindowStyle="None"
AllowsTransparency="True"
ResizeMode="CanResizeWithGrip"
Background="Transparent"
MinWidth="400" MinHeight="80"
Topmost="True"
Activated="Window_Activated"
Deactivated="Window_Deactivated"
KeyDown="Window_KeyDown"
PreviewMouseWheel="Window_PreviewMouseWheel"
Loaded="Window_Loaded"
Closing="Window_Closing">
<Window.Resources>
<SolidColorBrush x:Key="ButtonHoverBg" Color="#EDE4CC"/>
<SolidColorBrush x:Key="ButtonPressedBg" Color="#DDD4BC"/>
<SolidColorBrush x:Key="ButtonFg" Color="#333333"/>
<SolidColorBrush x:Key="ButtonBorder" Color="#D4C5A0"/>
<SolidColorBrush x:Key="NavButtonFg" Color="#333333"/>
<Style x:Key="ActionButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonFg}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="14,4"/>
<Setter Property="Margin" Value="3,0"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonHoverBg}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonPressedBg}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="NavButton" TargetType="Button" BasedOn="{StaticResource ActionButton}">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{DynamicResource NavButtonFg}"/>
<Setter Property="Padding" Value="20,4"/>
</Style>
</Window.Resources>
<Border x:Name="MainBorder"
Background="#FFF9E6"
CornerRadius="8"
BorderBrush="#D4C5A0"
BorderThickness="1"
MouseLeftButtonDown="MainBorder_MouseLeftButtonDown">
<Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.2"/>
</Border.Effect>
<Grid Margin="16,10,16,6">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Title bar -->
<DockPanel Grid.Row="0" Margin="0,0,0,6">
<TextBlock x:Name="TitleText"
DockPanel.Dock="Left"
Text="PresentationPrompter"
FontSize="11"
Foreground="#999"
FontFamily="Microsoft YaHei"/>
<Button x:Name="TitleCloseBtn" DockPanel.Dock="Right"
Content="✕"
Click="Close_Click"
Width="24" Height="20"
FontSize="11"
FontFamily="Microsoft YaHei"
Foreground="#999"
Background="Transparent"
BorderThickness="0"
Cursor="Hand"
VerticalAlignment="Top"
Margin="4,-6,-6,0"
Padding="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}"
Padding="0" CornerRadius="0,6,0,0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E81123"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<TextBlock x:Name="ProgressText"
DockPanel.Dock="Right"
Text=""
FontSize="11"
Foreground="#BBB"
FontFamily="Microsoft YaHei"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0,0,4,0"/>
</DockPanel>
<!-- Step text -->
<TextBox x:Name="StepText"
Grid.Row="1"
Text="加载中..."
FontSize="26"
FontFamily="Microsoft YaHei"
TextWrapping="Wrap"
VerticalAlignment="Center"
Margin="0,0,0,8"
BorderThickness="0"
Background="#01000000"
AcceptsReturn="False"
CaretBrush="{Binding Foreground, RelativeSource={RelativeSource Self}}"
TextChanged="StepText_TextChanged"/>
<!-- Button bar -->
<Border x:Name="ButtonBar"
Grid.Row="2"
Background="#F5EDD6"
CornerRadius="4"
Padding="8,5"
Margin="-10,0,-10,-4">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="TopmostBtn" Content="取消置顶" Click="Topmost_Click" Style="{StaticResource ActionButton}"/>
<Button Content="打开" Click="Open_Click" Style="{StaticResource ActionButton}"/>
<Button Content="上一步" Click="Prev_Click" Style="{StaticResource ActionButton}"/>
<Button Content="下一步" Click="Next_Click" Style="{StaticResource NavButton}"/>
<Button x:Name="RunBtn" Content="执行" Click="Run_Click" Style="{StaticResource ActionButton}" Visibility="Collapsed"/>
<Button x:Name="SaveBtn" Content="保存" Click="Save_Click" Style="{StaticResource ActionButton}" Visibility="Collapsed"/>
<Button Content="编辑" Click="EditStep_Click" Style="{StaticResource ActionButton}"/>
<Button Content="设置" Click="Settings_Click" Style="{StaticResource ActionButton}"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Window>