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

Commit 08a9d24

Browse files
committed
Hide comment icon if there's no comments
1 parent 649387a commit 08a9d24

File tree

1 file changed

+8
-31
lines changed

1 file changed

+8
-31
lines changed

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

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio;component/SharedDictionary.xaml"/>
1313
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
1414
</ResourceDictionary.MergedDictionaries>
15-
<ui:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
16-
<ui:DurationToStringConverter x:Key="DurationToStringConverter" />
17-
15+
1816
<DataTemplate x:Key="PullRequestItemTemplate" DataType="models:IPullRequestModel">
1917
<Grid>
2018
<Grid.RowDefinitions>
@@ -70,19 +68,8 @@
7068
Width="16"
7169
Height="16"
7270
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>
71+
Foreground="{DynamicResource GitHubVsToolWindowText}"
72+
Visibility="{Binding CommentCount, Converter={ui:CountToVisibilityConverter}}" />
8673

8774
<TextBlock x:Name="comment_count"
8875
Grid.Row="0"
@@ -92,17 +79,8 @@
9279
VerticalAlignment="Top"
9380
FontFamily="Segoe UI"
9481
Foreground="{DynamicResource GitHubVsToolWindowText}"
95-
Text="{Binding CommentCount}">
96-
<TextBlock.Style>
97-
<Style>
98-
<Style.Triggers>
99-
<DataTrigger Binding="{Binding CommentCount}" Value="0">
100-
<Setter Property="FrameworkElement.IsEnabled" Value="False" />
101-
</DataTrigger>
102-
</Style.Triggers>
103-
</Style>
104-
</TextBlock.Style>
105-
</TextBlock>
82+
Text="{Binding CommentCount}"
83+
Visibility="{Binding CommentCount, Converter={ui:CountToVisibilityConverter}}" />
10684

10785
<ui:OcticonImage x:Name="comment_new"
10886
Grid.Row="0"
@@ -115,8 +93,7 @@
11593
Margin="0,3"
11694
Foreground="Green"
11795
Icon="primitive_dot"
118-
Visibility="{Binding HasNewComments,
119-
Converter={StaticResource BooleanToVisibilityConverter}}" />
96+
Visibility="{Binding HasNewComments, Converter={ui:BooleanToVisibilityConverter}}" />
12097
<Grid x:Name="status"
12198
Grid.Row="1"
12299
Grid.Column="1"
@@ -141,7 +118,7 @@
141118
Foreground="{DynamicResource GitHubVsGrayText}">
142119
<TextBlock.Text>
143120
<MultiBinding StringFormat="{} {0} {1} {2}">
144-
<Binding Converter="{StaticResource DurationToStringConverter}" Path="UpdatedAt" />
121+
<Binding Converter="{ui:DurationToStringConverter}" Path="UpdatedAt" />
145122
<Binding Source="{x:Static i18n:Resources.prOpenedByText}" />
146123
<Binding Path="Author.Login" />
147124
</MultiBinding>
@@ -153,7 +130,7 @@
153130
<TextBlock.Text>
154131
<MultiBinding StringFormat="{} {0} {1} {2} {3}">
155132
<Binding Source="{x:Static i18n:Resources.prOpenedText}" />
156-
<Binding Converter="{StaticResource DurationToStringConverter}" Path="UpdatedAt" />
133+
<Binding Converter="{ui:DurationToStringConverter}" Path="UpdatedAt" />
157134
<Binding Source="{x:Static i18n:Resources.prOpenedByText}" />
158135
<Binding Path="Author.Login" />
159136
</MultiBinding>

0 commit comments

Comments
 (0)