mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
refactor<*>: add Controls.Window to replace System.Windows.Window
This commit is contained in:
parent
31dd0eb832
commit
4b9923b84c
15 changed files with 842 additions and 879 deletions
|
@ -4,7 +4,7 @@
|
||||||
<SolidColorBrush x:Key="Brush.Logo" Color="#FFF05133"/>
|
<SolidColorBrush x:Key="Brush.Logo" Color="#FFF05133"/>
|
||||||
|
|
||||||
<SolidColorBrush x:Key="Brush.Window" Color="#FFF8F8F8"/>
|
<SolidColorBrush x:Key="Brush.Window" Color="#FFF8F8F8"/>
|
||||||
<SolidColorBrush x:Key="Brush.WindowBorder" Color="#FF505050"/>
|
<SolidColorBrush x:Key="Brush.WindowBorder" Color="#FF4295FF"/>
|
||||||
|
|
||||||
<SolidColorBrush x:Key="Brush.TitleBar" Color="White"/>
|
<SolidColorBrush x:Key="Brush.TitleBar" Color="White"/>
|
||||||
<SolidColorBrush x:Key="Brush.NewPageHover" Color="#1D000000"/>
|
<SolidColorBrush x:Key="Brush.NewPageHover" Color="#1D000000"/>
|
||||||
|
|
|
@ -1,97 +1,91 @@
|
||||||
<Window x:Class="SourceGit.Views.About"
|
<controls:Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="SourceGit.Views.About"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
UseLayoutRounding="True"
|
mc:Ignorable="d"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Title="{StaticResource Text.About}"
|
Title="{StaticResource Text.About}"
|
||||||
Height="280" Width="400"
|
Height="280" Width="400"
|
||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize">
|
||||||
<WindowChrome.WindowChrome>
|
<Grid>
|
||||||
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
|
<Grid.RowDefinitions>
|
||||||
</WindowChrome.WindowChrome>
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="1"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:WindowBorder>
|
<!-- Title bar -->
|
||||||
<Grid>
|
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="28"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="1"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.RowDefinitions>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Title bar -->
|
<!-- Icon -->
|
||||||
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Help}"/>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Title -->
|
||||||
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Help}"/>
|
<TextBlock Grid.Column="1" Text="{StaticResource Text.About}"/>
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Close -->
|
||||||
<TextBlock Grid.Column="1" Text="{StaticResource Text.About}"/>
|
<controls:IconButton
|
||||||
|
Grid.Column="3"
|
||||||
|
Click="Quit"
|
||||||
|
Width="28"
|
||||||
|
Padding="8"
|
||||||
|
Icon="{StaticResource Icon.Close}"
|
||||||
|
HoverBackground="Red"
|
||||||
|
WindowChrome.IsHitTestVisibleInChrome="True"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- Close -->
|
<Rectangle
|
||||||
<controls:IconButton
|
Grid.Row="1"
|
||||||
Grid.Column="3"
|
Height="1"
|
||||||
Click="Quit"
|
HorizontalAlignment="Stretch"
|
||||||
Width="28"
|
Fill="{StaticResource Brush.Border0}"/>
|
||||||
Padding="8"
|
|
||||||
Icon="{StaticResource Icon.Close}"
|
|
||||||
HoverBackground="Red"
|
|
||||||
WindowChrome.IsHitTestVisibleInChrome="True"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Rectangle
|
<!-- Content -->
|
||||||
Grid.Row="1"
|
<StackPanel Grid.Row="2" Orientation="Vertical">
|
||||||
Height="1"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Fill="{StaticResource Brush.Border0}"/>
|
|
||||||
|
|
||||||
<!-- Content -->
|
<!-- LOGO -->
|
||||||
<StackPanel Grid.Row="2" Orientation="Vertical">
|
<Path
|
||||||
|
Margin="0,16,0,0"
|
||||||
|
Width="64" Height="64"
|
||||||
|
Data="{StaticResource Icon.Git}"
|
||||||
|
Fill="{StaticResource Brush.Logo}"/>
|
||||||
|
|
||||||
<!-- LOGO -->
|
<!-- Title -->
|
||||||
<Path
|
<TextBlock
|
||||||
Margin="0,16,0,0"
|
Margin="0,24,0,8"
|
||||||
Width="64" Height="64"
|
Text="{StaticResource Text.About.Title}"
|
||||||
Data="{StaticResource Icon.Git}"
|
HorizontalAlignment="Center"
|
||||||
Fill="{StaticResource Brush.Logo}"/>
|
FontSize="18" FontWeight="Bold"/>
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Version -->
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,24,0,8"
|
x:Name="version"
|
||||||
Text="{StaticResource Text.About.Title}"
|
Margin="0,0,0,8"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
FontSize="18" FontWeight="Bold"/>
|
FontSize="11"
|
||||||
|
Text="VERSION: v1.0 .NET: v5.0"/>
|
||||||
|
|
||||||
<!-- Version -->
|
<!-- Official site -->
|
||||||
<TextBlock
|
<TextBlock HorizontalAlignment="Center" Margin="0,16,0,4">
|
||||||
x:Name="version"
|
|
||||||
Margin="0,0,0,8"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
FontSize="11"
|
|
||||||
Text="VERSION: v1.0 .NET: v5.0"/>
|
|
||||||
|
|
||||||
<!-- Official site -->
|
|
||||||
<TextBlock HorizontalAlignment="Center" Margin="0,16,0,4">
|
|
||||||
<Hyperlink NavigateUri="https://gitee.com/sourcegit/sourcegit.git" RequestNavigate="OnRequestNavigate">
|
<Hyperlink NavigateUri="https://gitee.com/sourcegit/sourcegit.git" RequestNavigate="OnRequestNavigate">
|
||||||
<Run Text="https://gitee.com/sourcegit/sourcegit.git"/>
|
<Run Text="https://gitee.com/sourcegit/sourcegit.git"/>
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<!-- Copyrights -->
|
<!-- Copyrights -->
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,4"
|
Margin="0,4"
|
||||||
Text="Copyright © sourcegit 2021. All rights reserved."
|
Text="Copyright © sourcegit 2021. All rights reserved."
|
||||||
HorizontalAlignment="Center"/>
|
HorizontalAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</controls:WindowBorder>
|
</controls:Window>
|
||||||
</Window>
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace SourceGit.Views {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关于对话框
|
/// 关于对话框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class About : Window {
|
public partial class About : Controls.Window {
|
||||||
|
|
||||||
public About() {
|
public About() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
|
@ -1,148 +1,139 @@
|
||||||
<Window x:Class="SourceGit.Views.Blame"
|
<controls:Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="SourceGit.Views.Blame"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
Title="{StaticResource Text.Blame}"
|
mc:Ignorable="d"
|
||||||
TextOptions.TextFormattingMode="Display"
|
Title="{StaticResource Text.Blame}"
|
||||||
TextOptions.TextRenderingMode="ClearType"
|
WindowStartupLocation="CenterOwner"
|
||||||
RenderOptions.ClearTypeHint="Enabled"
|
Height="600" Width="800">
|
||||||
UseLayoutRounding="True"
|
<Grid>
|
||||||
WindowStartupLocation="CenterOwner"
|
<Grid.RowDefinitions>
|
||||||
Height="600" Width="800">
|
<RowDefinition Height="28"/>
|
||||||
<WindowChrome.WindowChrome>
|
<RowDefinition Height="1"/>
|
||||||
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
|
<RowDefinition Height="24"/>
|
||||||
</WindowChrome.WindowChrome>
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:WindowBorder>
|
<!-- Title Bar -->
|
||||||
<Grid>
|
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="28"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="1"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="24"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<RowDefinition Height="*"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Title Bar -->
|
<!-- Icon -->
|
||||||
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Commit}"/>
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<TextBlock Grid.Column="1" Text="{StaticResource Text.Blame}"/>
|
||||||
|
|
||||||
|
<!-- Window Commands -->
|
||||||
|
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
|
||||||
|
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
|
||||||
|
<controls:IconButton Click="MaximizeOrRestore" Width="28" Padding="8" Icon="{StaticResource Icon.Maximize}" HoverBackground="#40000000" Opacity="1"/>
|
||||||
|
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Line -->
|
||||||
|
<Rectangle
|
||||||
|
Grid.Row="1"
|
||||||
|
Height="1"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Fill="{StaticResource Brush.Border0}"/>
|
||||||
|
|
||||||
|
<!-- Description -->
|
||||||
|
<Border Grid.Row="2">
|
||||||
|
<Grid Margin="4,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Icon -->
|
<TextBlock Grid.Column="0" x:Name="txtFile" FontSize="11" Foreground="{StaticResource Brush.FG2}" FontFamily="Consolas"/>
|
||||||
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Commit}"/>
|
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Foreground="{StaticResource Brush.FG2}" FontFamily="11" Text="{StaticResource Text.Blame.Tip}"/>
|
||||||
|
|
||||||
<!-- Title -->
|
|
||||||
<TextBlock Grid.Column="1" Text="{StaticResource Text.Blame}"/>
|
|
||||||
|
|
||||||
<!-- Window Commands -->
|
|
||||||
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
|
|
||||||
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
|
|
||||||
<controls:IconButton Click="MaximizeOrRestore" Width="28" Padding="8" Icon="{StaticResource Icon.Maximize}" HoverBackground="#40000000" Opacity="1"/>
|
|
||||||
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<!-- Line -->
|
<!-- Viewer -->
|
||||||
<Rectangle
|
<DataGrid
|
||||||
Grid.Row="1"
|
Grid.Row="3"
|
||||||
Height="1"
|
x:Name="blame"
|
||||||
HorizontalAlignment="Stretch"
|
GridLinesVisibility="Vertical"
|
||||||
Fill="{StaticResource Brush.Border0}"/>
|
VerticalGridLinesBrush="{StaticResource Brush.Border2}"
|
||||||
|
BorderBrush="{StaticResource Brush.Border2}"
|
||||||
|
BorderThickness="1"
|
||||||
|
FrozenColumnCount="1"
|
||||||
|
RowHeight="16"
|
||||||
|
SelectionUnit="FullRow"
|
||||||
|
SelectionMode="Single"
|
||||||
|
FontFamily="Consolas"
|
||||||
|
SizeChanged="OnViewerSizeChanged">
|
||||||
|
|
||||||
|
<DataGrid.RowStyle>
|
||||||
|
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
|
||||||
|
<EventSetter Event="RequestBringIntoView" Handler="OnViewerRequestBringIntoView"/>
|
||||||
|
<EventSetter Event="ContextMenuOpening" Handler="OnViewerContextMenuOpening"/>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.RowStyle>
|
||||||
|
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Width="Auto" IsReadOnly="True" Binding="{Binding Line.LineNumber}" ElementStyle="{StaticResource Style.TextBlock.LineNumber}"/>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Width="SizeToCells" MinWidth="1" IsReadOnly="True">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border Background="{Binding BG}" BorderThickness="0">
|
||||||
|
<TextBlock Text="{Binding Line.Content}" Background="Transparent" Foreground="{StaticResource Brush.FG1}" FontFamily="Consolas,Microsoft YaHei UI" FontSize="9pt" Margin="0" Padding="2,0,0,0"/>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
x:Name="notSupport"
|
||||||
|
Grid.Row="3"
|
||||||
|
Orientation="Vertical"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||||
|
Background="{StaticResource Brush.Window}"
|
||||||
|
Visibility="Collapsed">
|
||||||
|
<Path Width="64" Height="64" Data="{StaticResource Icon.Error}" Fill="{StaticResource Brush.FG2}"/>
|
||||||
|
<TextBlock Text="{StaticResource Text.BlameTypeNotSupported}" Margin="0,16,0,0" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{StaticResource Brush.FG2}"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Loading -->
|
||||||
|
<controls:Loading x:Name="loading" Grid.Row="3" Width="48" Height="48" IsAnimating="True"/>
|
||||||
|
|
||||||
|
<!-- Popup to show commit info -->
|
||||||
|
<Popup x:Name="popup" Grid.Row="3" Placement="MousePoint" IsOpen="False" StaysOpen="False" Focusable="True">
|
||||||
|
<Border BorderBrush="{StaticResource Brush.Accent1}" BorderThickness="1" Background="{StaticResource Brush.Popup}">
|
||||||
|
<Grid Margin="4">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="24"/>
|
||||||
|
<RowDefinition Height="24"/>
|
||||||
|
<RowDefinition Height="24"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Description -->
|
|
||||||
<Border Grid.Row="2">
|
|
||||||
<Grid Margin="4,0">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Column="0" x:Name="txtFile" FontSize="11" Foreground="{StaticResource Brush.FG2}" FontFamily="Consolas"/>
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.Blame.SHA}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
|
||||||
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Foreground="{StaticResource Brush.FG2}" FontFamily="11" Text="{StaticResource Text.Blame.Tip}"/>
|
<Label Grid.Row="0" Grid.Column="1" x:Name="commitID" Margin="8,0,4,0" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.Blame.Author}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="1" x:Name="authorName" Margin="8,0,4,0"/>
|
||||||
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="{StaticResource Text.Blame.ModifyTime}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
|
||||||
|
<TextBlock Grid.Row="2" Grid.Column="1" x:Name="authorTime" Margin="8,0,4,0"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
</Popup>
|
||||||
<!-- Viewer -->
|
</Grid>
|
||||||
<DataGrid
|
</controls:Window>
|
||||||
Grid.Row="3"
|
|
||||||
x:Name="blame"
|
|
||||||
GridLinesVisibility="Vertical"
|
|
||||||
VerticalGridLinesBrush="{StaticResource Brush.Border2}"
|
|
||||||
BorderBrush="{StaticResource Brush.Border2}"
|
|
||||||
BorderThickness="1"
|
|
||||||
FrozenColumnCount="1"
|
|
||||||
RowHeight="16"
|
|
||||||
SelectionUnit="FullRow"
|
|
||||||
SelectionMode="Single"
|
|
||||||
FontFamily="Consolas"
|
|
||||||
SizeChanged="OnViewerSizeChanged">
|
|
||||||
|
|
||||||
<DataGrid.RowStyle>
|
|
||||||
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
|
|
||||||
<EventSetter Event="RequestBringIntoView" Handler="OnViewerRequestBringIntoView"/>
|
|
||||||
<EventSetter Event="ContextMenuOpening" Handler="OnViewerContextMenuOpening"/>
|
|
||||||
</Style>
|
|
||||||
</DataGrid.RowStyle>
|
|
||||||
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn Width="Auto" IsReadOnly="True" Binding="{Binding Line.LineNumber}" ElementStyle="{StaticResource Style.TextBlock.LineNumber}"/>
|
|
||||||
|
|
||||||
<DataGridTemplateColumn Width="SizeToCells" MinWidth="1" IsReadOnly="True">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border Background="{Binding BG}" BorderThickness="0">
|
|
||||||
<TextBlock Text="{Binding Line.Content}" Background="Transparent" Foreground="{StaticResource Brush.FG1}" FontFamily="Consolas,Microsoft YaHei UI" FontSize="9pt" Margin="0" Padding="2,0,0,0"/>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
|
|
||||||
<StackPanel
|
|
||||||
x:Name="notSupport"
|
|
||||||
Grid.Row="3"
|
|
||||||
Orientation="Vertical"
|
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
||||||
Background="{StaticResource Brush.Window}"
|
|
||||||
Visibility="Collapsed">
|
|
||||||
<Path Width="64" Height="64" Data="{StaticResource Icon.Error}" Fill="{StaticResource Brush.FG2}"/>
|
|
||||||
<TextBlock Text="{StaticResource Text.BlameTypeNotSupported}" Margin="0,16,0,0" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{StaticResource Brush.FG2}"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Loading -->
|
|
||||||
<controls:Loading x:Name="loading" Grid.Row="3" Width="48" Height="48" IsAnimating="True"/>
|
|
||||||
|
|
||||||
<!-- Popup to show commit info -->
|
|
||||||
<Popup x:Name="popup" Grid.Row="3" Placement="MousePoint" IsOpen="False" StaysOpen="False" Focusable="True">
|
|
||||||
<Border BorderBrush="{StaticResource Brush.Accent1}" BorderThickness="1" Background="{StaticResource Brush.Popup}">
|
|
||||||
<Grid Margin="4">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="24"/>
|
|
||||||
<RowDefinition Height="24"/>
|
|
||||||
<RowDefinition Height="24"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.Blame.SHA}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
|
|
||||||
<Label Grid.Row="0" Grid.Column="1" x:Name="commitID" Margin="8,0,4,0" Padding="0" VerticalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.Blame.Author}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="1" x:Name="authorName" Margin="8,0,4,0"/>
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{StaticResource Text.Blame.ModifyTime}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="1" x:Name="authorTime" Margin="8,0,4,0"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
</Grid>
|
|
||||||
</controls:WindowBorder>
|
|
||||||
</Window>
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace SourceGit.Views {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 逐行追溯
|
/// 逐行追溯
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Blame : Window {
|
public partial class Blame : Controls.Window {
|
||||||
private static readonly Brush[] BG = new Brush[] {
|
private static readonly Brush[] BG = new Brush[] {
|
||||||
Brushes.Transparent,
|
Brushes.Transparent,
|
||||||
new SolidColorBrush(Color.FromArgb(128, 0, 0, 0))
|
new SolidColorBrush(Color.FromArgb(128, 0, 0, 0))
|
||||||
|
|
41
src/Views/Controls/Window.cs
Normal file
41
src/Views/Controls/Window.cs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Shell;
|
||||||
|
|
||||||
|
namespace SourceGit.Views.Controls {
|
||||||
|
/// <summary>
|
||||||
|
/// 项目使用的窗体基类
|
||||||
|
/// </summary>
|
||||||
|
public class Window : System.Windows.Window {
|
||||||
|
|
||||||
|
public Window() {
|
||||||
|
Background = FindResource("Brush.Window") as Brush;
|
||||||
|
BorderBrush = FindResource("Brush.WindowBorder") as Brush;
|
||||||
|
BorderThickness = new Thickness(1);
|
||||||
|
|
||||||
|
SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
|
||||||
|
SetValue(TextOptions.TextRenderingModeProperty, TextRenderingMode.ClearType);
|
||||||
|
SetValue(TextOptions.TextHintingModeProperty, TextHintingMode.Animated);
|
||||||
|
UseLayoutRounding = true;
|
||||||
|
|
||||||
|
var chrome = new WindowChrome();
|
||||||
|
chrome.ResizeBorderThickness = new Thickness(4);
|
||||||
|
chrome.UseAeroCaptionButtons = false;
|
||||||
|
chrome.CornerRadius = new CornerRadius(0);
|
||||||
|
chrome.CaptionHeight = 28;
|
||||||
|
WindowChrome.SetWindowChrome(this, chrome);
|
||||||
|
|
||||||
|
StateChanged += (_, __) => {
|
||||||
|
var content = Content as FrameworkElement;
|
||||||
|
|
||||||
|
if (WindowState == WindowState.Maximized) {
|
||||||
|
BorderThickness = new Thickness(0);
|
||||||
|
content.Margin = new Thickness((SystemParameters.MaximizedPrimaryScreenWidth - SystemParameters.WorkArea.Width) / 2);
|
||||||
|
} else {
|
||||||
|
BorderThickness = new Thickness(1);
|
||||||
|
content.Margin = new Thickness(0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,36 +0,0 @@
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace SourceGit.Views.Controls {
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 主窗体Border
|
|
||||||
/// </summary>
|
|
||||||
public class WindowBorder : Border {
|
|
||||||
|
|
||||||
public WindowBorder() {
|
|
||||||
Background = FindResource("Brush.Window") as Brush;
|
|
||||||
BorderBrush = FindResource("Brush.WindowBorder") as Brush;
|
|
||||||
BorderThickness = new Thickness(1);
|
|
||||||
Margin = new Thickness(0);
|
|
||||||
|
|
||||||
Loaded += (o, e) => {
|
|
||||||
var owner = Parent as Window;
|
|
||||||
if (owner != null) {
|
|
||||||
owner.StateChanged += (o1, e1) => {
|
|
||||||
if (owner.WindowState == WindowState.Maximized) {
|
|
||||||
BorderThickness = new Thickness(0);
|
|
||||||
Margin = new Thickness(
|
|
||||||
(SystemParameters.MaximizedPrimaryScreenWidth - SystemParameters.WorkArea.Width) / 2
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
BorderThickness = new Thickness(1);
|
|
||||||
Margin = new Thickness(0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,147 +1,138 @@
|
||||||
<Window x:Class="SourceGit.Views.Histories"
|
<controls:Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="SourceGit.Views.Histories"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:models="clr-namespace:SourceGit.Models"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
xmlns:models="clr-namespace:SourceGit.Models"
|
||||||
mc:Ignorable="d"
|
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
||||||
Title="{StaticResource Text.FileHistory}"
|
mc:Ignorable="d"
|
||||||
TextOptions.TextFormattingMode="Display"
|
Title="{StaticResource Text.FileHistory}"
|
||||||
TextOptions.TextRenderingMode="ClearType"
|
WindowStartupLocation="CenterOwner"
|
||||||
RenderOptions.ClearTypeHint="Enabled"
|
MinHeight="600" MinWidth="800">
|
||||||
UseLayoutRounding="True"
|
<Grid>
|
||||||
WindowStartupLocation="CenterOwner"
|
<Grid.RowDefinitions>
|
||||||
MinHeight="600" MinWidth="800">
|
<RowDefinition Height="28"/>
|
||||||
<WindowChrome.WindowChrome>
|
<RowDefinition Height="1"/>
|
||||||
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
|
<RowDefinition Height="*"/>
|
||||||
</WindowChrome.WindowChrome>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:WindowBorder>
|
<!-- Title Bar -->
|
||||||
<Grid>
|
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="28"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="1"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.RowDefinitions>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Title Bar -->
|
<!-- Icon -->
|
||||||
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Histories}"/>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Title -->
|
||||||
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Histories}"/>
|
<TextBlock Grid.Column="1" Text="{StaticResource Text.FileHistory}"/>
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Window Commands -->
|
||||||
<TextBlock Grid.Column="1" Text="{StaticResource Text.FileHistory}"/>
|
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
|
||||||
|
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
|
||||||
|
<controls:IconButton Click="MaximizeOrRestore" Width="28" Padding="8" Icon="{StaticResource Icon.Maximize}" HoverBackground="#40000000" Opacity="1"/>
|
||||||
|
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- Window Commands -->
|
<Rectangle
|
||||||
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
|
Grid.Row="1"
|
||||||
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
|
Height="1"
|
||||||
<controls:IconButton Click="MaximizeOrRestore" Width="28" Padding="8" Icon="{StaticResource Icon.Maximize}" HoverBackground="#40000000" Opacity="1"/>
|
HorizontalAlignment="Stretch"
|
||||||
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
|
Fill="{StaticResource Brush.Border0}"/>
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Rectangle
|
<!-- Body -->
|
||||||
Grid.Row="1"
|
<Grid Grid.Row="2">
|
||||||
Height="1"
|
<Grid.ColumnDefinitions>
|
||||||
HorizontalAlignment="Stretch"
|
<ColumnDefinition Width="300" MinWidth="300" MaxWidth="600"/>
|
||||||
Fill="{StaticResource Brush.Border0}"/>
|
<ColumnDefinition Width="1"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Body -->
|
<!-- Commit List -->
|
||||||
<Grid Grid.Row="2">
|
<DataGrid
|
||||||
<Grid.ColumnDefinitions>
|
x:Name="commitList"
|
||||||
<ColumnDefinition Width="300" MinWidth="300" MaxWidth="600"/>
|
Grid.Column="0"
|
||||||
<ColumnDefinition Width="1"/>
|
Background="{StaticResource Brush.Contents}"
|
||||||
<ColumnDefinition Width="*"/>
|
BorderBrush="{StaticResource Brush.Border0}"
|
||||||
</Grid.ColumnDefinitions>
|
BorderThickness="0,0,1,0"
|
||||||
|
SelectionMode="Single"
|
||||||
|
SelectionUnit="FullRow"
|
||||||
|
SelectedCellsChanged="OnCommitSelectedChanged">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Width="*">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type models:Commit}">
|
||||||
|
<Border BorderBrush="{StaticResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="36"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Commit List -->
|
<controls:Avatar
|
||||||
<DataGrid
|
Grid.Column="0"
|
||||||
x:Name="commitList"
|
HorizontalAlignment="Center"
|
||||||
Grid.Column="0"
|
Width="32" Height="32"
|
||||||
Background="{StaticResource Brush.Contents}"
|
Email="{Binding Author.Email}"
|
||||||
BorderBrush="{StaticResource Brush.Border0}"
|
FallbackLabel="{Binding Author.Name}"
|
||||||
BorderThickness="0,0,1,0"
|
ToolTip="{Binding Author.Name}"/>
|
||||||
SelectionMode="Single"
|
|
||||||
SelectionUnit="FullRow"
|
|
||||||
SelectedCellsChanged="OnCommitSelectedChanged">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn Width="*">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type models:Commit}">
|
|
||||||
<Border BorderBrush="{StaticResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="36"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<controls:Avatar
|
<Grid Grid.Column="1" Margin="8,0,0,0">
|
||||||
Grid.Column="0"
|
<Grid.RowDefinitions>
|
||||||
HorizontalAlignment="Center"
|
<RowDefinition Height="Auto"/>
|
||||||
Width="32" Height="32"
|
<RowDefinition Height="Auto"/>
|
||||||
Email="{Binding Author.Email}"
|
</Grid.RowDefinitions>
|
||||||
FallbackLabel="{Binding Author.Name}"
|
|
||||||
ToolTip="{Binding Author.Name}"/>
|
|
||||||
|
|
||||||
<Grid Grid.Column="1" Margin="8,0,0,0">
|
<Grid Grid.Row="0">
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<ColumnDefinition Width="72"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Row="0">
|
<TextBlock Grid.Column="0" FontSize="9pt" FontFamily="Consolas">
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="72"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="0" FontSize="9pt" FontFamily="Consolas">
|
|
||||||
<Hyperlink NavigateUri="{Binding SHA}" RequestNavigate="GotoCommit" Foreground="DarkOrange" ToolTip="GOTO COMMIT">
|
<Hyperlink NavigateUri="{Binding SHA}" RequestNavigate="GotoCommit" Foreground="DarkOrange" ToolTip="GOTO COMMIT">
|
||||||
<Run Text="{Binding ShortSHA, Mode=OneWay}"/>
|
<Run Text="{Binding ShortSHA, Mode=OneWay}"/>
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="1"
|
|
||||||
Text="{Binding Author.Time}"
|
|
||||||
FontSize="9pt" FontFamily="Consolas"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"
|
|
||||||
Margin="4,0,0,0"
|
|
||||||
HorizontalAlignment="Right"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Column="1"
|
||||||
Text="{Binding Subject}"
|
Text="{Binding Author.Time}"
|
||||||
FontSize="9pt" FontFamily="Consolas,Microsoft YaHei UI"
|
FontSize="9pt" FontFamily="Consolas"
|
||||||
Margin="0,6,0,0"/>
|
Foreground="{StaticResource Brush.FG2}"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
HorizontalAlignment="Right"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Text="{Binding Subject}"
|
||||||
|
FontSize="9pt" FontFamily="Consolas,Microsoft YaHei UI"
|
||||||
|
Margin="0,6,0,0"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Grid>
|
||||||
</DataTemplate>
|
</Border>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGrid.Columns>
|
</DataGridTemplateColumn>
|
||||||
</DataGrid>
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
<!-- Loading -->
|
<!-- Loading -->
|
||||||
<controls:Loading Grid.Column="0" x:Name="loading" Width="48" Height="48" IsAnimating="True"/>
|
<controls:Loading Grid.Column="0" x:Name="loading" Width="48" Height="48" IsAnimating="True"/>
|
||||||
|
|
||||||
<!-- Splitter -->
|
<!-- Splitter -->
|
||||||
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="Transparent"/>
|
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="Transparent"/>
|
||||||
|
|
||||||
<!-- Diff Viewer -->
|
<!-- Diff Viewer -->
|
||||||
<widgets:DiffViewer Grid.Column="2" x:Name="diffViewer" Padding="4"/>
|
<widgets:DiffViewer Grid.Column="2" x:Name="diffViewer" Padding="4"/>
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</controls:WindowBorder>
|
</Grid>
|
||||||
</Window>
|
</controls:Window>
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace SourceGit.Views {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件历史
|
/// 文件历史
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Histories : Window {
|
public partial class Histories : Controls.Window {
|
||||||
private string repo = null;
|
private string repo = null;
|
||||||
private string file = null;
|
private string file = null;
|
||||||
private bool isLFSEnabled = false;
|
private bool isLFSEnabled = false;
|
||||||
|
|
|
@ -1,69 +1,60 @@
|
||||||
<Window x:Class="SourceGit.Views.Launcher"
|
<controls:Window
|
||||||
x:Name="me"
|
x:Class="SourceGit.Views.Launcher"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Name="me"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
xmlns:models="clr-namespace:SourceGit.Models"
|
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
||||||
mc:Ignorable="d"
|
xmlns:models="clr-namespace:SourceGit.Models"
|
||||||
TextOptions.TextFormattingMode="Display"
|
mc:Ignorable="d"
|
||||||
TextOptions.TextRenderingMode="ClearType"
|
WindowStartupLocation="CenterScreen"
|
||||||
RenderOptions.ClearTypeHint="Enabled"
|
MinWidth="1280" MinHeight="720"
|
||||||
UseLayoutRounding="True"
|
Title="{StaticResource Text.About.Title}"
|
||||||
WindowStartupLocation="CenterScreen"
|
Width="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Width, Mode=TwoWay}"
|
||||||
MinWidth="1280" MinHeight="720"
|
Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}">
|
||||||
Title="{StaticResource Text.About.Title}"
|
<controls:DragDropAdornerLayer>
|
||||||
Width="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Width, Mode=TwoWay}"
|
<Grid.RowDefinitions>
|
||||||
Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}">
|
<RowDefinition Height="28"/>
|
||||||
<WindowChrome.WindowChrome>
|
<RowDefinition Height="*"/>
|
||||||
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
|
</Grid.RowDefinitions>
|
||||||
</WindowChrome.WindowChrome>
|
|
||||||
|
|
||||||
<controls:WindowBorder>
|
<!-- Titlebar -->
|
||||||
<controls:DragDropAdornerLayer>
|
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="28"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<RowDefinition Height="*"/>
|
<ColumnDefinition Width="200"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Titlebar -->
|
<!-- Bottom border -->
|
||||||
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
<Rectangle Grid.Column="0" Grid.ColumnSpan="2" Fill="{StaticResource Brush.Border0}" Height="1" VerticalAlignment="Bottom"/>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="200"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<!-- Bottom border -->
|
<!-- Tabs -->
|
||||||
<Rectangle Grid.Column="0" Grid.ColumnSpan="2" Fill="{StaticResource Brush.Border0}" Height="1" VerticalAlignment="Bottom"/>
|
<widgets:PageTabBar
|
||||||
|
Grid.Column="0"
|
||||||
|
x:Name="tabs"
|
||||||
|
TabAdd="OnTabAdding"
|
||||||
|
TabSelected="OnTabSelected"
|
||||||
|
TabClosed="OnTabClosed"/>
|
||||||
|
|
||||||
<!-- Tabs -->
|
<!-- Right controls -->
|
||||||
<widgets:PageTabBar
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" WindowChrome.IsHitTestVisibleInChrome="True">
|
||||||
Grid.Column="0"
|
<controls:IconButton Click="OpenPreference" Width="28" Padding="6" Icon="{StaticResource Icon.Preference}" ToolTip="{StaticResource Text.Launcher.Preference}"/>
|
||||||
x:Name="tabs"
|
<controls:IconButton Click="OpenAbout" Width="28" Padding="6" Icon="{StaticResource Icon.Help}" ToolTip="{StaticResource Text.Launcher.About}"/>
|
||||||
TabAdd="OnTabAdding"
|
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
|
||||||
TabSelected="OnTabSelected"
|
<controls:IconButton Click="MaximizeOrRestore" Width="28" Padding="8" Icon="{StaticResource Icon.Maximize}" HoverBackground="#40000000" Opacity="1"/>
|
||||||
TabClosed="OnTabClosed"/>
|
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- Right controls -->
|
<!-- Contents -->
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" WindowChrome.IsHitTestVisibleInChrome="True">
|
<controls:PageContainer x:Name="container" Grid.Row="1"/>
|
||||||
<controls:IconButton Click="OpenPreference" Width="28" Padding="6" Icon="{StaticResource Icon.Preference}" ToolTip="{StaticResource Text.Launcher.Preference}"/>
|
|
||||||
<controls:IconButton Click="OpenAbout" Width="28" Padding="6" Icon="{StaticResource Icon.Help}" ToolTip="{StaticResource Text.Launcher.About}"/>
|
|
||||||
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
|
|
||||||
<controls:IconButton Click="MaximizeOrRestore" Width="28" Padding="8" Icon="{StaticResource Icon.Maximize}" HoverBackground="#40000000" Opacity="1"/>
|
|
||||||
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Contents -->
|
<!-- Alerts -->
|
||||||
<controls:PageContainer x:Name="container" Grid.Row="1"/>
|
<widgets:Exceptions
|
||||||
|
Grid.Row="1"
|
||||||
<!-- Alerts -->
|
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
<widgets:Exceptions
|
Width="330" Height="Auto"/>
|
||||||
Grid.Row="1"
|
</controls:DragDropAdornerLayer>
|
||||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
</controls:Window>
|
||||||
Width="330" Height="Auto"/>
|
|
||||||
</controls:DragDropAdornerLayer>
|
|
||||||
</controls:WindowBorder>
|
|
||||||
</Window>
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace SourceGit.Views {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主窗体
|
/// 主窗体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Launcher : Window {
|
public partial class Launcher : Controls.Window {
|
||||||
|
|
||||||
public Launcher() {
|
public Launcher() {
|
||||||
Models.Watcher.Opened += OpenRepository;
|
Models.Watcher.Opened += OpenRepository;
|
||||||
|
|
|
@ -1,314 +1,308 @@
|
||||||
<Window x:Class="SourceGit.Views.Preference"
|
<controls:Window
|
||||||
x:Name="me"
|
x:Class="SourceGit.Views.Preference"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Name="me"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:models="clr-namespace:SourceGit.Models"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
mc:Ignorable="d"
|
xmlns:models="clr-namespace:SourceGit.Models"
|
||||||
WindowStartupLocation="CenterOwner"
|
mc:Ignorable="d"
|
||||||
ResizeMode="NoResize"
|
WindowStartupLocation="CenterOwner"
|
||||||
UseLayoutRounding="True"
|
ResizeMode="NoResize"
|
||||||
Title="{StaticResource Text.Preference}"
|
Title="{StaticResource Text.Preference}"
|
||||||
Width="500" SizeToContent="Height">
|
Width="500" SizeToContent="Height">
|
||||||
<WindowChrome.WindowChrome>
|
<Grid>
|
||||||
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
|
<Grid.RowDefinitions>
|
||||||
</WindowChrome.WindowChrome>
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="1"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:WindowBorder>
|
<!-- Title bar -->
|
||||||
<Grid>
|
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- Icon -->
|
||||||
|
<Path Grid.Column="0" Width="14" Height="14" Margin="6,0" Data="{StaticResource Icon.Preference}"/>
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<TextBlock Grid.Column="1" Text="{StaticResource Text.Preference}"/>
|
||||||
|
|
||||||
|
<!-- Close -->
|
||||||
|
<controls:IconButton
|
||||||
|
Grid.Column="3"
|
||||||
|
Click="Quit"
|
||||||
|
Width="28" Padding="8"
|
||||||
|
Icon="{StaticResource Icon.Close}"
|
||||||
|
HoverBackground="Red"
|
||||||
|
WindowChrome.IsHitTestVisibleInChrome="True"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Rectangle
|
||||||
|
Grid.Row="1"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Fill="{StaticResource Brush.Border0}"/>
|
||||||
|
|
||||||
|
<!-- Body -->
|
||||||
|
<Grid Grid.Row="2" Margin="16,8">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
<RowDefinition Height="28"/>
|
<RowDefinition Height="28"/>
|
||||||
<RowDefinition Height="1"/>
|
<RowDefinition Height="28"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="8"/>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="8"/>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="6"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Title bar -->
|
<Grid.ColumnDefinitions>
|
||||||
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
<ColumnDefinition Width="128"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- General Group -->
|
||||||
|
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Text="{StaticResource Text.Preference.General}"
|
||||||
|
FontSize="16" FontWeight="DemiBold"
|
||||||
|
Foreground="{StaticResource Brush.FG2}"/>
|
||||||
|
<TextBlock
|
||||||
|
Text="{StaticResource Text.Preference.RestartRequired}"
|
||||||
|
Foreground="{StaticResource Brush.FG2}"
|
||||||
|
Margin="16,0"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Language -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Locale}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<ComboBox
|
||||||
|
Grid.Row="1" Grid.Column="1"
|
||||||
|
Height="24"
|
||||||
|
ItemsSource="{Binding Source={x:Static models:Locale.Supported}}"
|
||||||
|
DisplayMemberPath="Name"
|
||||||
|
SelectedValuePath="Resource"
|
||||||
|
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"/>
|
||||||
|
|
||||||
|
<!-- Avatar -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.AvatarServer}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<ComboBox
|
||||||
|
Grid.Row="2" Grid.Column="1"
|
||||||
|
Height="24"
|
||||||
|
ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}"
|
||||||
|
DisplayMemberPath="Name"
|
||||||
|
SelectedValuePath="Url"
|
||||||
|
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.AvatarServer, Mode=TwoWay}"/>
|
||||||
|
|
||||||
|
<!-- Use Dark Theme -->
|
||||||
|
<CheckBox
|
||||||
|
Grid.Row="3" Grid.Column="1"
|
||||||
|
Content="{StaticResource Text.Preference.UseDark}"
|
||||||
|
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseDarkTheme, Mode=TwoWay}"/>
|
||||||
|
|
||||||
|
<!-- Enable Check For Update -->
|
||||||
|
<CheckBox
|
||||||
|
Grid.Row="4" Grid.Column="1"
|
||||||
|
Content="{StaticResource Text.Preference.CheckUpdate}"
|
||||||
|
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/>
|
||||||
|
|
||||||
|
<!-- Auto Fetch -->
|
||||||
|
<CheckBox
|
||||||
|
Grid.Row="5" Grid.Column="1"
|
||||||
|
Content="{StaticResource Text.Preference.AutoFetch}"
|
||||||
|
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/>
|
||||||
|
|
||||||
|
<!-- Git Group -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"
|
||||||
|
Text="{StaticResource Text.Preference.Git}"
|
||||||
|
FontSize="16" FontWeight="DemiBold"
|
||||||
|
Foreground="{StaticResource Brush.FG2}"/>
|
||||||
|
|
||||||
|
<!-- Git Executable Path -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="8" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Git.Path}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<Grid Grid.Row="8" Grid.Column="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Icon -->
|
<controls:TextEdit
|
||||||
<Path Grid.Column="0" Width="14" Height="14" Margin="6,0" Data="{StaticResource Icon.Preference}"/>
|
Grid.Column="0"
|
||||||
|
x:Name="editGitPath"
|
||||||
<!-- Title -->
|
Height="24"
|
||||||
<TextBlock Grid.Column="1" Text="{StaticResource Text.Preference}"/>
|
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.Path, Mode=TwoWay}"
|
||||||
|
Placeholder="{StaticResource Text.Preference.Git.Path.Placeholder}"/>
|
||||||
<!-- Close -->
|
|
||||||
<controls:IconButton
|
<controls:IconButton
|
||||||
Grid.Column="3"
|
Grid.Column="1"
|
||||||
Click="Quit"
|
Click="SelectGitPath"
|
||||||
Width="28" Padding="8"
|
Width="24" Height="24"
|
||||||
Icon="{StaticResource Icon.Close}"
|
Margin="4,0,0,0" Padding="4"
|
||||||
HoverBackground="Red"
|
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
|
||||||
WindowChrome.IsHitTestVisibleInChrome="True"/>
|
Icon="{StaticResource Icon.Folder.Open}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Rectangle
|
<!-- Default Clone Dir -->
|
||||||
Grid.Row="1"
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
Grid.Row="9" Grid.Column="0"
|
||||||
Fill="{StaticResource Brush.Border0}"/>
|
Text="{StaticResource Text.Preference.Git.Dir}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
<!-- Body -->
|
Margin="0,0,6,0"/>
|
||||||
<Grid Grid.Row="2" Margin="16,8">
|
<Grid Grid.Row="9" Grid.Column="1">
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="36"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="8"/>
|
|
||||||
<RowDefinition Height="36"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="8"/>
|
|
||||||
<RowDefinition Height="36"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="6"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="128"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- General Group -->
|
|
||||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
Text="{StaticResource Text.Preference.General}"
|
|
||||||
FontSize="16" FontWeight="DemiBold"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"/>
|
|
||||||
<TextBlock
|
|
||||||
Text="{StaticResource Text.Preference.RestartRequired}"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"
|
|
||||||
Margin="16,0"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Language -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="1" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Locale}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<ComboBox
|
|
||||||
Grid.Row="1" Grid.Column="1"
|
|
||||||
Height="24"
|
|
||||||
ItemsSource="{Binding Source={x:Static models:Locale.Supported}}"
|
|
||||||
DisplayMemberPath="Name"
|
|
||||||
SelectedValuePath="Resource"
|
|
||||||
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"/>
|
|
||||||
|
|
||||||
<!-- Avatar -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="2" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.AvatarServer}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<ComboBox
|
|
||||||
Grid.Row="2" Grid.Column="1"
|
|
||||||
Height="24"
|
|
||||||
ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}"
|
|
||||||
DisplayMemberPath="Name"
|
|
||||||
SelectedValuePath="Url"
|
|
||||||
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.AvatarServer, Mode=TwoWay}"/>
|
|
||||||
|
|
||||||
<!-- Use Dark Theme -->
|
|
||||||
<CheckBox
|
|
||||||
Grid.Row="3" Grid.Column="1"
|
|
||||||
Content="{StaticResource Text.Preference.UseDark}"
|
|
||||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseDarkTheme, Mode=TwoWay}"/>
|
|
||||||
|
|
||||||
<!-- Enable Check For Update -->
|
|
||||||
<CheckBox
|
|
||||||
Grid.Row="4" Grid.Column="1"
|
|
||||||
Content="{StaticResource Text.Preference.CheckUpdate}"
|
|
||||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/>
|
|
||||||
|
|
||||||
<!-- Auto Fetch -->
|
|
||||||
<CheckBox
|
|
||||||
Grid.Row="5" Grid.Column="1"
|
|
||||||
Content="{StaticResource Text.Preference.AutoFetch}"
|
|
||||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/>
|
|
||||||
|
|
||||||
<!-- Git Group -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"
|
|
||||||
Text="{StaticResource Text.Preference.Git}"
|
|
||||||
FontSize="16" FontWeight="DemiBold"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"/>
|
|
||||||
|
|
||||||
<!-- Git Executable Path -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="8" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Git.Path}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<Grid Grid.Row="8" Grid.Column="1">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<controls:TextEdit
|
|
||||||
Grid.Column="0"
|
|
||||||
x:Name="editGitPath"
|
|
||||||
Height="24"
|
|
||||||
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.Path, Mode=TwoWay}"
|
|
||||||
Placeholder="{StaticResource Text.Preference.Git.Path.Placeholder}"/>
|
|
||||||
<controls:IconButton
|
|
||||||
Grid.Column="1"
|
|
||||||
Click="SelectGitPath"
|
|
||||||
Width="24" Height="24"
|
|
||||||
Margin="4,0,0,0" Padding="4"
|
|
||||||
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
|
|
||||||
Icon="{StaticResource Icon.Folder.Open}"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Default Clone Dir -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="9" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Git.Dir}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<Grid Grid.Row="9" Grid.Column="1">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<controls:TextEdit
|
|
||||||
Grid.Column="0"
|
|
||||||
x:Name="txtGitCloneDir"
|
|
||||||
Height="24"
|
|
||||||
Placeholder="{StaticResource Text.Preference.Git.Dir.Placeholder}"
|
|
||||||
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.DefaultCloneDir, Mode=TwoWay}"/>
|
|
||||||
<controls:IconButton
|
|
||||||
Grid.Column="1"
|
|
||||||
Click="SelectGitCloneDir"
|
|
||||||
Width="24" Height="24"
|
|
||||||
Margin="4,0,0,0" Padding="4"
|
|
||||||
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
|
|
||||||
Icon="{StaticResource Icon.Folder.Open}"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- User -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="10" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Git.User}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<controls:TextEdit
|
<controls:TextEdit
|
||||||
Grid.Row="10" Grid.Column="1"
|
Grid.Column="0"
|
||||||
|
x:Name="txtGitCloneDir"
|
||||||
Height="24"
|
Height="24"
|
||||||
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
|
Placeholder="{StaticResource Text.Preference.Git.Dir.Placeholder}"
|
||||||
Placeholder="{StaticResource Text.Preference.Git.User.Placeholder}"/>
|
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.DefaultCloneDir, Mode=TwoWay}"/>
|
||||||
|
<controls:IconButton
|
||||||
<!-- Email -->
|
Grid.Column="1"
|
||||||
<TextBlock
|
Click="SelectGitCloneDir"
|
||||||
Grid.Row="11" Grid.Column="0"
|
Width="24" Height="24"
|
||||||
Text="{StaticResource Text.Preference.Git.Email}"
|
Margin="4,0,0,0" Padding="4"
|
||||||
HorizontalAlignment="Right"
|
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
|
||||||
Margin="0,0,6,0"/>
|
Icon="{StaticResource Icon.Folder.Open}"/>
|
||||||
<controls:TextEdit
|
|
||||||
Grid.Row="11" Grid.Column="1"
|
|
||||||
Height="24"
|
|
||||||
Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}"
|
|
||||||
Placeholder="{StaticResource Text.Preference.Git.Email.Placeholder}"/>
|
|
||||||
|
|
||||||
<!-- CRLF -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="12" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Git.CRLF}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<ComboBox
|
|
||||||
Grid.Row="12" Grid.Column="1"
|
|
||||||
Height="24"
|
|
||||||
ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
|
|
||||||
SelectedValuePath="Value"
|
|
||||||
SelectedValue="{Binding ElementName=me, Path=CRLF, Mode=TwoWay}">
|
|
||||||
<ComboBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<StackPanel Orientation="Horizontal" Height="20">
|
|
||||||
<TextBlock Text="{Binding Display}" Margin="2,0"/>
|
|
||||||
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="10" Foreground="{StaticResource Brush.FG2}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
|
|
||||||
<!-- Merge Tool Group -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2"
|
|
||||||
Text="{StaticResource Text.Preference.Merger}"
|
|
||||||
FontSize="16" FontWeight="DemiBold"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"/>
|
|
||||||
|
|
||||||
<!-- Merge Tool Type -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="15" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Merger.Type}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<ComboBox
|
|
||||||
Grid.Row="15" Grid.Column="1"
|
|
||||||
Height="24"
|
|
||||||
ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
|
|
||||||
DisplayMemberPath="Name"
|
|
||||||
SelectedValuePath="Type"
|
|
||||||
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Type, Mode=TwoWay}"
|
|
||||||
SelectionChanged="MergeToolChanged"/>
|
|
||||||
|
|
||||||
<!-- Merge Tool Executable Path -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="16" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Merger.Path}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<Grid Grid.Row="16" Grid.Column="1">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<controls:TextEdit
|
|
||||||
Grid.Column="0"
|
|
||||||
Height="24"
|
|
||||||
x:Name="txtMergeExec"
|
|
||||||
Placeholder="{StaticResource Text.Preference.Merger.Path.Placeholder}"
|
|
||||||
Text="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Path, Mode=TwoWay}"/>
|
|
||||||
<controls:IconButton
|
|
||||||
Grid.Column="1"
|
|
||||||
Click="SelectMergeTool"
|
|
||||||
Width="24" Height="24"
|
|
||||||
Margin="4,0,0,0" Padding="4"
|
|
||||||
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
|
|
||||||
Icon="{StaticResource Icon.Folder.Open}"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Merge Tool Command -->
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="17" Grid.Column="0"
|
|
||||||
Text="{StaticResource Text.Preference.Merger.Cmd}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="0,0,6,0"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="17" Grid.Column="1"
|
|
||||||
x:Name="txtMergeCmd"
|
|
||||||
Text="{Binding ElementName=me, Path=MergeCmd}"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<!-- User -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="10" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Git.User}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<controls:TextEdit
|
||||||
|
Grid.Row="10" Grid.Column="1"
|
||||||
|
Height="24"
|
||||||
|
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
|
||||||
|
Placeholder="{StaticResource Text.Preference.Git.User.Placeholder}"/>
|
||||||
|
|
||||||
|
<!-- Email -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="11" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Git.Email}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<controls:TextEdit
|
||||||
|
Grid.Row="11" Grid.Column="1"
|
||||||
|
Height="24"
|
||||||
|
Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}"
|
||||||
|
Placeholder="{StaticResource Text.Preference.Git.Email.Placeholder}"/>
|
||||||
|
|
||||||
|
<!-- CRLF -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="12" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Git.CRLF}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<ComboBox
|
||||||
|
Grid.Row="12" Grid.Column="1"
|
||||||
|
Height="24"
|
||||||
|
ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
|
||||||
|
SelectedValuePath="Value"
|
||||||
|
SelectedValue="{Binding ElementName=me, Path=CRLF, Mode=TwoWay}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" Height="20">
|
||||||
|
<TextBlock Text="{Binding Display}" Margin="2,0"/>
|
||||||
|
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="10" Foreground="{StaticResource Brush.FG2}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<!-- Merge Tool Group -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2"
|
||||||
|
Text="{StaticResource Text.Preference.Merger}"
|
||||||
|
FontSize="16" FontWeight="DemiBold"
|
||||||
|
Foreground="{StaticResource Brush.FG2}"/>
|
||||||
|
|
||||||
|
<!-- Merge Tool Type -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="15" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Merger.Type}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<ComboBox
|
||||||
|
Grid.Row="15" Grid.Column="1"
|
||||||
|
Height="24"
|
||||||
|
ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
|
||||||
|
DisplayMemberPath="Name"
|
||||||
|
SelectedValuePath="Type"
|
||||||
|
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Type, Mode=TwoWay}"
|
||||||
|
SelectionChanged="MergeToolChanged"/>
|
||||||
|
|
||||||
|
<!-- Merge Tool Executable Path -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="16" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Merger.Path}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<Grid Grid.Row="16" Grid.Column="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<controls:TextEdit
|
||||||
|
Grid.Column="0"
|
||||||
|
Height="24"
|
||||||
|
x:Name="txtMergeExec"
|
||||||
|
Placeholder="{StaticResource Text.Preference.Merger.Path.Placeholder}"
|
||||||
|
Text="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Path, Mode=TwoWay}"/>
|
||||||
|
<controls:IconButton
|
||||||
|
Grid.Column="1"
|
||||||
|
Click="SelectMergeTool"
|
||||||
|
Width="24" Height="24"
|
||||||
|
Margin="4,0,0,0" Padding="4"
|
||||||
|
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
|
||||||
|
Icon="{StaticResource Icon.Folder.Open}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Merge Tool Command -->
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="17" Grid.Column="0"
|
||||||
|
Text="{StaticResource Text.Preference.Merger.Cmd}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,6,0"/>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="17" Grid.Column="1"
|
||||||
|
x:Name="txtMergeCmd"
|
||||||
|
Text="{Binding ElementName=me, Path=MergeCmd}"
|
||||||
|
Foreground="{StaticResource Brush.FG2}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</controls:WindowBorder>
|
</Grid>
|
||||||
</Window>
|
</controls:Window>
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace SourceGit.Views {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置面板
|
/// 设置面板
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Preference : Window {
|
public partial class Preference : Controls.Window {
|
||||||
|
|
||||||
public string User { get; set; }
|
public string User { get; set; }
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
|
|
|
@ -1,115 +1,112 @@
|
||||||
<Window x:Class="SourceGit.Views.Upgrade"
|
<controls:Window
|
||||||
x:Name="me"
|
x:Class="SourceGit.Views.Upgrade"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Name="me"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
UseLayoutRounding="True"
|
mc:Ignorable="d"
|
||||||
Title="{StaticResource Text.UpdateAvailable}"
|
Title="{StaticResource Text.UpdateAvailable}"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Height="400" Width="500"
|
Height="400" Width="500"
|
||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize">
|
||||||
<WindowChrome.WindowChrome>
|
<Grid>
|
||||||
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
|
<Grid.RowDefinitions>
|
||||||
</WindowChrome.WindowChrome>
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="1"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="32"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:WindowBorder>
|
<!-- Title Bar -->
|
||||||
<Grid>
|
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="28"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<RowDefinition Height="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<RowDefinition Height="32"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- Icon -->
|
||||||
|
<Path Grid.Column="0" Width="16" Height="16" Margin="6,0" Data="{StaticResource Icon.Fetch}"/>
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<TextBlock Grid.Column="1" Text="{StaticResource Text.UpdateAvailable}"/>
|
||||||
|
|
||||||
|
<!-- Close -->
|
||||||
|
<controls:IconButton
|
||||||
|
Grid.Column="3"
|
||||||
|
Click="Quit"
|
||||||
|
Width="28" Padding="8"
|
||||||
|
Icon="{StaticResource Icon.Close}"
|
||||||
|
HoverBackground="Red"
|
||||||
|
WindowChrome.IsHitTestVisibleInChrome="True"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Rectangle Grid.Row="1" Fill="{StaticResource Brush.Border0}" HorizontalAlignment="Stretch" Height="1"/>
|
||||||
|
|
||||||
|
<!-- Body -->
|
||||||
|
<StackPanel Grid.Row="2" Orientation="Vertical" Margin="8,16,8,0">
|
||||||
|
<!-- Title -->
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
|
<Path Width="20" Height="20" Data="{StaticResource Icon.Git}" Fill="{StaticResource Brush.Logo}"/>
|
||||||
|
<TextBlock x:Name="txtRelease" Margin="8,0,0,0" FontSize="18" FontWeight="Bold" Text="Release 1.0 Is Out!!!"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Release Info -->
|
||||||
|
<Grid Margin="0,12,0,0">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Title Bar -->
|
|
||||||
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="120"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Icon -->
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.Time}" FontWeight="Bold"/>
|
||||||
<Path Grid.Column="0" Width="16" Height="16" Margin="6,0" Data="{StaticResource Icon.Fetch}"/>
|
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.PublishTime}"/>
|
||||||
|
|
||||||
<!-- Title -->
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.Based}" FontWeight="Bold"/>
|
||||||
<TextBlock Grid.Column="1" Text="{StaticResource Text.UpdateAvailable}"/>
|
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.CommitSHA}"/>
|
||||||
|
|
||||||
<!-- Close -->
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.IsPreRelease}" FontWeight="Bold"/>
|
||||||
<controls:IconButton
|
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.IsPrerelease}"/>
|
||||||
Grid.Column="3"
|
|
||||||
Click="Quit"
|
|
||||||
Width="28" Padding="8"
|
|
||||||
Icon="{StaticResource Icon.Close}"
|
|
||||||
HoverBackground="Red"
|
|
||||||
WindowChrome.IsHitTestVisibleInChrome="True"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Body -->
|
<!-- CHANGELOG -->
|
||||||
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="8,16,8,0">
|
<Border Grid.Row="3" Margin="8" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border1}" BorderThickness="1">
|
||||||
<!-- Title -->
|
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<TextBlock
|
||||||
<Path Width="20" Height="20" Data="{StaticResource Icon.Git}" Fill="{StaticResource Brush.Logo}"/>
|
FontSize="10pt"
|
||||||
<TextBlock x:Name="txtRelease" Margin="8,0,0,0" FontSize="18" FontWeight="Bold" Text="Release 1.0 Is Out!!!"/>
|
FontFamily="Consolas"
|
||||||
</StackPanel>
|
Padding="8"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Foreground="{StaticResource Brush.FG2}"
|
||||||
|
Text="{Binding ElementName=me, Path=Version.Body}"/>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<!-- Release Info -->
|
<!-- Options -->
|
||||||
<Grid Margin="0,12,0,0">
|
<StackPanel Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal">
|
||||||
<Grid.RowDefinitions>
|
<Button
|
||||||
<RowDefinition Height="20"/>
|
Click="Download"
|
||||||
<RowDefinition Height="20"/>
|
Width="100" Height="24"
|
||||||
<RowDefinition Height="20"/>
|
Content="{StaticResource Text.UpdateAvailable.Download}"
|
||||||
</Grid.RowDefinitions>
|
Background="{StaticResource Brush.Accent1}"
|
||||||
|
BorderBrush="{StaticResource Brush.FG1}"
|
||||||
|
BorderThickness="1"/>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Button
|
||||||
<ColumnDefinition Width="120"/>
|
Click="Quit"
|
||||||
<ColumnDefinition Width="*"/>
|
Width="100" Height="24"
|
||||||
</Grid.ColumnDefinitions>
|
Margin="8,0,0,0"
|
||||||
|
Content="{StaticResource Text.Cancel}"/>
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.Time}" FontWeight="Bold"/>
|
</StackPanel>
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.PublishTime}"/>
|
</Grid>
|
||||||
|
</controls:Window>
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.Based}" FontWeight="Bold"/>
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.CommitSHA}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.IsPreRelease}" FontWeight="Bold"/>
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.IsPrerelease}"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- CHANGELOG -->
|
|
||||||
<Border Grid.Row="2" Margin="8" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border1}" BorderThickness="1">
|
|
||||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
|
||||||
<TextBlock
|
|
||||||
FontSize="10pt"
|
|
||||||
FontFamily="Consolas"
|
|
||||||
Padding="8"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Foreground="{StaticResource Brush.FG2}"
|
|
||||||
Text="{Binding ElementName=me, Path=Version.Body}"/>
|
|
||||||
</ScrollViewer>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Options -->
|
|
||||||
<StackPanel Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal">
|
|
||||||
<Button
|
|
||||||
Click="Download"
|
|
||||||
Width="100" Height="24"
|
|
||||||
Content="{StaticResource Text.UpdateAvailable.Download}"
|
|
||||||
Background="{StaticResource Brush.Accent1}"
|
|
||||||
BorderBrush="{StaticResource Brush.FG1}"
|
|
||||||
BorderThickness="1"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
Click="Quit"
|
|
||||||
Width="100" Height="24"
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
Content="{StaticResource Text.Cancel}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</controls:WindowBorder>
|
|
||||||
</Window>
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace SourceGit.Views {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 新版本提示窗口
|
/// 新版本提示窗口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Upgrade : Window {
|
public partial class Upgrade : Controls.Window {
|
||||||
public Models.Version Version { get; set; } = new Models.Version();
|
public Models.Version Version { get; set; } = new Models.Version();
|
||||||
|
|
||||||
public Upgrade(Models.Version ver) {
|
public Upgrade(Models.Version ver) {
|
||||||
|
|
Loading…
Reference in a new issue