Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 373226f

Browse files
committed
Style PR list a bit.
1 parent e19d3c1 commit 373226f

File tree

3 files changed

+37
-83
lines changed

3 files changed

+37
-83
lines changed
Lines changed: 30 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,46 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3-
4-
<SolidColorBrush x:Key="FlatListViewGridLineBrush" Color="{DynamicResource VsColor.GridLine}"/>
5-
<SolidColorBrush x:Key="FlatListViewHighlightBackgroundBrush" Color="{DynamicResource VsColor.Highlight}"/>
6-
<SolidColorBrush x:Key="FlatListViewHighlightForegroundBrush" Color="White"/>
7-
<SolidColorBrush x:Key="FlatListViewHoverBrush" Color="{DynamicResource VsColor.InactiveBorder}"/>
8-
9-
<Style x:Key="FlatListViewItemStyle" TargetType="ListViewItem">
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:vsp="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0">
4+
<Style TargetType="ListBoxItem">
5+
<Setter Property="SnapsToDevicePixels" Value="True"/>
6+
<Setter Property="Padding" Value="4,1"/>
7+
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
8+
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
109
<Setter Property="Template">
1110
<Setter.Value>
12-
<ControlTemplate TargetType="{x:Type ListViewItem}">
13-
<Border Name="Border" Background="Transparent" Padding="2">
14-
<GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
11+
<ControlTemplate TargetType="{x:Type ListBoxItem}">
12+
<Border x:Name="border"
13+
BorderBrush="{TemplateBinding BorderBrush}"
14+
BorderThickness="{TemplateBinding BorderThickness}"
15+
Background="{TemplateBinding Background}"
16+
Padding="{TemplateBinding Padding}"
17+
SnapsToDevicePixels="true">
18+
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
19+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
20+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
1521
</Border>
1622
<ControlTemplate.Triggers>
1723
<Trigger Property="IsMouseOver" Value="True">
18-
<Setter Property="Background" TargetName="Border" Value="{StaticResource FlatListViewHoverBrush}"/>
24+
<Setter Property="Background" TargetName="border" Value="{DynamicResource VsBrush.CommandBarHover}"/>
1925
</Trigger>
2026
<Trigger Property="IsSelected" Value="True">
21-
<Setter Property="TextBlock.Foreground" TargetName="Border" Value="{StaticResource FlatListViewHighlightForegroundBrush}"/>
22-
<Setter Property="Background" TargetName="Border" Value="{StaticResource FlatListViewHighlightBackgroundBrush}"/>
27+
<Setter Property="Background" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemActiveBrushKey}}" />
28+
<Setter Property="TextElement.Foreground" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemActiveTextBrushKey}}" />
2329
</Trigger>
24-
</ControlTemplate.Triggers>
25-
</ControlTemplate>
26-
</Setter.Value>
27-
</Setter>
28-
</Style>
29-
30-
<Style x:Key="FlatGridViewColumnHeaderGripper" TargetType="{x:Type Thumb}">
31-
<Setter Property="Canvas.Right" Value="-9"/>
32-
<Setter Property="Width" Value="18"/>
33-
<Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
34-
<Setter Property="Padding" Value="0"/>
35-
<Setter Property="Background" Value="{StaticResource FlatListViewGridLineBrush}"/>
36-
<Setter Property="Template">
37-
<Setter.Value>
38-
<ControlTemplate TargetType="{x:Type Thumb}">
39-
<Border Background="Transparent" Padding="{TemplateBinding Padding}">
40-
<Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="1"/>
41-
</Border>
42-
</ControlTemplate>
43-
</Setter.Value>
44-
</Setter>
45-
</Style>
46-
47-
<Style x:Key="FlatGridViewColumnHeader" TargetType="GridViewColumnHeader">
48-
<Setter Property="Background" Value="Transparent"/>
49-
<Setter Property="Foreground" Value="{DynamicResource GitHubVsWindowText}"/>
50-
<Setter Property="HorizontalContentAlignment" Value="Left"/>
51-
<Setter Property="Template">
52-
<Setter.Value>
53-
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
54-
<Grid SnapsToDevicePixels="True">
55-
<Border Name="HeaderBorder"
56-
BorderThickness="0,0,0,1"
57-
BorderBrush="{StaticResource FlatListViewGridLineBrush}"
58-
Background="Transparent">
59-
<TextBlock x:Name="ContentHeader" Margin="6,1,0,0" Text="{TemplateBinding Content}" Width="{TemplateBinding Width}" TextAlignment="Left" />
60-
</Border>
61-
<Canvas>
62-
<Thumb Name="PART_HeaderGripper" Style="{StaticResource FlatGridViewColumnHeaderGripper}"/>
63-
</Canvas>
64-
</Grid>
65-
<ControlTemplate.Triggers>
66-
<Trigger Property="IsMouseOver" Value="True">
67-
<Setter Property="Background" TargetName="HeaderBorder" Value="{StaticResource FlatListViewHoverBrush}"/>
30+
<MultiTrigger>
31+
<MultiTrigger.Conditions>
32+
<Condition Property="IsSelected" Value="True" />
33+
<Condition Property="Selector.IsSelectionActive" Value="False" />
34+
</MultiTrigger.Conditions>
35+
<Setter Property="Background" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemInactiveBrushKey}}" />
36+
<Setter Property="TextElement.Foreground" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemInactiveTextBrushKey}}" />
37+
</MultiTrigger>
38+
<Trigger Property="IsEnabled" Value="False">
39+
<Setter Property="TextElement.Foreground" TargetName="border" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
6840
</Trigger>
6941
</ControlTemplate.Triggers>
7042
</ControlTemplate>
7143
</Setter.Value>
7244
</Setter>
73-
<Style.Triggers>
74-
<Trigger Property="Role" Value="Padding">
75-
<Setter Property="Template">
76-
<Setter.Value>
77-
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
78-
<Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1" Background="{TemplateBinding Background}"/>
79-
<ControlTemplate.Triggers>
80-
<Trigger Property="Height" Value="Auto">
81-
<Setter Property="MinHeight" Value="20"/>
82-
</Trigger>
83-
</ControlTemplate.Triggers>
84-
</ControlTemplate>
85-
</Setter.Value>
86-
</Setter>
87-
</Trigger>
88-
</Style.Triggers>
8945
</Style>
9046
</ResourceDictionary>

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestListItemView.xaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,12 @@
6565
<StackPanel DockPanel.Dock="Top"
6666
Margin="0,2,5,0"
6767
Orientation="Horizontal"
68-
TextBlock.Foreground="{DynamicResource GitHubVsGrayText}">
68+
Opacity="0.5">
6969
<TextBlock>
70-
<Hyperlink>
7170
<Run Text="{Binding Number, Mode=OneWay, StringFormat=#{0}}"/>
72-
</Hyperlink>
73-
<Run Text="{Binding UpdatedAt, Converter={ghfvs:DurationToStringConverter}, Mode=OneWay}"/>
74-
<Run>by</Run>
75-
<Run Text="{Binding Author.Login, Mode=OneWay}"/>
71+
<Run Text="{Binding UpdatedAt, Converter={ghfvs:DurationToStringConverter}, Mode=OneWay}"/>
72+
by
73+
<Run Text="{Binding Author.Login, Mode=OneWay}"/>
7674
</TextBlock>
7775
<TextBlock Margin="4 0" Visibility="{Binding CommentCount, Converter={ghfvs:CountToVisibilityConverter}}">
7876
<ghfvs:OcticonImage Icon="comment" Width="16" Height="16" Margin="0 0 0 -4"/>

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestListView.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
1010
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestListViewCustom}">
1111
<d:DesignProperties.DataContext>
12-
<ghfvs:PullRequestListViewModelDesigner Message="NoItemsMatchCriteria"/>
12+
<ghfvs:PullRequestListViewModelDesigner Message="None"/>
1313
</d:DesignProperties.DataContext>
1414

1515
<UserControl.Resources>
@@ -20,7 +20,7 @@
2020
</ResourceDictionary.MergedDictionaries>
2121
</ResourceDictionary>
2222
</UserControl.Resources>
23-
23+
2424
<DockPanel>
2525
<DockPanel DockPanel.Dock="Top"
2626
Margin="8">
@@ -80,7 +80,7 @@
8080
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
8181
Visibility="{Binding Message, Converter={ghfvs:EqualsToVisibilityConverter None}}">
8282
<ListBox.ItemContainerStyle>
83-
<Style TargetType="ListBoxItem">
83+
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
8484
<EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_MouseDoubleClick"/>
8585
</Style>
8686
</ListBox.ItemContainerStyle>

0 commit comments

Comments
 (0)