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

Commit 4c1b21f

Browse files
committed
Merge pull request #271 from github/pr-list-polish
Polish Pull Request list view
2 parents b24b202 + 0aec503 commit 4c1b21f

File tree

4 files changed

+87
-50
lines changed

4 files changed

+87
-50
lines changed

src/GitHub.App/SampleData/PullRequestListViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public PullRequestListViewModelDesigner()
2626
new AccountDesigner { Login = "haacked", IsUser = true },
2727
new AccountDesigner { Login = "shana", IsUser = true },
2828
DateTimeOffset.Now - TimeSpan.FromMinutes(2)) { CommentCount = 4, HasNewComments = false });
29-
prs.Add(new PullRequestModel(409, "Fix publish button style",
29+
prs.Add(new PullRequestModel(409, "Fix publish button style and a really, really long name for this thing... OMG look how long this name is yusssss",
3030
new AccountDesigner { Login = "shana", IsUser = true },
3131
new AccountDesigner { Login = "Haacked", IsUser = true },
3232
DateTimeOffset.Now - TimeSpan.FromHours(5)) { CommentCount = 27, HasNewComments = true });

src/GitHub.VisualStudio/SharedDictionary.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@
5050
</Style>
5151

5252
<Style x:Key="VerticalSeparator" TargetType="{x:Type Separator}">
53-
<Setter Property="Background" Value="Gray" />
53+
<Setter Property="Background" Value="{DynamicResource GitHubHeaderSeparatorBrush}" />
5454
<Setter Property="Margin" Value="3,0,3,0" />
5555
<Setter Property="LayoutTransform">
5656
<Setter.Value>
5757
<RotateTransform Angle="90" />
5858
</Setter.Value>
5959
</Setter>
6060
</Style>
61-
6261
</ResourceDictionary>

src/GitHub.VisualStudio/UI/Views/Controls/PullRequestListItem.xaml

Lines changed: 75 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<Grid>
1919
<Grid.RowDefinitions>
2020
<RowDefinition Height="Auto" />
21-
<RowDefinition Height="*" />
21+
<RowDefinition Height="Auto" />
2222
</Grid.RowDefinitions>
2323
<Grid.ColumnDefinitions>
2424
<ColumnDefinition Width="Auto" />
@@ -27,51 +27,69 @@
2727
<ColumnDefinition Width="12" />
2828
<ColumnDefinition Width="11" />
2929
</Grid.ColumnDefinitions>
30-
<Image x:Name="avatar"
31-
Grid.Row="0"
32-
Grid.RowSpan="2"
33-
Grid.Column="0"
34-
Width="32"
35-
Height="32"
36-
Margin="0,0,9,0"
37-
RenderOptions.BitmapScalingMode="HighQuality"
38-
Source="{Binding Author.Avatar}" />
30+
31+
<Grid
32+
Grid.Row="0"
33+
Grid.RowSpan="2"
34+
Grid.Column="0"
35+
VerticalAlignment="Top">
36+
37+
<Border Name="avatarMask" Background="White" CornerRadius="3" Width="20" />
38+
39+
<StackPanel>
40+
<StackPanel.OpacityMask>
41+
<VisualBrush Visual="{Binding ElementName=avatarMask}" />
42+
</StackPanel.OpacityMask>
43+
<Image x:Name="avatar"
44+
Width="30"
45+
Margin="0,0,10,0"
46+
Height="30"
47+
RenderOptions.BitmapScalingMode="HighQuality"
48+
Source="{Binding Author.Avatar}" />
49+
</StackPanel>
50+
</Grid>
51+
3952
<TextBlock x:Name="title"
4053
Grid.Row="0"
4154
Grid.Column="1"
4255
HorizontalAlignment="Left"
43-
VerticalAlignment="Center"
56+
VerticalAlignment="Top"
4457
FontFamily="Segoe UI"
4558
FontSize="14"
4659
Foreground="{DynamicResource GitHubVsToolWindowText}"
60+
Margin="0,-3,5,0"
4761
Text="{Binding Title}"
48-
TextWrapping="WrapWithOverflow" />
49-
<ui:OcticonImage x:Name="comment_icon"
50-
Grid.Row="0"
51-
Grid.Column="2"
52-
Width="14"
53-
Height="14"
54-
Margin="0,0,1,0"
55-
HorizontalAlignment="Right"
56-
VerticalAlignment="Center"
57-
Foreground="{DynamicResource GitHubVsToolWindowText}"
58-
Icon="comment">
59-
<ui:OcticonImage.Style>
60-
<Style>
61-
<Style.Triggers>
62-
<DataTrigger Binding="{Binding CommentCount}" Value="0">
63-
<Setter Property="FrameworkElement.IsEnabled" Value="False" />
64-
</DataTrigger>
65-
</Style.Triggers>
66-
</Style>
67-
</ui:OcticonImage.Style>
62+
ToolTip="{Binding Title}"
63+
TextTrimming="CharacterEllipsis" />
64+
<ui:OcticonImage x:Name="comment_icon"
65+
Grid.Row="0"
66+
Grid.RowSpan="2"
67+
Grid.Column="2"
68+
Icon="comment"
69+
Margin="5,0"
70+
Width="16"
71+
Height="16"
72+
VerticalAlignment="Top"
73+
Foreground="{DynamicResource GitHubVsToolWindowText}">
74+
<!--
75+
<ui:OcticonImage.Style>
76+
<Style>
77+
<Style.Triggers>
78+
<DataTrigger Binding="{Binding CommentCount}" Value="0">
79+
<Setter Property="FrameworkElement.IsEnabled" Value="False" />
80+
</DataTrigger>
81+
</Style.Triggers>
82+
</Style>
83+
</ui:OcticonImage.Style>
84+
-->
85+
</ui:OcticonImage>
6886

69-
</ui:OcticonImage>
7087
<TextBlock x:Name="comment_count"
7188
Grid.Row="0"
89+
Grid.RowSpan="2"
7290
Grid.Column="3"
7391
HorizontalAlignment="Left"
74-
VerticalAlignment="Center"
92+
VerticalAlignment="Top"
7593
FontFamily="Segoe UI"
7694
FontSize="12"
7795
Foreground="{DynamicResource GitHubVsToolWindowText}"
@@ -85,15 +103,17 @@
85103
</Style.Triggers>
86104
</Style>
87105
</TextBlock.Style>
88-
89106
</TextBlock>
107+
90108
<ui:OcticonImage x:Name="comment_new"
91109
Grid.Row="0"
110+
Grid.RowSpan="2"
92111
Grid.Column="4"
93112
Width="10"
94113
Height="10"
95114
HorizontalAlignment="Right"
96-
VerticalAlignment="Center"
115+
VerticalAlignment="Top"
116+
Margin="0,3"
97117
Foreground="Green"
98118
Icon="primitive_dot"
99119
Visibility="{Binding HasNewComments,
@@ -113,21 +133,37 @@
113133
CommandParameter="{Binding Number}"
114134
Content="{Binding Number}"
115135
FontFamily="Segoe UI"
116-
FontSize="11"
136+
FontSize="12"
117137
Style="{StaticResource HashtagActionLink}" />
118138
<TextBlock x:Name="description"
119139
Grid.Column="1"
120140
FontFamily="Segoe UI"
121-
FontSize="11"
141+
FontSize="12"
142+
Margin="0,0,10,0"
143+
TextTrimming="CharacterEllipsis"
122144
Foreground="{DynamicResource GitHubVsGrayText}">
123145
<TextBlock.Text>
124-
<MultiBinding StringFormat="{} {0} {1} {2} {3}">
125-
<Binding Source="{x:Static i18n:Resources.prOpenedText}" />
146+
<MultiBinding StringFormat="{} {0} {1} {2}">
126147
<Binding Converter="{StaticResource DurationToStringConverter}" Path="UpdatedAt" />
127148
<Binding Source="{x:Static i18n:Resources.prOpenedByText}" />
128149
<Binding Path="Author.Login" />
129150
</MultiBinding>
130151
</TextBlock.Text>
152+
153+
<TextBlock.ToolTip>
154+
<ToolTip>
155+
<TextBlock>
156+
<TextBlock.Text>
157+
<MultiBinding StringFormat="{} {0} {1} {2} {3}">
158+
<Binding Source="{x:Static i18n:Resources.prOpenedText}" />
159+
<Binding Converter="{StaticResource DurationToStringConverter}" Path="UpdatedAt" />
160+
<Binding Source="{x:Static i18n:Resources.prOpenedByText}" />
161+
<Binding Path="Author.Login" />
162+
</MultiBinding>
163+
</TextBlock.Text>
164+
</TextBlock>
165+
</ToolTip>
166+
</TextBlock.ToolTip>
131167
</TextBlock>
132168
</Grid>
133169
</Grid>

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
<Style x:Key="PullRequestListItemContainerStyle" TargetType="{x:Type ListViewItem}">
3636
<Setter Property="SnapsToDevicePixels" Value="True" />
37-
<Setter Property="Margin" Value="0" />
37+
<Setter Property="Margin" Value="0,0,0,10" />
3838
<Setter Property="Padding" Value="1" />
3939

4040
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
@@ -144,7 +144,7 @@
144144

145145
<DockPanel Margin="6,0,6,0">
146146

147-
<Grid Margin="0,0,0,4" DockPanel.Dock="Top">
147+
<Grid Margin="0,0,0,10" DockPanel.Dock="Top">
148148
<Grid.ColumnDefinitions>
149149
<ColumnDefinition Width="Auto" />
150150
<ColumnDefinition Width="*" />
@@ -153,8 +153,9 @@
153153
<WrapPanel Grid.Column="0" HorizontalAlignment="Stretch">
154154

155155
<ui:GitHubActionLink x:Name="stateSelection"
156-
Margin="5,0,0,0"
156+
Margin="5,0"
157157
VerticalAlignment="Center"
158+
ToolTip="Filter by state"
158159
Content="{Binding SelectedState}"
159160
HasDropDown="True">
160161
<i:Interaction.Triggers>
@@ -186,11 +187,12 @@
186187
</Border>
187188
</Popup>
188189

189-
<Separator Margin="3,0,3,0" Style="{StaticResource VerticalSeparator}" />
190+
<Separator Style="{StaticResource VerticalSeparator}" />
190191

191192
<ui:GitHubActionLink x:Name="assigneeSelection"
192-
Margin="5,0,0,0"
193+
Margin="5,0"
193194
VerticalAlignment="Center"
195+
ToolTip="Filter by assignee"
194196
Content="{Binding SelectedAssignee,
195197
Converter={ui:DefaultValueConverter},
196198
ConverterParameter=Assignee}"
@@ -233,11 +235,12 @@
233235
</Border>
234236
</Popup>
235237

236-
<Separator Margin="3,0,3,0" Style="{StaticResource VerticalSeparator}" />
238+
<Separator Style="{StaticResource VerticalSeparator}" />
237239

238240
<ui:GitHubActionLink x:Name="authorSelection"
239-
Margin="5,0,0,0"
241+
Margin="5,0"
240242
VerticalAlignment="Center"
243+
ToolTip="Filter by author"
241244
Content="{Binding SelectedAuthor,
242245
Converter={ui:DefaultValueConverter},
243246
ConverterParameter=Author}"
@@ -289,7 +292,6 @@
289292
RelativeSource={RelativeSource FindAncestor,
290293
AncestorType={x:Type local:PullRequestListView}}}"
291294
Content="Create New" />
292-
293295
</Grid>
294296

295297
<ListView x:Name="pullRequests"

0 commit comments

Comments
 (0)