ux: style for left panel of repository view

This commit is contained in:
leo 2024-09-27 17:12:13 +08:00
parent a7f609d479
commit a78cf611c0
No known key found for this signature in database
2 changed files with 28 additions and 27 deletions

View file

@ -962,12 +962,14 @@
</Style> </Style>
</Style> </Style>
<Style Selector="RadioButton.icon_button"> <Style Selector="RadioButton.switch_button">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="24"/>
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Border Background="Transparent"> <Border CornerRadius="12" Background="{TemplateBinding Background}">
<ContentPresenter x:Name="PART_ContentPresenter" <ContentPresenter x:Name="PART_ContentPresenter"
Margin="0" Margin="0"
HorizontalAlignment="Center" HorizontalAlignment="Center"
@ -980,9 +982,11 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^:checked">
<Setter Property="Background" Value="{DynamicResource Brush.Accent}"/>
</Style>
<Style Selector="^:checked Path"> <Style Selector="^:checked Path">
<Setter Property="Fill" Value="{DynamicResource Brush.Accent}"/> <Setter Property="Fill" Value="White"/>
<Setter Property="Opacity" Value="0.65"/>
</Style> </Style>
</Style> </Style>

View file

@ -19,31 +19,22 @@
<!-- Left Panel --> <!-- Left Panel -->
<Grid Grid.Column="0" RowDefinitions="Auto,*"> <Grid Grid.Column="0" RowDefinitions="Auto,*">
<!-- Page Switcher for Left Contents (Dashboard or CommitSearch) --> <!-- Page Switcher for Left Contents (Dashboard or CommitSearch) -->
<Grid Grid.Row="0" Height="24" Margin="0,6" HorizontalAlignment="Center" ColumnDefinitions="48,1,48"> <StackPanel Grid.Row="0" Margin="0,6" Height="24" HorizontalAlignment="Center" Orientation="Horizontal">
<Border Grid.Column="0" Grid.ColumnSpan="3" <RadioButton Classes="switch_button"
Height="24" Margin="4,0,0,0"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
CornerRadius="12"/>
<RadioButton Grid.Column="0"
Classes="icon_button"
Width="48"
GroupName="SearchGroup" GroupName="SearchGroup"
IsChecked="{Binding !IsSearching, Mode=OneWay}"> IsChecked="{Binding !IsSearching, Mode=OneWay}">
<Path Width="14" Height="14" Stretch="Fill" HorizontalAlignment="Center" Data="{StaticResource Icons.Home}"/> <Path Width="12" Height="12" Stretch="Fill" HorizontalAlignment="Center" Data="{StaticResource Icons.Home}"/>
</RadioButton> </RadioButton>
<Rectangle Grid.Column="1" Width="0.65" HorizontalAlignment="Center" VerticalAlignment="Stretch" Fill="{DynamicResource Brush.Border2}"/> <RadioButton Classes="switch_button"
Margin="0,0,4,0"
<RadioButton Grid.Column="2"
Width="48"
Classes="icon_button"
GroupName="SearchGroup" GroupName="SearchGroup"
IsChecked="{Binding IsSearching, Mode=TwoWay}"> IsChecked="{Binding IsSearching, Mode=TwoWay}">
<Path Width="14" Height="14" Stretch="Fill" HorizontalAlignment="Center" Data="{StaticResource Icons.Search}"/> <Path Width="12" Height="12" Stretch="Fill" HorizontalAlignment="Center" Data="{StaticResource Icons.Search}"/>
</RadioButton> </RadioButton>
</Grid> </StackPanel>
<!-- Dashboard --> <!-- Dashboard -->
<Grid Grid.Row="1" Margin="0,0,0,8" RowDefinitions="Auto,Auto,*" IsVisible="{Binding !IsSearching}"> <Grid Grid.Row="1" Margin="0,0,0,8" RowDefinitions="Auto,Auto,*" IsVisible="{Binding !IsSearching}">
<!-- Page Switcher for Right Panel --> <!-- Page Switcher for Right Panel -->
@ -138,6 +129,12 @@
Watermark="{DynamicResource Text.Repository.Filter}" Watermark="{DynamicResource Text.Repository.Filter}"
Text="{Binding Filter, Mode=TwoWay}" Text="{Binding Filter, Mode=TwoWay}"
VerticalContentAlignment="Center"> VerticalContentAlignment="Center">
<TextBox.Styles>
<Style Selector="TextBox /template/ TextBlock#PART_Watermark">
<Setter Property="FontSize" Value="12"/>
</Style>
</TextBox.Styles>
<TextBox.InnerLeftContent> <TextBox.InnerLeftContent>
<Path Width="14" Height="14" <Path Width="14" Height="14"
Margin="6,0,0,0" Margin="6,0,0,0"
@ -343,9 +340,9 @@
</Grid> </Grid>
<!-- Commit Search Panel --> <!-- Commit Search Panel -->
<Grid Grid.Row="1" RowDefinitions="26,26,*" Margin="8,0,4,8" IsVisible="{Binding IsSearching}" PropertyChanged="OnSearchCommitPanelPropertyChanged"> <Grid Grid.Row="1" RowDefinitions="Auto,26,*" Margin="8,0,4,8" IsVisible="{Binding IsSearching}" PropertyChanged="OnSearchCommitPanelPropertyChanged">
<!-- Search Input Box --> <!-- Search Input Box -->
<Grid Grid.Row="0"> <Grid Grid.Row="0" Height="26" Margin="0,4,0,0">
<TextBox x:Name="TxtSearchCommitsBox" <TextBox x:Name="TxtSearchCommitsBox"
Height="24" Height="24"
BorderThickness="1" BorderThickness="1"
@ -446,10 +443,10 @@
<CheckBox Height="24" <CheckBox Height="24"
Margin="4,0,0,0" Margin="4,0,0,0"
FontSize="12"
Content="{DynamicResource Text.Repository.Search.InCurrentBranch}"
IsChecked="{Binding OnlySearchCommitsInCurrentBranch, Mode=TwoWay}" IsChecked="{Binding OnlySearchCommitsInCurrentBranch, Mode=TwoWay}"
IsVisible="{Binding SearchCommitFilterType, Converter={x:Static c:IntConverters.IsGreaterThanZero}}"/> IsVisible="{Binding SearchCommitFilterType, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
<TextBlock Text="{DynamicResource Text.Repository.Search.InCurrentBranch}" FontSize="12"/>
</CheckBox>
</StackPanel> </StackPanel>
<ListBox Grid.Row="2" <ListBox Grid.Row="2"