fix: selected color of ListBoxItem not work on Debain 12 Wayland

This commit is contained in:
leo 2024-06-25 16:08:27 +08:00
parent 432f5a98da
commit b5393c5ace
No known key found for this signature in database
2 changed files with 74 additions and 63 deletions

View file

@ -652,18 +652,6 @@
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border0}"/> <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border0}"/>
</Style> </Style>
<Style Selector="ListBox.page_switcher ListBoxItem">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border2}"/>
</Style>
<Style Selector="ListBox.page_switcher ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="ListBox.page_switcher ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}"/>
</Style>
<Style Selector="ContextMenu"> <Style Selector="ContextMenu">
<Setter Property="HorizontalOffset" Value="-4"/> <Setter Property="HorizontalOffset" Value="-4"/>
<Setter Property="VerticalOffset" Value="-4"/> <Setter Property="VerticalOffset" Value="-4"/>

View file

@ -93,15 +93,36 @@
<!-- Left Panel --> <!-- Left Panel -->
<Grid Grid.Column="0" Classes="repository_leftpanel" RowDefinitions="Auto,Auto,*"> <Grid Grid.Column="0" Classes="repository_leftpanel" RowDefinitions="Auto,Auto,*">
<!-- Page Switcher for Right Panel --> <!-- Page Switcher for Right Panel -->
<ListBox Grid.Row="0" Margin="8,4,4,0" Classes="page_switcher" Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}"> <Border Grid.Row="0" Margin="8,4,4,0" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}" CornerRadius="6">
<Border CornerRadius="6" ClipToBounds="True">
<ListBox Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}">
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Height" Value="28"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0,0,0,1"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border2}"/>
</Style>
<Style Selector="ListBoxItem:nth-last-child(1)">
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter, ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="ListBoxItem:selected Grid.view_mode">
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}"/>
</Style>
</ListBox.Styles>
<ListBox.ItemsPanel> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/> <StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBoxItem Height="28" BorderThickness="1,1,1,1" CornerRadius="6,6,0,0"> <ListBoxItem>
<Grid Height="28" ColumnDefinitions="32,*,Auto,Auto"> <Grid Classes="view_mode" ColumnDefinitions="32,*,Auto,Auto">
<Path Grid.Column="0" Width="12" Height="12" 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}"/>
<ToggleButton Grid.Column="2" <ToggleButton Grid.Column="2"
@ -115,8 +136,8 @@
</Grid> </Grid>
</ListBoxItem> </ListBoxItem>
<ListBoxItem Height="26" BorderThickness="1,0,1,0"> <ListBoxItem>
<Grid Height="28" ColumnDefinitions="32,*,Auto"> <Grid Classes="view_mode" ColumnDefinitions="32,*,Auto">
<Path Grid.Column="0" Width="12" Height="12" 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"
@ -131,8 +152,8 @@
</Grid> </Grid>
</ListBoxItem> </ListBoxItem>
<ListBoxItem Height="28" BorderThickness="1,1,1,1" CornerRadius="0,0,6,6"> <ListBoxItem>
<Grid Height="28" ColumnDefinitions="32,*,Auto"> <Grid Classes="view_mode" ColumnDefinitions="32,*,Auto">
<Path Grid.Column="0" Width="12" Height="12" 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"
@ -147,6 +168,8 @@
</Grid> </Grid>
</ListBoxItem> </ListBoxItem>
</ListBox> </ListBox>
</Border>
</Border>
<!-- Page Switcher for Left Contents (Dashboard or CommitSearch) --> <!-- Page Switcher for Left Contents (Dashboard or CommitSearch) -->
<Grid Grid.Row="1" Height="24" Margin="0,6" HorizontalAlignment="Center" ColumnDefinitions="48,1,48"> <Grid Grid.Row="1" Height="24" Margin="0,6" HorizontalAlignment="Center" ColumnDefinitions="48,1,48">