mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
style<*>: remove Waiting panel; adjustment for high dpi screens;
This commit is contained in:
parent
762e51de74
commit
fa3ff6f2db
16 changed files with 79 additions and 103 deletions
|
@ -411,9 +411,6 @@
|
||||||
<sys:String x:Key="Text.Conflict.Revert">Revert merge request detected! Press 'Abort' to restore original HEAD</sys:String>
|
<sys:String x:Key="Text.Conflict.Revert">Revert merge request detected! Press 'Abort' to restore original HEAD</sys:String>
|
||||||
<sys:String x:Key="Text.Conflict.Merge">Merge request detected! Press 'Abort' to restore original HEAD</sys:String>
|
<sys:String x:Key="Text.Conflict.Merge">Merge request detected! Press 'Abort' to restore original HEAD</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="Text.Waiting.UpdateSubmodule">WAITING SUBMOUDLE UPDATE COMPLETE...</sys:String>
|
|
||||||
<sys:String x:Key="Text.Waiting.Staging">WAITING STAGE COMPLETE...</sys:String>
|
|
||||||
|
|
||||||
<sys:String x:Key="Text.NotConfigured">Git has NOT been configured.\nPlease to go [Preference] and configure it first.</sys:String>
|
<sys:String x:Key="Text.NotConfigured">Git has NOT been configured.\nPlease to go [Preference] and configure it first.</sys:String>
|
||||||
<sys:String x:Key="Text.PathNotFound">Path[{0}] not exists!</sys:String>
|
<sys:String x:Key="Text.PathNotFound">Path[{0}] not exists!</sys:String>
|
||||||
<sys:String x:Key="Text.MissingBash">Can NOT locate bash.exe. Make sure bash.exe exists under the same folder with git.exe</sys:String>
|
<sys:String x:Key="Text.MissingBash">Can NOT locate bash.exe. Make sure bash.exe exists under the same folder with git.exe</sys:String>
|
||||||
|
|
|
@ -411,9 +411,6 @@
|
||||||
<sys:String x:Key="Text.Conflict.Revert">检测到回滚提交冲突!</sys:String>
|
<sys:String x:Key="Text.Conflict.Revert">检测到回滚提交冲突!</sys:String>
|
||||||
<sys:String x:Key="Text.Conflict.Merge">检测到分支合并冲突!</sys:String>
|
<sys:String x:Key="Text.Conflict.Merge">检测到分支合并冲突!</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="Text.Waiting.UpdateSubmodule">等待子模块更新完成...</sys:String>
|
|
||||||
<sys:String x:Key="Text.Waiting.Staging">等待暂存完成 ...</sys:String>
|
|
||||||
|
|
||||||
<sys:String x:Key="Text.NotConfigured">GIT尚未配置。请打开【偏好设置】配置GIT路径。</sys:String>
|
<sys:String x:Key="Text.NotConfigured">GIT尚未配置。请打开【偏好设置】配置GIT路径。</sys:String>
|
||||||
<sys:String x:Key="Text.PathNotFound">路径({0})不存在或不可读取!</sys:String>
|
<sys:String x:Key="Text.PathNotFound">路径({0})不存在或不可读取!</sys:String>
|
||||||
<sys:String x:Key="Text.MissingBash">无法找到bash.exe,请确保其在git.exe同目录中!</sys:String>
|
<sys:String x:Key="Text.MissingBash">无法找到bash.exe,请确保其在git.exe同目录中!</sys:String>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Layout -->
|
<!-- Window Layout -->
|
||||||
<Border BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
|
<Border Background="{StaticResource Brush.Border0}" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Content -->
|
<!-- Window Content -->
|
||||||
<Border BorderBrush="{StaticResource Brush.Border0}">
|
<Border BorderBrush="{StaticResource Brush.Border0}" Background="{StaticResource Brush.Border0}">
|
||||||
<!-- Fix Maximize BUG -->
|
<!-- Fix Maximize BUG -->
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
<Style TargetType="{x:Type Border}">
|
<Style TargetType="{x:Type Border}">
|
||||||
|
|
|
@ -26,12 +26,11 @@
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
<RowDefinition Height="1"/>
|
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Toolbar -->
|
<!-- Toolbar -->
|
||||||
<Grid Grid.Row="0" Panel.ZIndex="100">
|
<Border Grid.Row="0" Panel.ZIndex="100" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,0,1">
|
||||||
<Grid Background="{StaticResource Brush.Window}">
|
<Grid Background="{StaticResource Brush.Window}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
@ -106,15 +105,13 @@
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Border>
|
||||||
|
|
||||||
<Rectangle Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
|
|
||||||
|
|
||||||
<!-- Main body -->
|
<!-- Main body -->
|
||||||
<Grid Grid.Row="2">
|
<Grid Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" MinWidth="200" MaxWidth="300"/>
|
<ColumnDefinition Width="200" MinWidth="200" MaxWidth="300"/>
|
||||||
<ColumnDefinition Width="1"/>
|
<ColumnDefinition Width="1" MaxWidth="1"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
@ -436,7 +433,11 @@
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.Submodule}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Submodule}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="3" Click="UpdateSubmodule" ToolTip="{StaticResource Text.Dashboard.Submodules.Update}">
|
<Button Grid.Column="3" Click="UpdateSubmodule" ToolTip="{StaticResource Text.Dashboard.Submodules.Update}">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.Loading}"/>
|
<Path x:Name="iconUpdateSubmodule" Width="14" Height="14" Data="{StaticResource Icon.Loading}" RenderTransformOrigin=".5,.5">
|
||||||
|
<Path.RenderTransform>
|
||||||
|
<RotateTransform Angle="0"/>
|
||||||
|
</Path.RenderTransform>
|
||||||
|
</Path>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
@ -480,7 +481,7 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Splitter -->
|
<!-- Splitter -->
|
||||||
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
|
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
|
||||||
|
|
||||||
<!-- Right -->
|
<!-- Right -->
|
||||||
<Grid Grid.Column="2">
|
<Grid Grid.Column="2">
|
||||||
|
|
|
@ -9,6 +9,7 @@ using System.Windows.Controls;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace SourceGit.UI {
|
namespace SourceGit.UI {
|
||||||
|
@ -990,8 +991,12 @@ namespace SourceGit.UI {
|
||||||
AddSubmodule.Show(repo);
|
AddSubmodule.Show(repo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateSubmodule(object sender, RoutedEventArgs e) {
|
private async void UpdateSubmodule(object sender, RoutedEventArgs e) {
|
||||||
Waiting.Show(repo, "Text.Waiting.UpdateSubmodule", () => repo.UpdateSubmodule());
|
DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
|
||||||
|
anim.RepeatBehavior = RepeatBehavior.Forever;
|
||||||
|
iconUpdateSubmodule.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
|
||||||
|
await Task.Run(() => repo.UpdateSubmodule());
|
||||||
|
iconUpdateSubmodule.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SubmoduleLostFocus(object sender, RoutedEventArgs e) {
|
private void SubmoduleLostFocus(object sender, RoutedEventArgs e) {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Layout Window -->
|
<!-- Layout Window -->
|
||||||
<Border Background="{StaticResource Brush.Window}" BorderBrush="{StaticResource Brush.Border0}">
|
<Border Background="{StaticResource Brush.Border0}" BorderBrush="{StaticResource Brush.Border0}">
|
||||||
<!-- Fix Maximize BUG -->
|
<!-- Fix Maximize BUG -->
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
<Style TargetType="{x:Type Border}">
|
<Style TargetType="{x:Type Border}">
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
<!-- Body -->
|
<!-- Body -->
|
||||||
<Border Grid.Row="1" ClipToBounds="True">
|
<Border Grid.Row="1" ClipToBounds="True">
|
||||||
<Grid>
|
<Grid Background="{StaticResource Brush.Window}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="300"/>
|
<ColumnDefinition Width="300"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
x:Name="commitList"
|
x:Name="commitList"
|
||||||
Margin="0,0,0,0"
|
Margin="0,0,0,0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Background="{StaticResource Brush.Window}"
|
Background="{StaticResource Brush.Contents}"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
SelectionMode="Single"
|
SelectionMode="Single"
|
||||||
SelectionChanged="CommitSelectionChanged">
|
SelectionChanged="CommitSelectionChanged">
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Layout -->
|
<!-- Window Layout -->
|
||||||
<Border Background="{StaticResource Brush.Window}" BorderThickness="1" BorderBrush="{StaticResource Brush.Border0}">
|
<Border Background="{StaticResource Brush.Border0}" BorderThickness="1" BorderBrush="{StaticResource Brush.Border0}">
|
||||||
<Grid>
|
<Grid Background="{StaticResource Brush.Window}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- File system tree -->
|
<!-- File system tree -->
|
||||||
<Border Grid.Row="2" Margin="4" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border1}" BorderThickness="1">
|
<Border Grid.Row="2" Margin="4" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border2}" BorderThickness="1">
|
||||||
<TreeView x:Name="treePath" FontFamily="Consolas" PreviewMouseWheel="OnTreeMouseWheel" SelectedItemChanged="OnTreeSelectedChanged">
|
<TreeView x:Name="treePath" FontFamily="Consolas" PreviewMouseWheel="OnTreeMouseWheel" SelectedItemChanged="OnTreeSelectedChanged">
|
||||||
<TreeView.ItemContainerStyle>
|
<TreeView.ItemContainerStyle>
|
||||||
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource Style.TreeView.ItemContainerStyle}">
|
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource Style.TreeView.ItemContainerStyle}">
|
||||||
|
|
|
@ -15,16 +15,18 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Content -->
|
<!-- Window Content -->
|
||||||
<Border Background="{StaticResource Brush.Window}">
|
<Border Background="{StaticResource Brush.Border0}" BorderBrush="{StaticResource Brush.Border0}">
|
||||||
<!-- Fix Maximize BUG -->
|
<!-- Fix Maximize BUG -->
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
<Style TargetType="{x:Type Border}">
|
<Style TargetType="{x:Type Border}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
|
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
|
||||||
<Setter Property="Margin" Value="6"/>
|
<Setter Property="Margin" Value="6"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
|
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
|
||||||
<Setter Property="Margin" Value="0"/>
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
@ -188,7 +190,7 @@
|
||||||
<local:CommitViewer x:Name="commitViewer" Grid.Row="3" Background="{StaticResource Brush.CommitViewer}"/>
|
<local:CommitViewer x:Name="commitViewer" Grid.Row="3" Background="{StaticResource Brush.CommitViewer}"/>
|
||||||
|
|
||||||
<!-- Options Bar -->
|
<!-- Options Bar -->
|
||||||
<Grid Grid.Row="5">
|
<Grid Grid.Row="5" Background="{StaticResource Brush.CommitViewer}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="80"/>
|
<ColumnDefinition Width="80"/>
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:source="clr-namespace:SourceGit"
|
xmlns:source="clr-namespace:SourceGit"
|
||||||
xmlns:local="clr-namespace:SourceGit.UI"
|
xmlns:local="clr-namespace:SourceGit.UI"
|
||||||
xmlns:helpers="clr-namespace:SourceGit.Helpers"
|
|
||||||
xmlns:converters="clr-namespace:SourceGit.Converters"
|
xmlns:converters="clr-namespace:SourceGit.Converters"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
MinWidth="800" MinHeight="600"
|
MinWidth="800" MinHeight="600"
|
||||||
|
@ -21,7 +20,7 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Layout -->
|
<!-- Window Layout -->
|
||||||
<Border BorderBrush="{StaticResource Brush.Border0}">
|
<Border BorderBrush="{StaticResource Brush.Border0}" Background="{StaticResource Brush.Border0}">
|
||||||
|
|
||||||
<!-- Fix Maximize BUG -->
|
<!-- Fix Maximize BUG -->
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
|
@ -110,11 +109,11 @@
|
||||||
|
|
||||||
<TabControl.ItemTemplate>
|
<TabControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid x:Name="BG" MinWidth="80" Margin="8,0" Background="Transparent">
|
<Grid x:Name="BG" Margin="8,0" Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*" MinWidth="6"/>
|
<ColumnDefinition Width="4"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Layout -->
|
<!-- Window Layout -->
|
||||||
<Border BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
|
<Border Background="{StaticResource Brush.Border0}" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
|
||||||
<Grid Background="{StaticResource Brush.Window}">
|
<Grid Background="{StaticResource Brush.Window}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<!-- Window Layout -->
|
<!-- Window Layout -->
|
||||||
<Border BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
|
<Border Background="{StaticResource Brush.Border0}" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
|
||||||
<Grid Background="{StaticResource Brush.Window}">
|
<Grid Background="{StaticResource Brush.Window}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
<UserControl x:Class="SourceGit.UI.Waiting"
|
|
||||||
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"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="160" d:DesignWidth="500" Height="200" Width="500">
|
|
||||||
<TextBlock x:Name="txtTip" Text="WAITING ..." HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Consolas" FontWeight="Bold" FontSize="16" Foreground="{StaticResource Brush.FG1}"/>
|
|
||||||
</UserControl>
|
|
|
@ -1,41 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace SourceGit.UI {
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// General waiting dialog.
|
|
||||||
/// </summary>
|
|
||||||
public partial class Waiting : UserControl {
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor.
|
|
||||||
/// </summary>
|
|
||||||
public Waiting() {
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show this dialog.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="repo"></param>
|
|
||||||
/// <param name="tip"></param>
|
|
||||||
/// <param name="job"></param>
|
|
||||||
public static void Show(Git.Repository repo, string tipKey, Action job) {
|
|
||||||
var dialog = new Waiting();
|
|
||||||
var tip = dialog.FindResource(tipKey) as string;
|
|
||||||
if (tip != null) dialog.txtTip.Text = tip;
|
|
||||||
|
|
||||||
var popup = repo.GetPopupManager();
|
|
||||||
popup?.Show(dialog);
|
|
||||||
popup?.Lock();
|
|
||||||
Task.Run(() => {
|
|
||||||
job.Invoke();
|
|
||||||
dialog.Dispatcher.Invoke(() => {
|
|
||||||
popup?.Close(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -29,7 +29,7 @@
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="300"/>
|
<ColumnDefinition Width="300"/>
|
||||||
<ColumnDefinition Width="1"/>
|
<ColumnDefinition Width="1" MaxWidth="1"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@
|
||||||
<Grid Grid.Row="0">
|
<Grid Grid.Row="0">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="24"/>
|
<RowDefinition Height="24"/>
|
||||||
<RowDefinition Height="1"/>
|
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Row="0">
|
<Grid Grid.Row="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
@ -58,22 +58,29 @@
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Border Grid.Column="0" Grid.ColumnSpan="6" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,0,1"/>
|
||||||
|
|
||||||
<local:FilesDisplayModeSwitch
|
<local:FilesDisplayModeSwitch
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Mode="{Binding Source={x:Static source:App.Setting}, Path=UI.UnstageFileDisplayMode, Mode=TwoWay}"/>
|
Mode="{Binding Source={x:Static source:App.Setting}, Path=UI.UnstageFileDisplayMode, Mode=TwoWay}"/>
|
||||||
<Label Grid.Column="1" Content="{StaticResource Text.WorkingCopy.Unstaged}" FontWeight="Bold" Foreground="{StaticResource Brush.FG2}"/>
|
<Label Grid.Column="1" Content="{StaticResource Text.WorkingCopy.Unstaged}" FontWeight="Bold" Foreground="{StaticResource Brush.FG2}"/>
|
||||||
<Button Grid.Column="3" Click="Stage" Margin="4,0" ToolTip="{StaticResource Text.WorkingCopy.Unstaged.Stage}" Background="Transparent">
|
|
||||||
|
<Path x:Name="iconStaging" Grid.Column="2" Visibility="Collapsed" Margin="8,0" Data="{StaticResource Icon.Loading}" RenderTransformOrigin=".5,.5">
|
||||||
|
<Path.RenderTransform>
|
||||||
|
<RotateTransform Angle="0"/>
|
||||||
|
</Path.RenderTransform>
|
||||||
|
</Path>
|
||||||
|
|
||||||
|
<Button Grid.Column="4" Click="Stage" Margin="4,0" ToolTip="{StaticResource Text.WorkingCopy.Unstaged.Stage}" Background="Transparent">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.Down}" Opacity=".4"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Down}" Opacity=".4"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="4" Click="StageAll" Margin="4,0" ToolTip="{StaticResource Text.WorkingCopy.Unstaged.StageAll}" Background="Transparent">
|
<Button Grid.Column="5" Click="StageAll" Margin="4,0" ToolTip="{StaticResource Text.WorkingCopy.Unstaged.StageAll}" Background="Transparent">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.DoubleDown}" Opacity=".4"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.DoubleDown}" Opacity=".4"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
|
|
||||||
|
|
||||||
<TreeView
|
<TreeView
|
||||||
Grid.Row="2"
|
Grid.Row="1"
|
||||||
x:Name="unstagedTree"
|
x:Name="unstagedTree"
|
||||||
ItemsSource="{Binding ElementName=me, Path=UnstagedTreeData, IsAsync=True}"
|
ItemsSource="{Binding ElementName=me, Path=UnstagedTreeData, IsAsync=True}"
|
||||||
Background="{StaticResource Brush.Contents}"
|
Background="{StaticResource Brush.Contents}"
|
||||||
|
@ -205,7 +212,6 @@
|
||||||
<Grid Grid.Row="2">
|
<Grid Grid.Row="2">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="24"/>
|
<RowDefinition Height="24"/>
|
||||||
<RowDefinition Height="1"/>
|
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
@ -218,6 +224,8 @@
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Border Grid.Column="0" Grid.ColumnSpan="5" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,0,1"/>
|
||||||
|
|
||||||
<local:FilesDisplayModeSwitch
|
<local:FilesDisplayModeSwitch
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Mode="{Binding Source={x:Static source:App.Setting}, Path=UI.StagedFileDisplayMode, Mode=TwoWay}"/>
|
Mode="{Binding Source={x:Static source:App.Setting}, Path=UI.StagedFileDisplayMode, Mode=TwoWay}"/>
|
||||||
|
@ -230,10 +238,8 @@
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
|
|
||||||
|
|
||||||
<TreeView
|
<TreeView
|
||||||
Grid.Row="2"
|
Grid.Row="1"
|
||||||
x:Name="stageTree"
|
x:Name="stageTree"
|
||||||
ItemsSource="{Binding ElementName=me, Path=StagedTreeData, IsAsync=False}"
|
ItemsSource="{Binding ElementName=me, Path=StagedTreeData, IsAsync=False}"
|
||||||
Visibility="{Binding Source={x:Static source:App.Setting}, Path=UI.StagedFileDisplayMode, Converter={StaticResource FilesDisplayModeToTree}}"
|
Visibility="{Binding Source={x:Static source:App.Setting}, Path=UI.StagedFileDisplayMode, Converter={StaticResource FilesDisplayModeToTree}}"
|
||||||
|
@ -360,7 +366,7 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Splitter -->
|
<!-- Splitter -->
|
||||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
|
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
|
||||||
|
|
||||||
<!-- Right -->
|
<!-- Right -->
|
||||||
<Grid Grid.Column="2" Margin="8">
|
<Grid Grid.Column="2" Margin="8">
|
||||||
|
|
|
@ -338,7 +338,7 @@ namespace SourceGit.UI {
|
||||||
var stage = new MenuItem();
|
var stage = new MenuItem();
|
||||||
stage.Header = App.Text("FileCM.Stage");
|
stage.Header = App.Text("FileCM.Stage");
|
||||||
stage.Click += (o, e) => {
|
stage.Click += (o, e) => {
|
||||||
Waiting.Show(Repo, "Text.Waiting.Staging", () => Repo.Stage(node.FilePath));
|
DoStage(node.FilePath);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ namespace SourceGit.UI {
|
||||||
var stage = new MenuItem();
|
var stage = new MenuItem();
|
||||||
stage.Header = App.Format("FileCM.StageMulti", changes.Count);
|
stage.Header = App.Format("FileCM.StageMulti", changes.Count);
|
||||||
stage.Click += (o, e) => {
|
stage.Click += (o, e) => {
|
||||||
Waiting.Show(Repo, "Text.Waiting.Staging", () => Repo.Stage(files.ToArray()));
|
DoStage(files.ToArray());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ namespace SourceGit.UI {
|
||||||
var stage = new MenuItem();
|
var stage = new MenuItem();
|
||||||
stage.Header = App.Text("FileCM.Stage");
|
stage.Header = App.Text("FileCM.Stage");
|
||||||
stage.Click += (o, e) => {
|
stage.Click += (o, e) => {
|
||||||
Waiting.Show(Repo, "Text.Waiting.Staging", () => Repo.Stage(change.Path));
|
DoStage(change.Path);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -553,7 +553,7 @@ namespace SourceGit.UI {
|
||||||
var stage = new MenuItem();
|
var stage = new MenuItem();
|
||||||
stage.Header = App.Format("FileCM.StageMulti", changes.Count);
|
stage.Header = App.Format("FileCM.StageMulti", changes.Count);
|
||||||
stage.Click += (o, e) => {
|
stage.Click += (o, e) => {
|
||||||
Waiting.Show(Repo, "Text.Waiting.Staging", () => Repo.Stage(files.ToArray()));
|
DoStage(files.ToArray());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -614,12 +614,25 @@ namespace SourceGit.UI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (files.Count == 0) return;
|
if (files.Count > 0) DoStage(files.ToArray());
|
||||||
Waiting.Show(Repo, "Text.Waiting.Staging", () => Repo.Stage(files.ToArray()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StageAll(object sender, RoutedEventArgs e) {
|
private void StageAll(object sender, RoutedEventArgs e) {
|
||||||
Waiting.Show(Repo, "Text.Waiting.Staging", () => Repo.Stage());
|
DoStage();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoStage(params string[] files) {
|
||||||
|
DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
|
||||||
|
anim.RepeatBehavior = RepeatBehavior.Forever;
|
||||||
|
iconStaging.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
|
||||||
|
iconStaging.Visibility = Visibility.Visible;
|
||||||
|
Task.Run(() => {
|
||||||
|
Repo.Stage(files);
|
||||||
|
Dispatcher.Invoke(() => {
|
||||||
|
iconStaging.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
|
||||||
|
iconStaging.Visibility = Visibility.Collapsed;
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -964,7 +977,13 @@ namespace SourceGit.UI {
|
||||||
txtCommitMsg.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
txtCommitMsg.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||||
if (Validation.GetHasError(txtCommitMsg)) return;
|
if (Validation.GetHasError(txtCommitMsg)) return;
|
||||||
|
|
||||||
|
DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
|
||||||
|
anim.RepeatBehavior = RepeatBehavior.Forever;
|
||||||
|
iconCommiting.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
|
||||||
|
iconCommiting.Visibility = Visibility.Visible;
|
||||||
bool succ = await Task.Run(() => Repo.DoCommit(CommitMessage, amend));
|
bool succ = await Task.Run(() => Repo.DoCommit(CommitMessage, amend));
|
||||||
|
iconCommiting.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
|
||||||
|
iconCommiting.Visibility = Visibility.Collapsed;
|
||||||
if (!succ) return;
|
if (!succ) return;
|
||||||
|
|
||||||
ClearMessage();
|
ClearMessage();
|
||||||
|
|
Loading…
Reference in a new issue