From 457a1e79c7cf53263ad96e7d660bc4ed8e5eb289 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 24 Nov 2024 11:04:59 +0800 Subject: [PATCH] code_review: PR #734 * remove unnecessary namespace using * do NOT set tooltip currently, because CommitDetail.GetParent may cause UI lags and the tooltip DataTemplate is not provided. * add translations for zh_CN and zh_TW Signed-off-by: leo --- src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/CommitMessagePresenter.cs | 8 +------- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 5493434c..a5af3400 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -606,6 +606,7 @@ 软件更新 当前已是最新版本。 复制提交指纹 + 跳转到提交 压缩为单个提交 合并入: SSH密钥 : diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index de431e16..3989259d 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -605,6 +605,7 @@ 軟體更新 目前已是最新版本。 複製提交編號 + 導覽到提交 壓縮為單個提交 合併入: SSH 金鑰: diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index c4da7e94..a022ae99 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -7,7 +7,6 @@ using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Controls.Documents; using Avalonia.Input; -using Avalonia.Platform.Storage; using Avalonia.VisualTree; namespace SourceGit.Views @@ -115,7 +114,7 @@ namespace SourceGit.Views { base.OnPointerMoved(e); - if (e.Pointer.Captured == this) + if (Equals(e.Pointer.Captured, this)) { var relativeSelfY = e.GetPosition(this).Y; if (relativeSelfY <= 0 || relativeSelfY > Bounds.Height) @@ -155,11 +154,6 @@ namespace SourceGit.Views ToolTip.SetTip(this, match.Link); ToolTip.SetIsOpen(this, true); } - else if (this.FindAncestorOfType() is { DataContext: ViewModels.CommitDetail detail } && detail.GetParent(match.Link) is Models.Commit c) - { - ToolTip.SetTip(this, c); - ToolTip.SetIsOpen(this, true); - } return; }