Skip to content

Commit 8034b25

Browse files
committed
Update StartPage
1 parent c59c28f commit 8034b25

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

Signal-Windows/Assets/logo-idea-2.png

408 KB
Loading

Signal-Windows/Signal-Windows.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<Content Include="Assets\LargeTile.scale-200.png" />
104104
<Content Include="Assets\LargeTile.scale-400.png" />
105105
<Content Include="Assets\LICENSE.TXT" />
106+
<Content Include="Assets\logo-idea-2.png" />
106107
<Content Include="Assets\SmallTile.scale-100.png" />
107108
<Content Include="Assets\SmallTile.scale-125.png" />
108109
<Content Include="Assets\SmallTile.scale-150.png" />

Signal-Windows/Views/StartPage.xaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,12 @@
2323
</ResourceDictionary>
2424
</Page.Resources>
2525

26-
<Grid Padding="20" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
27-
<Grid.RowDefinitions>
28-
<RowDefinition Height="Auto" />
29-
<RowDefinition Height="Auto" />
30-
<RowDefinition Height="Auto" />
31-
</Grid.RowDefinitions>
32-
<StackPanel Grid.Row="0" Margin="20">
33-
<Button HorizontalAlignment="Center" Foreground="#2190EA" Background="White" Click="Button_Click">Register a new Signal account</Button>
34-
<TextBlock HorizontalAlignment="Center" Foreground="White" TextWrapping="WrapWholeWords" Margin="0 15 0 0">Registering a new Signal account will terminate any previously registered accounts associated with your phone number, and unlink all slave devices.</TextBlock>
35-
</StackPanel>
36-
<StackPanel Grid.Row="1" Margin="20">
37-
<Button HorizontalAlignment="Center" Foreground="#2190EA" Background="White" Click="Button_Click_1">Link to an existing Signal account</Button>
38-
<TextBlock HorizontalAlignment="Center" Foreground="White" TextWrapping="WrapWholeWords" Margin="0 15 0 0">Link this device to an existing Signal master device. We will keep all contacts, groups and messages in sync.</TextBlock>
26+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
27+
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
28+
<Image Source="ms-appx:///Assets/logo-idea-2.png" Width="256"/>
29+
<TextBlock Text="Welcome to Signal for Windows" Foreground="White" FontSize="46" FontWeight="Light" HorizontalAlignment="Center" Margin="0,50,0,0"/>
30+
<Button x:Name="RegisterButton" HorizontalAlignment="Center" Foreground="#2190EA" Background="White" Content="Register a new Signal account" Margin="0,50,0,0" Click="RegisterButton_Click"/>
31+
<Button x:Name="LinkButton" HorizontalAlignment="Center" Foreground="#2190EA" Background="White" Content="Link to an existing Signal account" Margin="0,20,0,0" Click="LinkButton_Click"/>
3932
</StackPanel>
4033
</Grid>
4134
</Page>

Signal-Windows/Views/StartPage.xaml.cs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
using System;
12
using Signal_Windows.ViewModels;
3+
using Windows.UI.Popups;
4+
using Windows.UI.ViewManagement;
25
using Windows.UI.Xaml;
36
using Windows.UI.Xaml.Controls;
7+
using Windows.UI.Xaml.Media;
48
using Windows.UI.Xaml.Navigation;
59

610
// Die Elementvorlage "Leere Seite" wird unter https://go.microsoft.com/fwlink/?LinkId=234238 dokumentiert.
@@ -12,6 +16,8 @@ namespace Signal_Windows.Views
1216
/// </summary>
1317
public sealed partial class StartPage : Page
1418
{
19+
private const string ContinueId = "continue";
20+
1521
public StartPage()
1622
{
1723
this.InitializeComponent();
@@ -29,14 +35,31 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
2935
{
3036
base.OnNavigatedTo(e);
3137
Utils.DisableBackButton();
38+
var view = ApplicationView.GetForCurrentView();
39+
view.TitleBar.BackgroundColor = Utils.Default.Color;
40+
view.TitleBar.ButtonBackgroundColor = Utils.Default.Color;
41+
}
42+
43+
private async void RegisterButton_Click(object sender, RoutedEventArgs e)
44+
{
45+
var registerDialog = new MessageDialog("Registering a new Signal account will terminate any previously " +
46+
"registered accounts associated with your phone number and unlink all slave devices.");
47+
registerDialog.Commands.Add(new UICommand("Continue", new UICommandInvokedHandler(RegisterDialogHandler), ContinueId));
48+
registerDialog.Commands.Add(new UICommand("Cancel"));
49+
registerDialog.DefaultCommandIndex = 1;
50+
registerDialog.CancelCommandIndex = 1;
51+
await registerDialog.ShowAsync();
3252
}
3353

34-
private void Button_Click(object sender, RoutedEventArgs e)
54+
private void RegisterDialogHandler(IUICommand command)
3555
{
36-
Frame.Navigate(typeof(RegisterPage));
56+
if ((string)command.Id == ContinueId)
57+
{
58+
Frame.Navigate(typeof(RegisterPage));
59+
}
3760
}
3861

39-
private void Button_Click_1(object sender, RoutedEventArgs e)
62+
private void LinkButton_Click(object sender, RoutedEventArgs e)
4063
{
4164
Frame.Navigate(typeof(LinkPage));
4265
}

0 commit comments

Comments
 (0)