ux: new style for page switcher

This commit is contained in:
leo 2024-06-25 11:44:39 +08:00
parent 8acc0f1104
commit 11c687538e
No known key found for this signature in database
2 changed files with 26 additions and 26 deletions

View file

@ -650,9 +650,10 @@
</Style> </Style>
<Style Selector="ListBox.page_switcher ListBoxItem"> <Style Selector="ListBox.page_switcher ListBoxItem">
<Setter Property="Margin" Value="4,0,2,0"/> <Setter Property="Height" Value="28"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/> <Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="4"/> <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border2}"/>
</Style> </Style>
<Style Selector="ListBox.page_switcher ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="ListBox.page_switcher ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>

View file

@ -113,26 +113,26 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Left Normal Mode --> <!-- Left Normal Mode -->
<Grid Grid.Column="0" Classes="repository_leftpanel" RowDefinitions="28,Auto,5,28,28,Auto,28,*,28,Auto,28,Auto" Margin="0,0,0,4" IsVisible="{Binding !IsSearching}"> <Grid Grid.Column="0" Classes="repository_leftpanel" RowDefinitions="28,Auto,28,28,Auto,28,*,28,Auto,28,Auto" Margin="0,0,0,4" IsVisible="{Binding !IsSearching}">
<!-- WorkingCopy --> <!-- WorkingCopy -->
<TextBlock Grid.Row="0" Classes="group_header_label" Text="{DynamicResource Text.Repository.Workspace}"/> <TextBlock Grid.Row="0" Classes="group_header_label" Text="{DynamicResource Text.Repository.Workspace}"/>
<ListBox Grid.Row="1" Classes="page_switcher" Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}"> <ListBox Grid.Row="1" Margin="8,4,4,0" Classes="page_switcher" Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}">
<ListBox.ItemsPanel> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/> <StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBoxItem Height="28"> <ListBoxItem BorderThickness="1,1,1,1" CornerRadius="6,6,0,0">
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="20,*"> <Grid Height="28" ColumnDefinitions="32,*">
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Histories}"/> <Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Histories}"/>
<TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.Histories}"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.Histories}"/>
</Grid> </Grid>
</ListBoxItem> </ListBoxItem>
<ListBoxItem Height="28"> <ListBoxItem BorderThickness="1,0,1,0">
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="20,*,Auto"> <Grid Height="28" ColumnDefinitions="32,*,Auto">
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Send}"/> <Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Send}"/>
<TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.WorkingCopy}"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.WorkingCopy}"/>
<Border Grid.Column="2" <Border Grid.Column="2"
Margin="6,0" Margin="6,0"
@ -146,9 +146,9 @@
</Grid> </Grid>
</ListBoxItem> </ListBoxItem>
<ListBoxItem Height="28"> <ListBoxItem BorderThickness="1,1,1,1" CornerRadius="0,0,6,6">
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="20,*,Auto"> <Grid Height="28" ColumnDefinitions="32,*,Auto">
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Data="{StaticResource Icons.Stashes}"/> <Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Stashes}"/>
<TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.Stashes}"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{DynamicResource Text.Stashes}"/>
<Border Grid.Column="2" <Border Grid.Column="2"
Margin="6,0" Margin="6,0"
@ -164,14 +164,13 @@
</ListBox> </ListBox>
<!-- Filter Branches --> <!-- Filter Branches -->
<Rectangle Grid.Row="2" Height=".65" HorizontalAlignment="Stretch" VerticalAlignment="Center" Fill="{DynamicResource Brush.Border2}"/> <TextBox Grid.Row="2"
<TextBox Grid.Row="3" Margin="8,6,4,0"
Margin="4,2,1,0"
Height="24" Height="24"
BorderThickness="1" BorderThickness="1"
CornerRadius="3" CornerRadius="4"
BorderBrush="{DynamicResource Brush.Border2}" BorderBrush="{DynamicResource Brush.Border2}"
Background="{DynamicResource Brush.Contents}" Background="Transparent"
Watermark="{DynamicResource Text.Repository.FilterBranchTip}" Watermark="{DynamicResource Text.Repository.FilterBranchTip}"
Text="{Binding SearchBranchFilter, Mode=TwoWay}" Text="{Binding SearchBranchFilter, Mode=TwoWay}"
VerticalContentAlignment="Center"> VerticalContentAlignment="Center">
@ -198,8 +197,8 @@
</TextBox> </TextBox>
<!-- Local Branches --> <!-- Local Branches -->
<TextBlock Grid.Row="4" Classes="group_header_label" Text="{DynamicResource Text.Repository.LocalBranches}"/> <TextBlock Grid.Row="3" Classes="group_header_label" Text="{DynamicResource Text.Repository.LocalBranches}"/>
<TreeView Grid.Row="5" <TreeView Grid.Row="4"
x:Name="localBranchTree" x:Name="localBranchTree"
MaxHeight="400" MaxHeight="400"
Margin="4,0,2,0" Margin="4,0,2,0"
@ -267,13 +266,13 @@
</TreeView> </TreeView>
<!-- Remotes --> <!-- Remotes -->
<Grid Grid.Row="6" ColumnDefinitions="*,Auto"> <Grid Grid.Row="5" ColumnDefinitions="*,Auto">
<TextBlock Grid.Column="0" Classes="group_header_label" Text="{DynamicResource Text.Repository.Remotes}"/> <TextBlock Grid.Column="0" Classes="group_header_label" Text="{DynamicResource Text.Repository.Remotes}"/>
<Button Grid.Column="1" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding AddRemote}" ToolTip.Tip="{DynamicResource Text.Repository.Remotes.Add}"> <Button Grid.Column="1" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding AddRemote}" ToolTip.Tip="{DynamicResource Text.Repository.Remotes.Add}">
<Path Width="12" Height="12" Data="{StaticResource Icons.Remote.Add}"/> <Path Width="12" Height="12" Data="{StaticResource Icons.Remote.Add}"/>
</Button> </Button>
</Grid> </Grid>
<TreeView Grid.Row="7" <TreeView Grid.Row="6"
x:Name="remoteBranchTree" x:Name="remoteBranchTree"
Margin="4,0,2,0" Margin="4,0,2,0"
SelectionMode="Multiple" SelectionMode="Multiple"
@ -330,7 +329,7 @@
</TreeView> </TreeView>
<!-- Tags --> <!-- Tags -->
<ToggleButton Grid.Row="8" Classes="group_expander" IsChecked="{Binding IsTagGroupExpanded, Mode=TwoWay}"> <ToggleButton Grid.Row="7" Classes="group_expander" IsChecked="{Binding IsTagGroupExpanded, Mode=TwoWay}">
<Grid ColumnDefinitions="Auto,*,Auto"> <Grid ColumnDefinitions="Auto,*,Auto">
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Tags}"/> <TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Tags}"/>
<TextBlock Grid.Column="1" Text="{Binding Tags, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/> <TextBlock Grid.Column="1" Text="{Binding Tags, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
@ -339,7 +338,7 @@
</Button> </Button>
</Grid> </Grid>
</ToggleButton> </ToggleButton>
<DataGrid Grid.Row="9" <DataGrid Grid.Row="8"
x:Name="tagsList" x:Name="tagsList"
MaxHeight="200" MaxHeight="200"
Margin="4,0,2,0" Margin="4,0,2,0"
@ -418,7 +417,7 @@
</DataGrid> </DataGrid>
<!-- Submodules --> <!-- Submodules -->
<ToggleButton Grid.Row="10" Classes="group_expander" IsChecked="{Binding IsSubmoduleGroupExpanded, Mode=TwoWay}"> <ToggleButton Grid.Row="9" Classes="group_expander" IsChecked="{Binding IsSubmoduleGroupExpanded, Mode=TwoWay}">
<Grid ColumnDefinitions="Auto,*,Auto,Auto"> <Grid ColumnDefinitions="Auto,*,Auto,Auto">
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Submodules}"/> <TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Submodules}"/>
<TextBlock Grid.Column="1" Text="{Binding Submodules, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/> <TextBlock Grid.Column="1" Text="{Binding Submodules, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
@ -441,7 +440,7 @@
</Button> </Button>
</Grid> </Grid>
</ToggleButton> </ToggleButton>
<DataGrid Grid.Row="11" <DataGrid Grid.Row="10"
MaxHeight="200" MaxHeight="200"
Margin="4,0,6,0" Margin="4,0,6,0"
Background="Transparent" Background="Transparent"