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

Commit 7be63b0

Browse files
authored
Merge pull request #670 from github/grokys/start-page-clone
Update the start page clone dialog.
2 parents c9b990f + 51a39dd commit 7be63b0

File tree

2 files changed

+10
-218
lines changed

2 files changed

+10
-218
lines changed

src/GitHub.App/ViewModels/StartPageCloneViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ public StartPageCloneViewModel(
6464

6565
Title = string.Format(CultureInfo.CurrentCulture, Resources.CloneTitle, repositoryHost.Title);
6666

67-
var baseRepositoryPath = this.WhenAnyValue(x => x.BaseRepositoryPath);
67+
var baseRepositoryPath = this.WhenAny(
68+
x => x.BaseRepositoryPath,
69+
x => x.SelectedRepository,
70+
(x, y) => x.Value);
6871

6972
BaseRepositoryPathValidator = ReactivePropertyValidator.ForObservable(baseRepositoryPath)
7073
.IfNullOrEmpty(Resources.RepositoryCreationClonePathEmpty)

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

Lines changed: 6 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -40,140 +40,8 @@
4040
<Setter Property="Height" Value="30" />
4141
<Setter Property="Margin" Value="0" />
4242
</Style>
43-
44-
<Style x:Key="expanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
45-
<Setter Property="Template">
46-
<Setter.Value>
47-
<ControlTemplate TargetType="{x:Type ToggleButton}">
48-
<Border Padding="{TemplateBinding Padding}" Style="{StaticResource repositoryBorderStyle}">
49-
<StackPanel Background="#F8F8F8" Orientation="Horizontal">
50-
<ui:OcticonImage x:Name="arrow"
51-
Height="10"
52-
Margin="5,0,0,0"
53-
Foreground="Black"
54-
Icon="triangle_right" />
55-
<ContentPresenter Margin="0"
56-
HorizontalAlignment="Left"
57-
VerticalAlignment="Center"
58-
RecognizesAccessKey="True"
59-
SnapsToDevicePixels="True" />
60-
</StackPanel>
61-
</Border>
62-
63-
<ControlTemplate.Triggers>
64-
<Trigger Property="IsChecked" Value="True">
65-
<Setter TargetName="arrow" Property="Icon" Value="triangle_down" />
66-
</Trigger>
67-
</ControlTemplate.Triggers>
68-
</ControlTemplate>
69-
</Setter.Value>
70-
</Setter>
71-
</Style>
72-
73-
<Style x:Key="expanderHeaderFocusVisual">
74-
<Setter Property="Control.Template">
75-
<Setter.Value>
76-
<ControlTemplate>
77-
<Border>
78-
<Rectangle Margin="0"
79-
SnapsToDevicePixels="true"
80-
Stroke="Black"
81-
StrokeDashArray="1 2"
82-
StrokeThickness="1" />
83-
</Border>
84-
</ControlTemplate>
85-
</Setter.Value>
86-
</Setter>
87-
</Style>
88-
89-
<Style x:Key="cloneGroupExpander" TargetType="{x:Type Expander}">
90-
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
91-
<Setter Property="Background" Value="Transparent" />
92-
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
93-
<Setter Property="VerticalContentAlignment" Value="Stretch" />
94-
<Setter Property="BorderBrush" Value="Transparent" />
95-
<Setter Property="BorderThickness" Value="0" />
96-
<Setter Property="Template">
97-
<Setter.Value>
98-
<ControlTemplate TargetType="{x:Type Expander}">
99-
<Border Background="{TemplateBinding Background}"
100-
BorderBrush="{TemplateBinding BorderBrush}"
101-
BorderThickness="{TemplateBinding BorderThickness}"
102-
CornerRadius="3"
103-
SnapsToDevicePixels="true">
104-
<DockPanel>
105-
<ToggleButton x:Name="HeaderSite"
106-
MinWidth="0"
107-
MinHeight="0"
108-
Margin="0"
109-
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
110-
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
111-
Content="{TemplateBinding Header}"
112-
ContentTemplate="{TemplateBinding HeaderTemplate}"
113-
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
114-
DockPanel.Dock="Top"
115-
FocusVisualStyle="{StaticResource expanderHeaderFocusVisual}"
116-
FontFamily="{TemplateBinding FontFamily}"
117-
FontSize="{TemplateBinding FontSize}"
118-
FontStretch="{TemplateBinding FontStretch}"
119-
FontStyle="{TemplateBinding FontStyle}"
120-
FontWeight="{TemplateBinding FontWeight}"
121-
Foreground="{TemplateBinding Foreground}"
122-
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
123-
Padding="{TemplateBinding Padding}"
124-
Style="{StaticResource expanderDownHeaderStyle}" />
125-
<ContentPresenter x:Name="ExpandSite"
126-
Margin="{TemplateBinding Padding}"
127-
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
128-
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
129-
DockPanel.Dock="Bottom"
130-
Focusable="false"
131-
Visibility="Collapsed" />
132-
</DockPanel>
133-
</Border>
134-
<ControlTemplate.Triggers>
135-
<Trigger Property="IsExpanded" Value="true">
136-
<Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
137-
</Trigger>
138-
<Trigger Property="IsEnabled" Value="false">
139-
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
140-
</Trigger>
141-
</ControlTemplate.Triggers>
142-
</ControlTemplate>
143-
</Setter.Value>
144-
</Setter>
145-
</Style>
14643
</DockPanel.Resources>
147-
148-
<ui:FilterTextBox x:Name="filterText"
149-
Margin="10"
150-
DockPanel.Dock="Top"
151-
PromptText="{x:Static prop:Resources.filterTextPromptText}"
152-
Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}"
153-
IsEnabled="{Binding FilterTextIsEnabled, Mode=OneWay}"/>
154-
155-
<ui:GitHubProgressBar x:Name="loadingProgressBar"
156-
Margin="0"
157-
HorizontalContentAlignment="Stretch"
158-
DockPanel.Dock="Top"
159-
Foreground="{DynamicResource GitHubAccentBrush}"
160-
IsIndeterminate="True"
161-
Style="{DynamicResource GitHubProgressBar}"
162-
Visibility="{Binding IsLoading, Mode=OneWay, Converter={ui:BooleanToVisibilityConverter}}" />
163-
164-
<StackPanel x:Name="loadingFailedPanel"
165-
Margin="0,4,0,4"
166-
HorizontalAlignment="Center"
167-
VerticalAlignment="Center"
168-
DockPanel.Dock="Top">
169-
<uirx:ErrorMessageDisplay x:Name="loadingFailedMessage"
170-
Margin="8,0"
171-
Content="{x:Static prop:Resources.loadingFailedMessageContent}"
172-
Icon="stop"
173-
Message="{x:Static prop:Resources.loadingFailedMessageMessage}"
174-
Visibility="{Binding LoadingFailed, Mode=OneWay, Converter={ui:BooleanToVisibilityConverter}}" />
175-
</StackPanel>
176-
44+
17745
<ui:OcticonCircleButton x:Name="cloneButton"
17846
Margin="12"
17947
HorizontalAlignment="Center"
@@ -240,90 +108,11 @@
240108
<Setter Property="Margin" Value="0,6,12,6" />
241109
</Style>
242110
</Border.Resources>
243-
<Grid Margin="0">
244-
<ListBox x:Name="repositoryList"
245-
HorizontalContentAlignment="Stretch"
246-
ItemsSource="{Binding Repositories}"
247-
SelectedItem="{Binding SelectedRepository}"
248-
Style="{DynamicResource LightListBox}">
249-
<ListBox.GroupStyle>
250-
<GroupStyle HidesIfEmpty="true">
251-
<GroupStyle.ContainerStyle>
252-
<Style TargetType="{x:Type GroupItem}">
253-
<Setter Property="Template">
254-
<Setter.Value>
255-
<ControlTemplate TargetType="{x:Type GroupItem}">
256-
<Expander IsExpanded="{Binding Name.IsExpanded}" Style="{StaticResource cloneGroupExpander}">
257-
<Expander.Header>
258-
<Border Style="{StaticResource repositoryBorderStyle}">
259-
<StackPanel Margin="0"
260-
VerticalAlignment="Center"
261-
Orientation="Horizontal">
262-
<Image x:Name="avatar"
263-
Width="16"
264-
Height="16"
265-
Margin="0,0,5,0"
266-
RenderOptions.BitmapScalingMode="HighQuality"
267-
Source="{Binding Items[0].Owner.Avatar}" />
268-
<TextBlock Style="{StaticResource cloneRepoHeaderStyle}" Text="{Binding Path=Name.Header}" />
269-
</StackPanel>
270-
</Border>
271-
</Expander.Header>
272-
<ItemsPresenter Margin="0" />
273-
</Expander>
274-
</ControlTemplate>
275-
</Setter.Value>
276-
</Setter>
277-
</Style>
278-
</GroupStyle.ContainerStyle>
279-
</GroupStyle>
280-
</ListBox.GroupStyle>
281-
<ListBox.ItemTemplate>
282-
<DataTemplate>
283-
<Border Style="{StaticResource repositoryBorderStyle}">
284-
<StackPanel Margin="0"
285-
VerticalAlignment="Center"
286-
Orientation="Horizontal">
287-
<ui:OcticonImage x:Name="iconPath"
288-
Width="16"
289-
Height="16"
290-
Margin="32,0,6,0"
291-
VerticalAlignment="Center"
292-
Foreground="#D0D0D0"
293-
Icon="{Binding Icon}" />
294-
295-
<ui:TrimmedTextBlock x:Name="label"
296-
VerticalAlignment="Center"
297-
Foreground="#666"
298-
Text="{Binding Name}"
299-
TextTrimming="CharacterEllipsis" />
300-
</StackPanel>
301-
</Border>
302-
<DataTemplate.Triggers>
303-
<MultiDataTrigger>
304-
<MultiDataTrigger.Conditions>
305-
<Condition Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}" Value="True" />
306-
<Condition Binding="{Binding Path=(Selector.IsSelectionActive), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}" Value="True" />
307-
</MultiDataTrigger.Conditions>
308-
<MultiDataTrigger.Setters>
309-
<Setter TargetName="iconPath" Property="Foreground" Value="White" />
310-
<Setter TargetName="label" Property="Foreground" Value="White" />
311-
</MultiDataTrigger.Setters>
312-
</MultiDataTrigger>
313-
</DataTemplate.Triggers>
314-
</DataTemplate>
315-
</ListBox.ItemTemplate>
316-
</ListBox>
317-
<StackPanel x:Name="noRepositoriesMessage"
318-
Margin="0,-70,0,0"
319-
HorizontalAlignment="Center"
320-
VerticalAlignment="Center"
321-
Visibility="{Binding NoRepositoriesFound, Mode=OneWay, Converter={ui:BooleanToVisibilityConverter}}">
322-
<TextBlock HorizontalAlignment="Center"
323-
Style="{DynamicResource GitHubH2TextBlock}"
324-
Text="{x:Static prop:Resources.noRepositoriesMessageText}" />
325-
</StackPanel>
326-
</Grid>
111+
<StackPanel>
112+
<ui:OcticonImage Icon="logo_github" Width="200" Height="200" VerticalAlignment="Top"/>
113+
<TextBlock HorizontalAlignment="Center">Clone:</TextBlock>
114+
<TextBlock HorizontalAlignment="Center" Text="{Binding SelectedRepository.CloneUrl}"/>
115+
</StackPanel>
327116
</Border>
328117
</DockPanel>
329118
</local:GenericStartPageCloneView>

0 commit comments

Comments
 (0)