From b07e2c2f5f2b2fa2385f79a96592be0ae76f00da Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 11:34:04 +0800 Subject: [PATCH] feature: add a new button `Paste (Replace all)` to paste commit message from clipboard (#1169) Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/CommitMessageTextBox.axaml | 13 +++++++++++-- src/Views/CommitMessageTextBox.axaml.cs | 20 ++++++++++++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 562fb190..98334853 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -166,6 +166,7 @@ Signer: Open in Browser Description + Paste (Replace all) SUBJECT Enter commit subject Repository Configure diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 18e4cf47..59d06e3e 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -170,6 +170,7 @@ 签名者 : 浏览器中查看 详细描述 + 粘贴(替换全部) 主题 填写提交信息主题 仓库配置 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 30666ab1..78539749 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -170,6 +170,7 @@ 簽署人: 在瀏覽器中檢視 詳細描述 + 粘貼(替換所有內容) 標題 填寫提交訊息標題 存放庫設定 diff --git a/src/Views/CommitMessageTextBox.axaml b/src/Views/CommitMessageTextBox.axaml index 794ebaa4..8d99bf66 100644 --- a/src/Views/CommitMessageTextBox.axaml +++ b/src/Views/CommitMessageTextBox.axaml @@ -66,7 +66,7 @@ Background="{DynamicResource Brush.Window}" BorderThickness="1,0,0,0" CornerRadius="0,0,4,4"> - + - + + + + 1 ? $"{subject}\n\n{parts[1].Trim()}" : subject; + } + } + catch + { + // Ignore exceptions. + } + + e.Handled = true; + } + private TextChangeWay _changingWay = TextChangeWay.None; } }