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

Commit b2810aa

Browse files
committed
Begin implementing comment styles
1 parent 4e38c00 commit b2810aa

File tree

1 file changed

+81
-66
lines changed

1 file changed

+81
-66
lines changed

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

Lines changed: 81 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,17 @@
3838
<Grid>
3939
<!-- Displays an existing comment-->
4040
<Border BorderBrush="{DynamicResource VsBrush.ButtonBorder}" BorderThickness="1" HorizontalAlignment="Stretch" Margin="0 0 0 4">
41-
<StackPanel Orientation="Vertical" Margin="4">
42-
<StackPanel.Style>
41+
<Grid Background="{DynamicResource VsBrush.ToolWindowBackground}">
42+
<Grid.ColumnDefinitions>
43+
<ColumnDefinition Width="4" />
44+
<ColumnDefinition Width="*" />
45+
</Grid.ColumnDefinitions>
46+
47+
<Grid.RowDefinitions>
48+
<RowDefinition Height="Auto" />
49+
</Grid.RowDefinitions>
50+
51+
<Grid.Style>
4352
<Style TargetType="FrameworkElement">
4453
<Setter Property="Visibility" Value="Collapsed"/>
4554
<Style.Triggers>
@@ -48,70 +57,76 @@
4857
</DataTrigger>
4958
</Style.Triggers>
5059
</Style>
51-
</StackPanel.Style>
52-
53-
<DockPanel>
54-
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" >
55-
<controls:AccountAvatar Width="16"
56-
Height="16"
57-
Account="{Binding Author}"/>
58-
59-
<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" FontWeight="Bold" Text="{Binding Author.Login}" Margin="4 0"/>
60-
<ui:GitHubActionLink Content="{Binding UpdatedAt, Converter={ui:DurationToStringConverter}}"
61-
Command="{Binding OpenOnGitHub}"
62-
Foreground="{DynamicResource GitHubVsToolWindowText}"
63-
Opacity="0.75" />
64-
<Border Background="{DynamicResource VsBrush.InfoBackground}"
65-
BorderBrush="{DynamicResource VsBrush.AccentPale}"
66-
BorderThickness="1"
67-
CornerRadius="3"
68-
Padding="2 1"
69-
Visibility="{Binding IsPending, Converter={ui:BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
70-
<TextBlock FontSize="10" Text="{x:Static ghfvs:Resources.Pending}" />
71-
</Border>
72-
</StackPanel>
73-
74-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" DockPanel.Dock="Right"
75-
Visibility="{Binding CanDelete, Converter={ui:BooleanToVisibilityConverter}}">
76-
<ui:OcticonButton Command="{Binding BeginEdit}"
77-
Height="16"
78-
Width="20"
79-
Margin="0 0 4 0"
80-
Background="Transparent"
81-
Foreground="{DynamicResource GitHubVsToolWindowText}"
82-
Icon="pencil"/>
83-
<ui:OcticonButton Command="{Binding Delete}"
84-
Width="16"
85-
Height="16"
86-
Margin="0"
87-
Background="Transparent"
88-
Foreground="{DynamicResource GitHubVsToolWindowText}"
89-
Icon="x"/>
90-
</StackPanel>
91-
</DockPanel>
92-
93-
<markdig:MarkdownViewer Grid.Column="1" Grid.Row="1"
94-
Margin="0 2 0 0"
95-
Foreground="{DynamicResource VsBrush.WindowText}"
96-
Markdown="{Binding Body}"/>
97-
98-
<DockPanel Grid.Column="1" Grid.Row="2"
99-
Margin="0 4"
100-
HorizontalAlignment="Left"
101-
TextBlock.Foreground="Red">
102-
<DockPanel.Style>
103-
<Style TargetType="FrameworkElement">
104-
<Style.Triggers>
105-
<DataTrigger Binding="{Binding ErrorMessage}" Value="{x:Null}">
106-
<Setter Property="Visibility" Value="Collapsed"/>
107-
</DataTrigger>
108-
</Style.Triggers>
109-
</Style>
110-
</DockPanel.Style>
111-
<ui:OcticonImage DockPanel.Dock="Left" Icon="alert" Margin="0 0 4 0"/>
112-
<TextBlock Text="{Binding ErrorMessage}" TextWrapping="Wrap"/>
113-
</DockPanel>
114-
</StackPanel>
60+
</Grid.Style>
61+
62+
<StackPanel Background="#82909e" Grid.Row="0" Grid.Column="0" Grid.RowSpan="5" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Notice}}" />
63+
64+
<Border Grid.Column="1" Padding="8">
65+
<StackPanel>
66+
<DockPanel>
67+
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" >
68+
<controls:AccountAvatar Width="16"
69+
Height="16"
70+
Account="{Binding Author}"/>
71+
72+
<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" FontWeight="Bold" Text="{Binding Author.Login}" Margin="4 0"/>
73+
<ui:GitHubActionLink Content="{Binding UpdatedAt, Converter={ui:DurationToStringConverter}}"
74+
Command="{Binding OpenOnGitHub}"
75+
Foreground="{DynamicResource GitHubVsToolWindowText}"
76+
Opacity="0.75" />
77+
<Border Background="{DynamicResource VsBrush.InfoBackground}"
78+
BorderBrush="{DynamicResource VsBrush.AccentPale}"
79+
BorderThickness="1"
80+
CornerRadius="3"
81+
Padding="2 1"
82+
Visibility="{Binding IsPending, Converter={ui:BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
83+
<TextBlock FontSize="10" Text="{x:Static ghfvs:Resources.Pending}" />
84+
</Border>
85+
</StackPanel>
86+
87+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" DockPanel.Dock="Right"
88+
Visibility="{Binding CanDelete, Converter={ui:BooleanToVisibilityConverter}}">
89+
<ui:OcticonButton Command="{Binding BeginEdit}"
90+
Height="16"
91+
Width="20"
92+
Margin="0 0 4 0"
93+
Background="Transparent"
94+
Foreground="{DynamicResource GitHubVsToolWindowText}"
95+
Icon="pencil"/>
96+
<ui:OcticonButton Command="{Binding Delete}"
97+
Width="16"
98+
Height="16"
99+
Margin="0"
100+
Background="Transparent"
101+
Foreground="{DynamicResource GitHubVsToolWindowText}"
102+
Icon="x"/>
103+
</StackPanel>
104+
</DockPanel>
105+
106+
<markdig:MarkdownViewer Grid.Column="1" Grid.Row="1"
107+
Margin="0 2 0 0"
108+
Foreground="{DynamicResource VsBrush.WindowText}"
109+
Markdown="{Binding Body}"/>
110+
111+
<DockPanel Grid.Column="1" Grid.Row="2"
112+
Margin="0 4"
113+
HorizontalAlignment="Left"
114+
TextBlock.Foreground="Red">
115+
<DockPanel.Style>
116+
<Style TargetType="FrameworkElement">
117+
<Style.Triggers>
118+
<DataTrigger Binding="{Binding ErrorMessage}" Value="{x:Null}">
119+
<Setter Property="Visibility" Value="Collapsed"/>
120+
</DataTrigger>
121+
</Style.Triggers>
122+
</Style>
123+
</DockPanel.Style>
124+
<ui:OcticonImage DockPanel.Dock="Left" Icon="alert" Margin="0 0 4 0"/>
125+
<TextBlock Text="{Binding ErrorMessage}" TextWrapping="Wrap"/>
126+
</DockPanel>
127+
</StackPanel>
128+
</Border>
129+
</Grid>
115130
</Border>
116131

117132
<!-- Displays edit view or a reply placeholder-->

0 commit comments

Comments
 (0)