mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
Compare commits
8 commits
c67cdb931f
...
95a63eb98d
Author | SHA1 | Date | |
---|---|---|---|
|
95a63eb98d | ||
|
d9db7eb1d4 | ||
|
ba307189e7 | ||
|
c2f68daaf5 | ||
|
b9a24ceb53 | ||
|
adca61c538 | ||
|
21e15a1af4 | ||
|
1f7a54e61e |
18 changed files with 156 additions and 64 deletions
|
@ -31,6 +31,7 @@ Opensource Git GUI client.
|
|||
* Revision Diffs
|
||||
* Branch Diff
|
||||
* Image Diff - Side-By-Side/Swipe/Blend
|
||||
* Search commits
|
||||
* GitFlow
|
||||
* Git LFS
|
||||
* Issue Link
|
||||
|
@ -80,6 +81,7 @@ For **macOS** users:
|
|||
* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
|
||||
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
|
||||
* You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works.
|
||||
* You may need to start this app from commandline by using `open -a SourceGit` to introduce the `PATH` environment variable from your shell.
|
||||
|
||||
For **Linux** users:
|
||||
|
||||
|
|
|
@ -359,8 +359,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Interaktiver Rebase</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Ziel Branch:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">Auf:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">Hochschieben</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">Runterschieben</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">FEHLER</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">INFO</x:String>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<x:String x:Key="Text.About" xml:space="preserve">About</x:String>
|
||||
<x:String x:Key="Text.About.Menu" xml:space="preserve">About SourceGit</x:String>
|
||||
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Build with </x:String>
|
||||
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Chart is rendered by </x:String>
|
||||
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
|
||||
<x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor from </x:String>
|
||||
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace fonts come from </x:String>
|
||||
|
@ -313,6 +314,7 @@
|
|||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Switch Horizontal/Vertical Layout</x:String>
|
||||
<x:String x:Key="Text.Histories.GraphMode" xml:space="preserve">Switch Curve/Polyline Graph Mode</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">AUTHOR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">AUTHOR TIME</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRAPH & SUBJECT</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.SHA" xml:space="preserve">SHA</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Time" xml:space="preserve">COMMIT TIME</x:String>
|
||||
|
@ -356,8 +358,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Interactive Rebase</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Target Branch:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">On:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">Move Up</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">Move Down</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ERROR</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">NOTICE</x:String>
|
||||
|
@ -414,6 +414,7 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">Check for updates on startup</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">Language</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">History Commits</x:String>
|
||||
<x:String x:Key="Text.Preference.General.ShowAuthorTime" xml:space="preserve">Show author time intead of commit time in graph</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">Subject Guide Length</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.CRLF" xml:space="preserve">Enable Auto CRLF</x:String>
|
||||
|
|
|
@ -345,8 +345,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Interactive Rebase</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Target Branch:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">On:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">Move Up</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">Move Down</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ERROR</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">NOTICE</x:String>
|
||||
|
|
|
@ -340,8 +340,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Rebase Interativo</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Ramo Alvo:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">Em:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">Mover Para Cima</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">Mover Para Baixo</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ERRO</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">AVISO</x:String>
|
||||
|
|
|
@ -359,8 +359,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Интерактивное перемещение</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Целевая ветка:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">На:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">Вверх</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">Вниз</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ОШИБКА</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">УВЕДОМЛЕНИЕ</x:String>
|
||||
|
@ -560,6 +558,8 @@
|
|||
<x:String x:Key="Text.Squash.Into" xml:space="preserve">В:</x:String>
|
||||
<x:String x:Key="Text.SSHKey" xml:space="preserve">Частный ключ SSH:</x:String>
|
||||
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Путь хранения частного ключа SSH</x:String>
|
||||
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Только подготовленные изменения</x:String>
|
||||
<x:String x:Key="Text.Stash.TipForSelectedFiles" xml:space="preserve">Подготовленные так и подготовленные изменения выбранных файлов будут сохранены!!!</x:String>
|
||||
<x:String x:Key="Text.Start" xml:space="preserve">ЗАПУСК</x:String>
|
||||
<x:String x:Key="Text.Stash" xml:space="preserve">Отложить</x:String>
|
||||
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Включить неотслеживаемые файлы</x:String>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<x:String x:Key="Text.About" xml:space="preserve">关于软件</x:String>
|
||||
<x:String x:Key="Text.About.Menu" xml:space="preserve">关于本软件</x:String>
|
||||
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 项目依赖于 </x:String>
|
||||
<x:String x:Key="Text.About.Chart" xml:space="preserve">• 图表绘制组件来自 </x:String>
|
||||
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
|
||||
<x:String x:Key="Text.About.Editor" xml:space="preserve">• 文本编辑器使用 </x:String>
|
||||
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等宽字体来自于 </x:String>
|
||||
|
@ -316,6 +317,7 @@
|
|||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">切换横向/纵向显示</x:String>
|
||||
<x:String x:Key="Text.Histories.GraphMode" xml:space="preserve">切换曲线/折线显示</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">作者</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">修改时间</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">路线图与主题</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.SHA" xml:space="preserve">提交指纹</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Time" xml:space="preserve">提交时间</x:String>
|
||||
|
@ -359,8 +361,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">交互式变基</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">目标分支 :</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">起始提交 :</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">向上移动</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">向下移动</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">出错了</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">系统提示</x:String>
|
||||
|
@ -413,6 +413,7 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">启动时检测软件更新</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">显示语言</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">最大历史提交数</x:String>
|
||||
<x:String x:Key="Text.Preference.General.ShowAuthorTime" xml:space="preserve">在提交路线图中显示修改时间而非提交时间</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">SUBJECT字数检测</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT配置</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.CRLF" xml:space="preserve">自动换行转换</x:String>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<x:String x:Key="Text.About" xml:space="preserve">關於</x:String>
|
||||
<x:String x:Key="Text.About.Menu" xml:space="preserve">關於 SourceGit</x:String>
|
||||
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 專案依賴於 </x:String>
|
||||
<x:String x:Key="Text.About.Chart" xml:space="preserve">• 圖表繪製元件來自 </x:String>
|
||||
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
|
||||
<x:String x:Key="Text.About.Editor" xml:space="preserve">• 文字編輯器使用 </x:String>
|
||||
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等寬字型來自於 </x:String>
|
||||
|
@ -316,6 +317,7 @@
|
|||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">切換橫向/縱向顯示</x:String>
|
||||
<x:String x:Key="Text.Histories.GraphMode" xml:space="preserve">切換曲線/折線顯示</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">作者</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">修改時間</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">路線圖與訊息標題</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.SHA" xml:space="preserve">提交編號</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Time" xml:space="preserve">提交時間</x:String>
|
||||
|
@ -359,8 +361,6 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">互動式重定基底</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">目標分支:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">起始提交:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveUp" xml:space="preserve">向上移動</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.MoveDown" xml:space="preserve">向下移動</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">發生錯誤</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">系統提示</x:String>
|
||||
|
@ -417,6 +417,7 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">啟動時檢查軟體更新</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">顯示語言</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">最大歷史提交數</x:String>
|
||||
<x:String x:Key="Text.Preference.General.ShowAuthorTime" xml:space="preserve">在提交路線圖中顯示修改時間而非提交時間</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">提交標題字數偵測</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">Git 設定</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.CRLF" xml:space="preserve">自動換行轉換</x:String>
|
||||
|
|
|
@ -140,6 +140,7 @@ namespace SourceGit.ViewModels
|
|||
var prev = Items[idx - 1];
|
||||
Items.RemoveAt(idx - 1);
|
||||
Items.Insert(idx, prev);
|
||||
SelectedItem = item;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,6 +152,7 @@ namespace SourceGit.ViewModels
|
|||
var next = Items[idx + 1];
|
||||
Items.RemoveAt(idx + 1);
|
||||
Items.Insert(idx, next);
|
||||
SelectedItem = item;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,12 @@ namespace SourceGit.ViewModels
|
|||
set => SetProperty(ref _check4UpdatesOnStartup, value);
|
||||
}
|
||||
|
||||
public bool ShowAuthorTimeInGraph
|
||||
{
|
||||
get => _showAuthorTimeInGraph;
|
||||
set => SetProperty(ref _showAuthorTimeInGraph, value);
|
||||
}
|
||||
|
||||
public string IgnoreUpdateTag
|
||||
{
|
||||
get => _ignoreUpdateTag;
|
||||
|
@ -577,6 +583,7 @@ namespace SourceGit.ViewModels
|
|||
private int _maxHistoryCommits = 20000;
|
||||
private int _subjectGuideLength = 50;
|
||||
private bool _useFixedTabWidth = true;
|
||||
private bool _showAuthorTimeInGraph = false;
|
||||
|
||||
private bool _check4UpdatesOnStartup = true;
|
||||
private double _lastCheckUpdateTime = 0;
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="0,8,32,8">
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="0,8,32,16">
|
||||
<StackPanel Height="48" Orientation="Horizontal">
|
||||
<TextBlock Classes="bold" Text="SourceGit" FontSize="32" />
|
||||
<Border Margin="12,0,0,0" Height="20" CornerRadius="10" Background="{DynamicResource Brush.Accent}" Effect="drop-shadow(0 0 6 #40000000)">
|
||||
|
@ -74,6 +74,11 @@
|
|||
<TextBlock Text="JetBrains Mono" Cursor="Hand" Foreground="{DynamicResource Brush.Accent}" TextDecorations="Underline" PointerPressed="OnVisitJetBrainsMonoFont"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Height="18" Margin="0,2,0,0">
|
||||
<TextBlock Text="{DynamicResource Text.About.Chart}" />
|
||||
<TextBlock Text="LiveCharts2" Cursor="Hand" Foreground="{DynamicResource Brush.Accent}" TextDecorations="Underline" PointerPressed="OnVisitLiveCharts2"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Height="18" Margin="0,2,0,0">
|
||||
<TextBlock Text="{DynamicResource Text.About.SourceCode}" />
|
||||
<TextBlock Text="Github" Cursor="Hand" Foreground="{DynamicResource Brush.Accent}" TextDecorations="Underline" PointerPressed="OnVisitSourceCode"/>
|
||||
|
|
|
@ -44,6 +44,12 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnVisitLiveCharts2(object _, PointerPressedEventArgs e)
|
||||
{
|
||||
Native.OS.OpenBrowser("https://livecharts.dev/");
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnVisitSourceCode(object _, PointerPressedEventArgs e)
|
||||
{
|
||||
Native.OS.OpenBrowser("https://github.com/sourcegit-scm/sourcegit");
|
||||
|
|
|
@ -51,7 +51,14 @@
|
|||
<ToggleButton Classes="time_display_mode"
|
||||
Width="10" Height="10"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=DisplayTimeAsPeriodInHistories, Mode=TwoWay}"/>
|
||||
<TextBlock Classes="table_header" Margin="6,0,0,0" Text="{DynamicResource Text.Histories.Header.Time}"/>
|
||||
<TextBlock Classes="table_header"
|
||||
Margin="6,0,0,0"
|
||||
Text="{DynamicResource Text.Histories.Header.Time}"
|
||||
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowAuthorTimeInGraph, Converter={x:Static BoolConverters.Not}, Mode=OneWay}"/>
|
||||
<TextBlock Classes="table_header"
|
||||
Margin="6,0,0,0"
|
||||
Text="{DynamicResource Text.Histories.Header.AuthorTime}"
|
||||
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowAuthorTimeInGraph, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
@ -180,13 +187,13 @@
|
|||
Opacity="{Binding Opacity}"/>
|
||||
</Border>
|
||||
|
||||
<!-- COMMIT TIME -->
|
||||
<!-- TIME -->
|
||||
<Border Grid.Column="3" Padding="4,0" ClipToBounds="True" IsHitTestVisible="False">
|
||||
<v:CommitTimeTextBlock Classes="primary"
|
||||
HorizontalAlignment="Center"
|
||||
FontWeight="{Binding FontWeight}"
|
||||
Opacity="{Binding Opacity}"
|
||||
Timestamp="{Binding CommitterTime}"
|
||||
UseAuthorTime="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowAuthorTimeInGraph, Mode=OneWay}"
|
||||
ShowAsDateTime="{Binding Source={x:Static vm:Preference.Instance}, Path=!DisplayTimeAsPeriodInHistories}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
|
|
@ -303,13 +303,13 @@ namespace SourceGit.Views
|
|||
set => SetValue(ShowAsDateTimeProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<ulong> TimestampProperty =
|
||||
AvaloniaProperty.Register<CommitTimeTextBlock, ulong>(nameof(Timestamp));
|
||||
public static readonly StyledProperty<bool> UseAuthorTimeProperty =
|
||||
AvaloniaProperty.Register<CommitTimeTextBlock, bool>(nameof(UseAuthorTime), true);
|
||||
|
||||
public ulong Timestamp
|
||||
public bool UseAuthorTime
|
||||
{
|
||||
get => GetValue(TimestampProperty);
|
||||
set => SetValue(TimestampProperty, value);
|
||||
get => GetValue(UseAuthorTimeProperty);
|
||||
set => SetValue(UseAuthorTimeProperty, value);
|
||||
}
|
||||
|
||||
protected override Type StyleKeyOverride => typeof(TextBlock);
|
||||
|
@ -318,7 +318,7 @@ namespace SourceGit.Views
|
|||
{
|
||||
base.OnPropertyChanged(change);
|
||||
|
||||
if (change.Property == TimestampProperty)
|
||||
if (change.Property == UseAuthorTimeProperty)
|
||||
{
|
||||
SetCurrentValue(TextProperty, GetDisplayText());
|
||||
}
|
||||
|
@ -347,6 +347,12 @@ namespace SourceGit.Views
|
|||
StopTimer();
|
||||
}
|
||||
|
||||
protected override void OnDataContextChanged(EventArgs e)
|
||||
{
|
||||
base.OnDataContextChanged(e);
|
||||
SetCurrentValue(TextProperty, GetDisplayText());
|
||||
}
|
||||
|
||||
private void StartTimer()
|
||||
{
|
||||
if (_refreshTimer != null)
|
||||
|
@ -376,30 +382,35 @@ namespace SourceGit.Views
|
|||
|
||||
private string GetDisplayText()
|
||||
{
|
||||
var commit = DataContext as Models.Commit;
|
||||
if (commit == null)
|
||||
return string.Empty;
|
||||
|
||||
var timestamp = UseAuthorTime ? commit.AuthorTime : commit.CommitterTime;
|
||||
if (ShowAsDateTime)
|
||||
return DateTime.UnixEpoch.AddSeconds(Timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
||||
return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
var today = DateTime.Today;
|
||||
var committerTime = DateTime.UnixEpoch.AddSeconds(Timestamp).ToLocalTime();
|
||||
var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime();
|
||||
|
||||
if (committerTime >= today)
|
||||
if (localTime >= today)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
var timespan = now - committerTime;
|
||||
var timespan = now - localTime;
|
||||
if (timespan.TotalHours > 1)
|
||||
return App.Text("Period.HoursAgo", (int)timespan.TotalHours);
|
||||
|
||||
return timespan.TotalMinutes < 1 ? App.Text("Period.JustNow") : App.Text("Period.MinutesAgo", (int)timespan.TotalMinutes);
|
||||
}
|
||||
|
||||
var diffYear = today.Year - committerTime.Year;
|
||||
var diffYear = today.Year - localTime.Year;
|
||||
if (diffYear == 0)
|
||||
{
|
||||
var diffMonth = today.Month - committerTime.Month;
|
||||
var diffMonth = today.Month - localTime.Month;
|
||||
if (diffMonth > 0)
|
||||
return diffMonth == 1 ? App.Text("Period.LastMonth") : App.Text("Period.MonthsAgo", diffMonth);
|
||||
|
||||
var diffDay = today.Day - committerTime.Day;
|
||||
var diffDay = today.Day - localTime.Day;
|
||||
return diffDay == 1 ? App.Text("Period.Yesterday") : App.Text("Period.DaysAgo", diffDay);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,14 +59,14 @@
|
|||
<!-- Body -->
|
||||
<Border Grid.Row="2" Margin="8,0,8,8" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||
<Grid RowDefinitions="*,3,*">
|
||||
<ListBox Grid.Row="0"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
ItemsSource="{Binding Items}"
|
||||
SelectionMode="Single"
|
||||
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
KeyDown="OnItemsListBoxKeyDown">
|
||||
<v:InteractiveRebaseListBox Grid.Row="0"
|
||||
Focusable="True"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
ItemsSource="{Binding Items}"
|
||||
SelectionMode="Single"
|
||||
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
|
@ -213,18 +213,18 @@
|
|||
<TextBlock Grid.Column="6" Classes="primary" Text="{Binding Commit.CommitterTimeStr}" Margin="8,0"/>
|
||||
|
||||
<!-- MoveUp Button -->
|
||||
<Button Grid.Column="7" Classes="icon_button" Click="OnMoveItemUp" ToolTip.Tip="{DynamicResource Text.InteractiveRebase.MoveUp}">
|
||||
<Button Grid.Column="7" Classes="icon_button" Click="OnMoveItemUp" ToolTip.Tip="Alt+Up">
|
||||
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Up}"/>
|
||||
</Button>
|
||||
|
||||
<!-- MoveDown Button -->
|
||||
<Button Grid.Column="8" Classes="icon_button" Click="OnMoveItemDown" ToolTip.Tip="{DynamicResource Text.InteractiveRebase.MoveDown}">
|
||||
<Button Grid.Column="8" Classes="icon_button" Click="OnMoveItemDown" ToolTip.Tip="Alt+Down">
|
||||
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Down}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</v:InteractiveRebaseListBox>
|
||||
|
||||
<v:LoadingIcon Grid.Row="0" Width="48" Height="48" HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding IsLoading}"/>
|
||||
|
||||
|
|
|
@ -1,9 +1,79 @@
|
|||
using System;
|
||||
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public class InteractiveRebaseListBox : ListBox
|
||||
{
|
||||
protected override Type StyleKeyOverride => typeof(ListBox);
|
||||
|
||||
/// <summary>
|
||||
/// Prevent ListBox handle the arrow keys.
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
var vm = DataContext as ViewModels.InteractiveRebase;
|
||||
if (vm == null)
|
||||
return;
|
||||
|
||||
var item = vm.SelectedItem;
|
||||
if (item == null)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Key == Key.P)
|
||||
{
|
||||
item.SetAction(Models.InteractiveRebaseAction.Pick);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.E)
|
||||
{
|
||||
item.SetAction(Models.InteractiveRebaseAction.Edit);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.R)
|
||||
{
|
||||
item.SetAction(Models.InteractiveRebaseAction.Reword);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.S)
|
||||
{
|
||||
item.SetAction(Models.InteractiveRebaseAction.Squash);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.F)
|
||||
{
|
||||
item.SetAction(Models.InteractiveRebaseAction.Fixup);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.D)
|
||||
{
|
||||
item.SetAction(Models.InteractiveRebaseAction.Drop);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.KeyModifiers == KeyModifiers.Alt && e.Key == Key.Up)
|
||||
{
|
||||
vm.MoveItemUp(item);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.KeyModifiers == KeyModifiers.Alt && e.Key == Key.Down)
|
||||
{
|
||||
vm.MoveItemDown(item);
|
||||
e.Handled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class InteractiveRebase : ChromelessWindow
|
||||
{
|
||||
public InteractiveRebase()
|
||||
|
@ -89,26 +159,6 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
private void OnItemsListBoxKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
var item = (sender as ListBox)?.SelectedItem as ViewModels.InteractiveRebaseItem;
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
if (e.Key == Key.P)
|
||||
item.SetAction(Models.InteractiveRebaseAction.Pick);
|
||||
else if (e.Key == Key.E)
|
||||
item.SetAction(Models.InteractiveRebaseAction.Edit);
|
||||
else if (e.Key == Key.R)
|
||||
item.SetAction(Models.InteractiveRebaseAction.Reword);
|
||||
else if (e.Key == Key.S)
|
||||
item.SetAction(Models.InteractiveRebaseAction.Squash);
|
||||
else if (e.Key == Key.F)
|
||||
item.SetAction(Models.InteractiveRebaseAction.Fixup);
|
||||
else if (e.Key == Key.D)
|
||||
item.SetAction(Models.InteractiveRebaseAction.Drop);
|
||||
}
|
||||
|
||||
private async void StartJobs(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
var vm = DataContext as ViewModels.InteractiveRebase;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<TabItem.Header>
|
||||
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.General}"/>
|
||||
</TabItem.Header>
|
||||
<Grid Margin="8" RowDefinitions="32,32,32,32,32" ColumnDefinitions="Auto,*">
|
||||
<Grid Margin="8" RowDefinitions="32,32,32,32,32,32" ColumnDefinitions="Auto,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.General.Locale}"
|
||||
HorizontalAlignment="Right"
|
||||
|
@ -113,6 +113,11 @@
|
|||
</Grid>
|
||||
|
||||
<CheckBox Grid.Row="4" Grid.Column="1"
|
||||
Height="32"
|
||||
Content="{DynamicResource Text.Preference.General.ShowAuthorTime}"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowAuthorTimeInGraph, Mode=TwoWay}"/>
|
||||
|
||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
Height="32"
|
||||
Content="{DynamicResource Text.Preference.General.Check4UpdatesOnStartup}"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=Check4UpdatesOnStartup, Mode=TwoWay}"/>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
|
||||
<StackPanel x:Name="Popup" IsVisible="False" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Effect="drop-shadow(0 0 6 #40000000)">
|
||||
<StackPanel x:Name="Popup" IsVisible="False" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Effect="drop-shadow(0 0 8 #80000000)">
|
||||
<Button Classes="flat" Content="{DynamicResource Text.Hunk.Stage}" Click="OnStageChunk" IsVisible="{Binding #ThisControl.IsUnstagedChange}"/>
|
||||
<Button Classes="flat" Content="{DynamicResource Text.Hunk.Unstage}" Click="OnUnstageChunk" IsVisible="{Binding #ThisControl.IsUnstagedChange, Converter={x:Static BoolConverters.Not}}"/>
|
||||
<Button Classes="flat" Content="{DynamicResource Text.Hunk.Discard}" Margin="8,0,0,0" Click="OnDiscardChunk" IsVisible="{Binding #ThisControl.IsUnstagedChange}"/>
|
||||
|
|
Loading…
Reference in a new issue