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

Commit be5bb2b

Browse files
committed
Merge pull request #264 from github/fixes/234-text-cut
GitHub section of Home page is cut when large font is used
2 parents d1dad3f + 7f89f1e commit be5bb2b

File tree

2 files changed

+44
-48
lines changed

2 files changed

+44
-48
lines changed

src/GitHub.App/SampleData/SampleViewModels.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ public class GitHubHomeSectionDesigner : IGitHubHomeSection
525525
{
526526
public GitHubHomeSectionDesigner()
527527
{
528-
Icon = Octicon.@lock;
528+
Icon = Octicon.repo;
529529
RepoName = "octokit";
530-
RepoUrl = "https://github.com/octokit/octokit.net";
530+
RepoUrl = "https://github.com/octokit/something-really-long-here-to-check-for-trimming";
531531
}
532532

533533
public Octicon Icon
Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
11
<UserControl x:Class="GitHub.VisualStudio.UI.Views.GitHubHomeContent"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
4+
xmlns:cache="clr-namespace:GitHub.VisualStudio.Helpers"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:GitHub.VisualStudio.UI.Views"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:sampleData="clr-namespace:GitHub.SampleData;assembly=GitHub.App"
88
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
9-
xmlns:cache="clr-namespace:GitHub.VisualStudio.Helpers"
10-
mc:Ignorable="d"
9+
Width="Auto"
10+
Height="auto"
11+
Background="{DynamicResource GitHubVsToolWindowBackground}"
12+
DataContext="{Binding ViewModel}"
1113
d:DesignHeight="48"
12-
Height="48"
1314
d:DesignWidth="300"
14-
DataContext="{Binding ViewModel}"
15-
Background="{DynamicResource GitHubVsToolWindowBackground}"
16-
>
17-
<d:DesignProperties.DataContext>
18-
<Binding>
19-
<Binding.Source>
20-
<sampleData:GitHubHomeSectionDesigner />
21-
</Binding.Source>
22-
</Binding>
23-
</d:DesignProperties.DataContext>
15+
mc:Ignorable="d">
16+
<d:DesignProperties.DataContext>
17+
<Binding>
18+
<Binding.Source>
19+
<sampleData:GitHubHomeSectionDesigner />
20+
</Binding.Source>
21+
</Binding>
22+
</d:DesignProperties.DataContext>
2423

25-
<UserControl.Resources>
26-
<ResourceDictionary>
27-
<ResourceDictionary.MergedDictionaries>
28-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio;component/SharedDictionary.xaml" />
29-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
30-
</ResourceDictionary.MergedDictionaries>
31-
<Style TargetType="Label">
32-
<Setter Property="Padding" Value="0" />
33-
</Style>
34-
</ResourceDictionary>
35-
</UserControl.Resources>
24+
<UserControl.Resources>
25+
<ResourceDictionary>
26+
<ResourceDictionary.MergedDictionaries>
27+
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio;component/SharedDictionary.xaml" />
28+
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
29+
</ResourceDictionary.MergedDictionaries>
30+
</ResourceDictionary>
31+
</UserControl.Resources>
3632

37-
<StackPanel Margin="8,0">
38-
<Grid Margin="0,6,-4,6">
39-
<Grid.ColumnDefinitions>
40-
<ColumnDefinition ColumnDefinition.Width="Auto" />
41-
<ColumnDefinition ColumnDefinition.Width="*" />
42-
</Grid.ColumnDefinitions>
4333

44-
<ui:OcticonImage
45-
x:Name="repositoryIcon"
46-
Height="32"
47-
Width="32"
48-
VerticalAlignment="Center"
49-
Margin="0,0,8,0"
50-
Icon="{Binding Path=Icon}"
51-
Foreground="{DynamicResource GitHubVsToolWindowText}" />
34+
<DockPanel Margin="4,6,4,6">
35+
<ui:OcticonImage x:Name="repositoryIcon"
36+
Width="32"
37+
Height="32"
38+
Margin="0,0,8,0"
39+
VerticalAlignment="Center"
40+
DockPanel.Dock="Left"
41+
Foreground="{DynamicResource GitHubVsToolWindowText}"
42+
Icon="{Binding Path=Icon}" />
5243

53-
<StackPanel Orientation="Vertical" Margin="0" Grid.Column="1">
54-
<Label Content="{Binding Path=RepoName}" Foreground="{DynamicResource GitHubVsToolWindowText}"/>
55-
<Label Content="{Binding Path=RepoUrl}" Foreground="{DynamicResource GitHubVsGrayText}" />
56-
</StackPanel>
57-
</Grid>
58-
</StackPanel>
44+
<TextBlock DockPanel.Dock="Top"
45+
Foreground="{DynamicResource GitHubVsToolWindowText}"
46+
Padding="0"
47+
Text="{Binding Path=RepoName}"
48+
TextTrimming="CharacterEllipsis"
49+
Margin="0,-2,0,0" />
50+
<TextBlock Foreground="{DynamicResource GitHubVsGrayText}"
51+
Padding="0"
52+
Text="{Binding Path=RepoUrl}"
53+
TextTrimming="CharacterEllipsis" />
54+
</DockPanel>
5955
</UserControl>

0 commit comments

Comments
 (0)