optimize(Manager): add context menu for recent opened repositories

This commit is contained in:
leo 2020-08-06 11:31:20 +08:00
parent 08dc039768
commit 28e3a1bb27
2 changed files with 48 additions and 19 deletions

View file

@ -36,11 +36,16 @@
Background="Transparent"
BorderThickness="0"
Style="{StaticResource Style.ListView.Borderless}"
ItemContainerStyle="{StaticResource Style.ListViewItem.Borderless}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
GotFocus="RecentsGotFocus"
SelectionChanged="RecentsSelectionChanged"
MouseDoubleClick="RecentsMouseDoubleClick">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource Style.ListViewItem.Borderless}">
<EventSetter Event="ContextMenuOpening" Handler="RecentsContextMenuOpening"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate DataType="{x:Type git:Repository}">
<StackPanel Orientation="Horizontal" Height="24">
@ -143,20 +148,11 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Name & Path & OpenButton -->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" x:Name="repoName" FontSize="20" FontWeight="Bold"/>
<Label Grid.Column="1" x:Name="repoPath" FontSize="20" FontWeight="Light" Opacity="0.5" VerticalAlignment="Center"/>
<Button Grid.Column="3" Click="OpenRepo" ToolTip="Open">
<Path Width="20" Height="20" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Folder}"/>
</Button>
</Grid>
<!-- Name & Path -->
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label x:Name="repoName" FontSize="20" FontWeight="Bold"/>
<Label x:Name="repoPath" FontSize="20" FontWeight="Light" Opacity="0.5" VerticalAlignment="Center"/>
</StackPanel>
<!-- Status of selected repository -->
<Label Grid.Row="1" Content="STATUS" FontSize="16" Margin="0,16,0,4" FontWeight="Bold" Opacity=".8"/>