|
16 | 16 | mc:Ignorable="d" |
17 | 17 | Style="{DynamicResource DefaultWindow}" |
18 | 18 | MinWidth="800" Width="1024" Height="768" MinHeight="600" |
19 | | - SaveWindowPosition="True" TitleAlignment="Center" |
| 19 | + SaveWindowPosition="True" TitleAlignment="Left" |
20 | 20 | ContentRendered="MetroMainWindow_ContentRendered" StateChanged="MetroWindowMain_StateChanged" |
21 | 21 | Activated="MetroMainWindow_Activated" Closing="MetroWindowMain_Closing" |
22 | 22 | d:DataContext="{d:DesignInstance networkManager:MainWindow}"> |
|
26 | 26 | <converters:ApplicationNameToTranslatedStringConverter x:Key="ApplicationNameToTranslatedStringConverter" /> |
27 | 27 | <converters:ApplicationNameToIconConverter x:Key="ApplicationNameToIconConverter" /> |
28 | 28 | <converters:IntZeroToVisibilityCollapsedConverter x:Key="IntZeroToVisibilityCollapsedConverter" /> |
| 29 | + <converters:BooleanReverseToVisibilityCollapsedConverter x:Key="BooleanReverseToVisibilityCollapsedConverter"/> |
29 | 30 | <!-- ReSharper disable once Xaml.RedundantResource - Used in TrayIcon --> |
30 | 31 | <ContextMenu x:Key="ContextMenuNotifyIcon" MinWidth="200" Opened="ContextMenu_Opened" x:Shared="False"> |
31 | 32 | <MenuItem Header="{x:Static localization:Strings.Show}" Command="{Binding ShowWindowCommand}"> |
|
66 | 67 | </MenuItem> |
67 | 68 | </ContextMenu> |
68 | 69 | </mah:MetroWindow.Resources> |
69 | | - <mah:MetroWindow.TitleTemplate> |
70 | | - <DataTemplate> |
71 | | - <Grid |
72 | | - Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type mah:MetroWindow}}, Path=ActualWidth}"> |
73 | | - <TextBlock Grid.Column="0" Grid.Row="0" |
74 | | - Margin="8,-1,1,0" |
75 | | - VerticalAlignment="Center" |
76 | | - HorizontalAlignment="Left" |
77 | | - FontFamily="{DynamicResource MahApps.Fonts.Family.Window.Title}" |
78 | | - FontSize="{DynamicResource MahApps.Font.Size.Window.Title}" |
79 | | - Text="{TemplateBinding Content}" |
80 | | - TextTrimming="CharacterEllipsis" /> |
81 | | - <Button Grid.Column="0" Grid.Row="0" |
82 | | - Command="{Binding OpenRunCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" |
83 | | - VerticalAlignment="Center" |
84 | | - HorizontalAlignment="Center" |
85 | | - Cursor="Hand" |
86 | | - Style="{StaticResource CleanButton}"> |
87 | | - <Grid Height="30"> |
88 | | - <Grid.ColumnDefinitions> |
89 | | - <ColumnDefinition Width="Auto" /> |
90 | | - <ColumnDefinition Width="270" /> |
91 | | - </Grid.ColumnDefinitions> |
92 | | - <Rectangle Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" |
93 | | - Fill="{DynamicResource MahApps.Brushes.Gray10}" /> |
94 | | - <Rectangle Grid.Column="0" Grid.Row="0" |
95 | | - Margin="5,0" |
96 | | - Width="20" Height="20" |
97 | | - HorizontalAlignment="Right" |
98 | | - Fill="{DynamicResource MahApps.Brushes.Gray8}"> |
99 | | - <Rectangle.OpacityMask> |
100 | | - <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" /> |
101 | | - </Rectangle.OpacityMask> |
102 | | - </Rectangle> |
103 | | - <TextBlock Grid.Column="1" Grid.Row="0" |
104 | | - Style="{StaticResource InfoTextBlock}" |
105 | | - Text="{x:Static localization:Strings.Watermark_RunCommandWithHotKey}" /> |
106 | | - </Grid> |
107 | | - </Button> |
108 | | - </Grid> |
109 | | - </DataTemplate> |
110 | | - </mah:MetroWindow.TitleTemplate> |
| 70 | + |
111 | 71 | <mah:MetroWindow.InputBindings> |
112 | 72 | <KeyBinding Command="{Binding OpenRunCommand}" Modifiers="Control+Shift" Key="P" /> |
113 | 73 | </mah:MetroWindow.InputBindings> |
|
117 | 77 | <mah:MetroWindow.LeftWindowCommands> |
118 | 78 | <mah:WindowCommands ShowSeparators="False"> |
119 | 79 | <!-- Fix some design issues with margin -2 and -1 --> |
120 | | - <Grid Background="{DynamicResource MahApps.Brushes.Gray8}" |
| 80 | + <Grid Background="{DynamicResource MahApps.Brushes.Gray10}" |
121 | 81 | Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=IsAdmin, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
122 | 82 | Margin="-2,-1,0,0"> |
123 | 83 | <TextBlock Text="Administrator" Foreground="{DynamicResource MahApps.Brushes.Gray3}" |
|
127 | 87 | </mah:MetroWindow.LeftWindowCommands> |
128 | 88 | <mah:MetroWindow.RightWindowCommands> |
129 | 89 | <mah:WindowCommands ShowSeparators="False"> |
130 | | - <Rectangle Width="10" /> |
131 | | - <Button Command="{Binding RestartApplicationCommand}" Opacity="1" |
132 | | - Visibility="{Binding IsRestartRequired, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
133 | | - Cursor="Hand"> |
134 | | - <StackPanel Orientation="Horizontal"> |
135 | | - <Rectangle Width="20" Height="20" Fill="{DynamicResource MahApps.Brushes.Accent}"> |
| 90 | + <!-- ToDo: CenterWindowCommands https://github.com/MahApps/MahApps.Metro/issues/4419 --> |
| 91 | + <Button Command="{Binding Path=OpenRunCommand}" |
| 92 | + Cursor="Hand" |
| 93 | + Visibility="{Binding Path=FlyoutRunCommandIsOpen, Converter={StaticResource ResourceKey=BooleanReverseToVisibilityCollapsedConverter}}" |
| 94 | + Style="{StaticResource ResourceKey=CleanButton}" |
| 95 | + Margin="0,0,10,0"> |
| 96 | + <Grid Height="30"> |
| 97 | + <Grid.ColumnDefinitions> |
| 98 | + <ColumnDefinition Width="Auto" /> |
| 99 | + <ColumnDefinition Width="270" /> |
| 100 | + </Grid.ColumnDefinitions> |
| 101 | + <Rectangle Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" |
| 102 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray10}" /> |
| 103 | + <Rectangle Grid.Column="0" Grid.Row="0" |
| 104 | + Margin="5,0" |
| 105 | + Width="20" Height="20" |
| 106 | + HorizontalAlignment="Right" |
| 107 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray8}"> |
136 | 108 | <Rectangle.OpacityMask> |
137 | | - <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Restart}" /> |
| 109 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" /> |
138 | 110 | </Rectangle.OpacityMask> |
139 | 111 | </Rectangle> |
140 | | - <TextBlock Text="{x:Static localization:Strings.RestartRequired}" |
141 | | - Style="{StaticResource LinkTextBlock}" VerticalAlignment="Center" Margin="5,0,0,0" /> |
142 | | - </StackPanel> |
| 112 | + <TextBlock Grid.Column="1" Grid.Row="0" |
| 113 | + Style="{StaticResource ResourceKey=InfoTextBlock}" |
| 114 | + Text="{x:Static Member=localization:Strings.Watermark_RunCommandWithHotKey}" /> |
| 115 | + </Grid> |
| 116 | + </Button> |
| 117 | + <Button Command="{Binding RestartApplicationCommand}" |
| 118 | + Opacity="1" |
| 119 | + Visibility="{Binding IsRestartRequired, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
| 120 | + ToolTip="{x:Static localization:Strings.RestartRequired}" |
| 121 | + Cursor="Hand"> |
| 122 | + <Rectangle Width="20" Height="20" |
| 123 | + Fill="{DynamicResource MahApps.Brushes.Accent}"> |
| 124 | + <Rectangle.OpacityMask> |
| 125 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ReloadAlert}" /> |
| 126 | + </Rectangle.OpacityMask> |
| 127 | + </Rectangle> |
143 | 128 | </Button> |
144 | 129 | <Button Command="{Binding OpenWebsiteCommand}" |
145 | 130 | Opacity="1" |
146 | 131 | Visibility="{Binding IsUpdateAvailable, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
147 | 132 | CommandParameter="{Binding UpdateReleaseUrl, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" |
148 | 133 | Cursor="Hand" |
| 134 | + ToolTip="{x:Static localization:Strings.UpdateAvailable}" |
149 | 135 | Focusable="False"> |
150 | 136 | <Rectangle Width="20" Height="20" |
151 | | - Fill="{DynamicResource MahApps.Brushes.Accent}" |
152 | | - ToolTip="{x:Static localization:Strings.UpdateAvailable}"> |
| 137 | + Fill="{DynamicResource MahApps.Brushes.Accent}"> |
153 | 138 | <Rectangle.OpacityMask> |
154 | 139 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=RocketLaunchOutline}" /> |
155 | 140 | </Rectangle.OpacityMask> |
156 | 141 | </Rectangle> |
157 | 142 | </Button> |
158 | 143 | <Button Command="{Binding UnlockProfileCommand}" |
159 | 144 | Opacity="1" |
| 145 | + Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=ProfileManagerShowUnlock, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
| 146 | + CommandParameter="{Binding UpdateReleaseUrl, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" |
160 | 147 | Cursor="Hand" |
| 148 | + ToolTip="{x:Static localization:Strings.UnlockProfile}" |
161 | 149 | Focusable="False"> |
162 | | - <Button.Style> |
163 | | - <Style TargetType="{x:Type Button}" |
164 | | - BasedOn="{StaticResource MahApps.Styles.Button.WindowCommands}"> |
165 | | - <Setter Property="Visibility" Value="Collapsed" /> |
166 | | - <Style.Triggers> |
167 | | - <DataTrigger |
168 | | - Binding="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=ProfileManagerShowUnlock}" |
169 | | - Value="True"> |
170 | | - <Setter Property="Visibility" Value="Visible" /> |
171 | | - </DataTrigger> |
172 | | - </Style.Triggers> |
173 | | - </Style> |
174 | | - </Button.Style> |
175 | | - <StackPanel Orientation="Horizontal"> |
176 | | - <Rectangle Width="20" Height="20" Fill="{DynamicResource MahApps.Brushes.Accent}"> |
177 | | - <Rectangle.Style> |
178 | | - <Style TargetType="Rectangle"> |
179 | | - <Style.Triggers> |
180 | | - <Trigger Property="IsMouseOver" Value="True"> |
181 | | - <Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" /> |
182 | | - </Trigger> |
183 | | - </Style.Triggers> |
184 | | - </Style> |
185 | | - </Rectangle.Style> |
186 | | - <Rectangle.OpacityMask> |
187 | | - <VisualBrush Stretch="Uniform" Visual="{iconPacks:Modern Kind=InterfacePassword}" /> |
188 | | - </Rectangle.OpacityMask> |
189 | | - </Rectangle> |
190 | | - <TextBlock Text="{x:Static localization:Strings.UnlockProfile}" |
191 | | - Style="{StaticResource LinkTextBlock}" Margin="5,0" /> |
192 | | - </StackPanel> |
| 150 | + <Rectangle Width="20" Height="20" |
| 151 | + Fill="{DynamicResource MahApps.Brushes.Accent}"> |
| 152 | + <Rectangle.OpacityMask> |
| 153 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Modern Kind=InterfacePassword}" /> |
| 154 | + </Rectangle.OpacityMask> |
| 155 | + </Rectangle> |
193 | 156 | </Button> |
194 | 157 | <ComboBox ItemsSource="{Binding ProfileFiles}" |
195 | 158 | SelectedItem="{Binding SelectedProfileFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
|
200 | 163 | HorizontalAlignment="Left" |
201 | 164 | Focusable="False" |
202 | 165 | VerticalAlignment="Center" |
203 | | - Height="30" |
204 | | - Margin="0,0,10,0"> |
| 166 | + Height="30"> |
205 | 167 | <ComboBox.ItemTemplate> |
206 | 168 | <DataTemplate> |
207 | 169 | <Grid> |
|
283 | 245 | </mah:MetroWindow.RightWindowCommands> |
284 | 246 | <mah:MetroWindow.Flyouts> |
285 | 247 | <mah:FlyoutsControl> |
286 | | - <mah:Flyout x:Name="FlyoutRunCommand" |
287 | | - IsKeyboardFocusWithinChanged="FlyoutRunCommand_IsKeyboardFocusWithinChanged" |
| 248 | + <mah:Flyout IsKeyboardFocusWithinChanged="FlyoutRunCommand_IsKeyboardFocusWithinChanged" |
| 249 | + IsOpen="{Binding FlyoutRunCommandIsOpen, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
| 250 | + AreAnimationsEnabled="{Binding FlyoutRunCommandAreAnimationsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
| 251 | + Visibility="{Binding FlyoutRunCommandIsOpen, Converter={StaticResource BooleanToVisibilityConverter}}" |
288 | 252 | Position="Top" |
289 | 253 | TitleVisibility="Collapsed" |
290 | 254 | CloseButtonVisibility="Collapsed" |
291 | 255 | IsModal="False" |
292 | | - Width="500" MaxHeight="400" |
| 256 | + Width="600" MaxHeight="400" |
293 | 257 | Theme="Adapt"> |
294 | 258 | <mah:Flyout.InputBindings> |
295 | 259 | <KeyBinding Command="{Binding RunCommandCloseCommand}" Key="Escape" /> |
|
316 | 280 | </Rectangle.OpacityMask> |
317 | 281 | </Rectangle> |
318 | 282 | <TextBox Grid.Column="1" Grid.Row="0" |
| 283 | + FontSize="18" |
| 284 | + FontFamily="Consolas" |
319 | 285 | Text="{Binding RunCommandSearch, UpdateSourceTrigger=PropertyChanged}" |
320 | 286 | mah:TextBoxHelper.Watermark="{x:Static localization:Strings.Watermark_RunCommand}"> |
321 | 287 | <TextBox.Style> |
|
327 | 293 | </TextBox> |
328 | 294 | </Grid> |
329 | 295 | <ListView Grid.Column="0" Grid.Row="2" |
330 | | - x:Name="ListViewRunCommand" |
331 | 296 | ItemsSource="{Binding RunCommands}" |
332 | 297 | SelectedItem="{Binding SelectedRunCommand, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
333 | 298 | SelectionMode="Single" |
|
0 commit comments