|
14 | 14 | <v:HistoriesLayout.RowDefinitions> |
15 | 15 | <RowDefinition Height="{Binding TopArea, Mode=TwoWay}" MinHeight="100"/> |
16 | 16 | <RowDefinition Height="3"/> |
17 | | - <RowDefinition Height="{Binding BottomArea, Mode=TwoWay}" MinHeight="200"/> |
| 17 | + <RowDefinition Height="{Binding BottomArea, Mode=TwoWay}" MinHeight="28"/> |
18 | 18 | </v:HistoriesLayout.RowDefinitions> |
19 | 19 |
|
20 | 20 | <v:HistoriesLayout.ColumnDefinitions> |
|
268 | 268 | HorizontalAlignment="Stretch" VerticalAlignment="Stretch" |
269 | 269 | Background="{DynamicResource Brush.Window}" |
270 | 270 | BorderBrush="{DynamicResource Brush.Border0}" |
271 | | - Focusable="False"/> |
| 271 | + Focusable="False"> |
| 272 | + <GridSplitter.IsEnabled> |
| 273 | + <MultiBinding Converter="{x:Static BoolConverters.Or}"> |
| 274 | + <Binding Source="{x:Static vm:Preferences.Instance}" Path="UseTwoColumnsLayoutInHistories"/> |
| 275 | + <Binding Path="IsCollapseDetails" Converter="{x:Static BoolConverters.Not}"/> |
| 276 | + </MultiBinding> |
| 277 | + </GridSplitter.IsEnabled> |
| 278 | + </GridSplitter> |
272 | 279 |
|
273 | 280 | <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"> |
274 | | - <Grid IsVisible="{Binding DetailContext, Converter={x:Static ObjectConverters.IsNull}}"> |
275 | | - <Path Width="128" Height="128" |
276 | | - Data="{StaticResource Icons.Detail}" |
277 | | - HorizontalAlignment="Center" |
278 | | - Fill="{DynamicResource Brush.FG2}"/> |
279 | | - |
280 | | - <StackPanel Margin="0,8" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom"> |
281 | | - <Path Width="12" Height="12" VerticalAlignment="Center" Data="{StaticResource Icons.Info}" Fill="{DynamicResource Brush.FG2}"/> |
282 | | - <TextBlock Margin="4,0" Text="{DynamicResource Text.Histories.Tips.Prefix}" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}"/> |
283 | | - <TextBlock Text="{DynamicResource Text.Histories.Tips}" Foreground="{DynamicResource Brush.FG2}" IsVisible="{OnPlatform True, macOS=False}"/> |
284 | | - <TextBlock Text="{DynamicResource Text.Histories.Tips.MacOS}" Foreground="{DynamicResource Brush.FG2}" IsVisible="{OnPlatform False, macOS=True}"/> |
285 | | - </StackPanel> |
286 | | - </Grid> |
287 | | - |
288 | | - <ContentControl Content="{Binding DetailContext}"> |
| 281 | + <ContentControl> |
| 282 | + <ContentControl.Content> |
| 283 | + <Binding Path="DetailContext"> |
| 284 | + <Binding.TargetNullValue> |
| 285 | + <TabControl Padding="0,4"> |
| 286 | + <TabItem> |
| 287 | + <TabItem.Header> |
| 288 | + <Border Background="Transparent" PointerPressed="OnTabHeaderPointerPressed"> |
| 289 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Info}"/> |
| 290 | + </Border> |
| 291 | + </TabItem.Header> |
| 292 | + |
| 293 | + <Grid Margin="0,32,0,0" ClipToBounds="True"> |
| 294 | + <Path Width="128" Height="128" |
| 295 | + Data="{StaticResource Icons.Detail}" |
| 296 | + HorizontalAlignment="Center" |
| 297 | + Fill="{DynamicResource Brush.FG2}"/> |
| 298 | + |
| 299 | + <StackPanel Margin="0,8" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom"> |
| 300 | + <Path Width="12" Height="12" VerticalAlignment="Center" Data="{StaticResource Icons.Info}" Fill="{DynamicResource Brush.FG2}"/> |
| 301 | + <TextBlock Margin="4,0" Text="{DynamicResource Text.Histories.Tips.Prefix}" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}"/> |
| 302 | + <TextBlock Text="{DynamicResource Text.Histories.Tips}" Foreground="{DynamicResource Brush.FG2}" IsVisible="{OnPlatform True, macOS=False}"/> |
| 303 | + <TextBlock Text="{DynamicResource Text.Histories.Tips.MacOS}" Foreground="{DynamicResource Brush.FG2}" IsVisible="{OnPlatform False, macOS=True}"/> |
| 304 | + </StackPanel> |
| 305 | + </Grid> |
| 306 | + </TabItem> |
| 307 | + |
| 308 | + <TabItem IsEnabled="False"> |
| 309 | + <TabItem.Header> |
| 310 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Changes}"/> |
| 311 | + </TabItem.Header> |
| 312 | + </TabItem> |
| 313 | + |
| 314 | + <TabItem IsEnabled="False"> |
| 315 | + <TabItem.Header> |
| 316 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Files}"/> |
| 317 | + </TabItem.Header> |
| 318 | + </TabItem> |
| 319 | + </TabControl> |
| 320 | + </Binding.TargetNullValue> |
| 321 | + </Binding> |
| 322 | + </ContentControl.Content> |
| 323 | + |
289 | 324 | <ContentControl.DataTemplates> |
290 | 325 | <DataTemplate DataType="vm:CommitDetail"> |
291 | 326 | <v:CommitDetail/> |
292 | 327 | </DataTemplate> |
293 | 328 |
|
294 | 329 | <DataTemplate DataType="vm:RevisionCompare"> |
295 | | - <v:RevisionCompare/> |
| 330 | + <TabControl SelectedIndex="1" Padding="0"> |
| 331 | + <TabItem IsEnabled="False"> |
| 332 | + <TabItem.Header> |
| 333 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Info}"/> |
| 334 | + </TabItem.Header> |
| 335 | + </TabItem> |
| 336 | + |
| 337 | + <TabItem> |
| 338 | + <TabItem.Header> |
| 339 | + <Border Background="Transparent" PointerPressed="OnTabHeaderPointerPressed"> |
| 340 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Changes}"/> |
| 341 | + </Border> |
| 342 | + </TabItem.Header> |
| 343 | + |
| 344 | + <v:RevisionCompare/> |
| 345 | + </TabItem> |
| 346 | + |
| 347 | + <TabItem IsEnabled="False"> |
| 348 | + <TabItem.Header> |
| 349 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Files}"/> |
| 350 | + </TabItem.Header> |
| 351 | + </TabItem> |
| 352 | + </TabControl> |
296 | 353 | </DataTemplate> |
297 | 354 |
|
298 | 355 | <DataTemplate DataType="m:Count"> |
299 | | - <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> |
300 | | - <Path Width="128" Height="128" |
301 | | - Data="{StaticResource Icons.Detail}" |
302 | | - HorizontalAlignment="Center" |
303 | | - Fill="{DynamicResource Brush.FG2}"/> |
304 | | - |
305 | | - <TextBlock HorizontalAlignment="Center" |
306 | | - Margin="0,16" |
307 | | - FontSize="24" FontWeight="Bold" |
308 | | - Foreground="{DynamicResource Brush.FG2}" |
309 | | - Text="{Binding Value, Converter={x:Static c:StringConverters.FormatByResourceKey}, ConverterParameter='Histories.Selected'}"/> |
310 | | - </StackPanel> |
| 356 | + <TabControl Padding="0,4"> |
| 357 | + <TabItem> |
| 358 | + <TabItem.Header> |
| 359 | + <Border Background="Transparent" PointerPressed="OnTabHeaderPointerPressed"> |
| 360 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Info}"/> |
| 361 | + </Border> |
| 362 | + </TabItem.Header> |
| 363 | + |
| 364 | + <StackPanel ClipToBounds="True" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 365 | + <Path Width="128" Height="128" |
| 366 | + Data="{StaticResource Icons.Detail}" |
| 367 | + HorizontalAlignment="Center" |
| 368 | + Fill="{DynamicResource Brush.FG2}"/> |
| 369 | + |
| 370 | + <TextBlock HorizontalAlignment="Center" |
| 371 | + Margin="0,16" |
| 372 | + FontSize="24" FontWeight="Bold" |
| 373 | + Foreground="{DynamicResource Brush.FG2}" |
| 374 | + Text="{Binding Value, Converter={x:Static c:StringConverters.FormatByResourceKey}, ConverterParameter='Histories.Selected'}"/> |
| 375 | + </StackPanel> |
| 376 | + </TabItem> |
| 377 | + |
| 378 | + <TabItem IsEnabled="False"> |
| 379 | + <TabItem.Header> |
| 380 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Changes}"/> |
| 381 | + </TabItem.Header> |
| 382 | + </TabItem> |
| 383 | + |
| 384 | + <TabItem IsEnabled="False"> |
| 385 | + <TabItem.Header> |
| 386 | + <TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Files}"/> |
| 387 | + </TabItem.Header> |
| 388 | + </TabItem> |
| 389 | + </TabControl> |
311 | 390 | </DataTemplate> |
312 | 391 | </ContentControl.DataTemplates> |
313 | 392 | </ContentControl> |
| 393 | + |
| 394 | + <ToggleButton Classes="line_path" |
| 395 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 396 | + Margin="0,2,8,0" |
| 397 | + IsChecked="{Binding IsCollapseDetails, Mode=TwoWay}" |
| 398 | + IsVisible="{Binding Source={x:Static vm:Preferences.Instance}, Path=UseTwoColumnsLayoutInHistories, Mode=OneWay, Converter={x:Static BoolConverters.Not}}"> |
| 399 | + <Path Width="14" Height="14" Data="{StaticResource Icons.CollapseToBottom}" Margin="0,3,0,0"/> |
| 400 | + </ToggleButton> |
314 | 401 | </Grid> |
315 | 402 | </v:HistoriesLayout> |
316 | 403 | </UserControl> |
0 commit comments