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="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void NewTab(object sender, RoutedEventArgs e) { private void NewTab(object sender, RoutedEventArgs e) {
var tab = new Tab() { Page = new Manager() }; var tab = new Tab() { Page = new NewPage() };
Tabs.Add(tab); Tabs.Add(tab);
openedTabs.SelectedItem = tab; openedTabs.SelectedItem = tab;
} }

View file

@ -1,5 +1,5 @@
<UserControl <UserControl
x:Class="SourceGit.UI.Manager" x:Class="SourceGit.UI.NewPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -18,41 +18,48 @@
<Grid> <Grid>
<!-- Main Body --> <!-- Main Body -->
<Grid Background="{StaticResource Brush.BG1}" HorizontalAlignment="Center" MinWidth="420" TextElement.FontFamily="Consolas"> <Grid HorizontalAlignment="Center" MinWidth="420" TextElement.FontFamily="Consolas">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </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 --> <!-- Welcome -->
<StackPanel Orientation="Vertical" Margin="0,64,0,0"> <TextBlock Grid.Row="1" Margin="0,16" HorizontalAlignment="Center" Text="Welcome to SourceGit :)" FontSize="28" FontWeight="ExtraBold" Foreground="{StaticResource Brush.FG2}"/>
<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}"/> <!-- Options -->
<Grid Margin="0,0,0,36"> <Grid Grid.Row="2" Margin="0,0,0,36">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/> <ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Click="OpenOrAddRepo" Grid.Column="0" Style="{StaticResource Style.Button.Bordered}"> <Button Click="OpenOrAddRepo" Grid.Column="0" Style="{StaticResource Style.Button.Bordered}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Folder}"/> <Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Folder}"/>
<Label Margin="4,0,0,0" Content="Open Local Repository"/> <Label Margin="4,0,0,0" Content="Open Local Repository"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="CloneRepo" Grid.Column="2" Style="{StaticResource Style.Button.Bordered}"> <Button Click="CloneRepo" Grid.Column="2" Style="{StaticResource Style.Button.Bordered}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Pull}"/> <Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Pull}"/>
<Label Margin="4,0,0,0" Content="Clone Remote Repository"/> <Label Margin="4,0,0,0" Content="Clone Remote Repository"/>
</StackPanel> </StackPanel>
</Button> </Button>
</Grid> </Grid>
<Rectangle Height=".5" Fill="{StaticResource Brush.Border1}"/>
</StackPanel> <!-- Horizontal Line -->
<Rectangle Grid.Row="3" Height="1" Fill="{StaticResource Brush.Border1}"/>
<!-- Repositories' tree --> <!-- Repositories' tree -->
<Grid Grid.Row="1" Margin="0,8,0,0"> <Grid Grid.Row="4" Margin="0,8,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
@ -64,7 +71,7 @@
</Grid> </Grid>
<TreeView <TreeView
x:Name="repositories" x:Name="repositories"
Grid.Row="2" Grid.Row="5"
Margin="0,4" Margin="0,4"
Padding="0" Padding="0"
AllowDrop="True" AllowDrop="True"

View file

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