style<NewPage>: rename Manager to NewPage; change layout of NewPage content

This commit is contained in:
leo 2021-01-03 19:49:57 +08:00
parent 22d3146866
commit 007690b000
3 changed files with 39 additions and 32 deletions

View file

@ -167,7 +167,7 @@ namespace SourceGit.UI {
/// <param name="sender"></param>
/// <param name="e"></param>
private void NewTab(object sender, RoutedEventArgs e) {
var tab = new Tab() { Page = new Manager() };
var tab = new Tab() { Page = new NewPage() };
Tabs.Add(tab);
openedTabs.SelectedItem = tab;
}

View file

@ -1,5 +1,5 @@
<UserControl
x:Class="SourceGit.UI.Manager"
x:Class="SourceGit.UI.NewPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -18,18 +18,24 @@
<Grid>
<!-- Main Body -->
<Grid Background="{StaticResource Brush.BG1}" HorizontalAlignment="Center" MinWidth="420" TextElement.FontFamily="Consolas">
<Grid HorizontalAlignment="Center" MinWidth="420" TextElement.FontFamily="Consolas">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Logo -->
<Path Grid.Row="0" Margin="0,48,0,0" Width="72" Height="72" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Git}" Fill="#FFF05133"/>
<!-- Welcome -->
<StackPanel Orientation="Vertical" Margin="0,64,0,0">
<Path Width="72" Height="72" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Git}" Fill="#FFF05133"/>
<TextBlock Grid.Column="0" Margin="0,16" HorizontalAlignment="Center" Text="Welcome to SourceGit :)" FontSize="26" FontWeight="ExtraBold" Foreground="{StaticResource Brush.FG2}"/>
<Grid Margin="0,0,0,36">
<TextBlock Grid.Row="1" Margin="0,16" HorizontalAlignment="Center" Text="Welcome to SourceGit :)" FontSize="28" FontWeight="ExtraBold" Foreground="{StaticResource Brush.FG2}"/>
<!-- Options -->
<Grid Grid.Row="2" Margin="0,0,0,36">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
@ -48,11 +54,12 @@
</StackPanel>
</Button>
</Grid>
<Rectangle Height=".5" Fill="{StaticResource Brush.Border1}"/>
</StackPanel>
<!-- Horizontal Line -->
<Rectangle Grid.Row="3" Height="1" Fill="{StaticResource Brush.Border1}"/>
<!-- Repositories' tree -->
<Grid Grid.Row="1" Margin="0,8,0,0">
<Grid Grid.Row="4" Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
@ -64,7 +71,7 @@
</Grid>
<TreeView
x:Name="repositories"
Grid.Row="2"
Grid.Row="5"
Margin="0,4"
Padding="0"
AllowDrop="True"

View file

@ -9,9 +9,9 @@ using System.Windows.Media;
namespace SourceGit.UI {
/// <summary>
/// Repository manager.
/// New page to open repository.
/// </summary>
public partial class Manager : UserControl {
public partial class NewPage : UserControl {
/// <summary>
/// Used to build tree
@ -30,7 +30,7 @@ namespace SourceGit.UI {
/// <summary>
/// Constructor.
/// </summary>
public Manager() {
public NewPage() {
InitializeComponent();
UpdateTree();
}