From 5bde54aac194d4eadbbc2892b64f77584181954e Mon Sep 17 00:00:00 2001 From: 3gf8jv4dv <3gf8jv4dv@gmail.com> Date: Mon, 23 Dec 2024 23:53:10 +0800 Subject: [PATCH] Fix edit theme dialog title logic (#2205) * Fix edit theme dialog title logic As you can see from the code and the actual behavior, both share the same code whether adding or editing a theme. So why does the title show up as "Edit Theme" no matter what? It does seem strange in a way. This feature appears to have been added in v2.0.0, but no one seems to have cared about the issue during the two years. Nonetheless, when I realized this recently, I decided to fix it. Hopefully this will make things clearer for those users who may not be able to tell the difference. Now, when the "Add theme" button is clicked, the dialog title will show "Add theme". If you right-click on a user-created theme, the dialog title will show "Edit theme". * Apply suggestions from lyswhut Simpler code Co-authored-by: lyswhut --------- Co-authored-by: lyswhut --- src/lang/en-us.json | 3 ++- src/lang/zh-cn.json | 3 ++- src/lang/zh-tw.json | 5 +++-- .../views/Setting/components/ThemeEditModal/index.vue | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 4c9ff96d..d0df7103 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -686,7 +686,8 @@ "theme_edit_modal__remove_tip": "Do you really want to remove this theme?", "theme_edit_modal__save_new": "Copy", "theme_edit_modal__select_bg_file": "Choose a background image", - "theme_edit_modal__title": "Edit Theme", + "theme_edit_modal__title_add": "Add Theme", + "theme_edit_modal__title_edit": "Edit Theme", "theme_green": "Green", "theme_grey": "Grey", "theme_happy_new_year": "New Year", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 7aeeeae5..ef602521 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -686,7 +686,8 @@ "theme_edit_modal__remove_tip": "是否真的要移除这个主题?", "theme_edit_modal__save_new": "另存", "theme_edit_modal__select_bg_file": "选择背景图片", - "theme_edit_modal__title": "编辑主题", + "theme_edit_modal__title_add": "添加主题", + "theme_edit_modal__title_edit": "编辑主题", "theme_green": "绿意盎然", "theme_grey": "灰常美丽", "theme_happy_new_year": "新年快乐", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 871ed815..8174f07b 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -665,7 +665,7 @@ "theme_edit_modal__badge_tertiary": "第三顏色", "theme_edit_modal__bg_image": "背景圖片", "theme_edit_modal__bg_image_add": "背景圖片:", - "theme_edit_modal__bg_image_change": "更改背景圖片", + "theme_edit_modal__bg_image_change": "變更背景圖片", "theme_edit_modal__bg_image_remove": "移除背景圖片", "theme_edit_modal__close_btn": "關閉", "theme_edit_modal__control_btn": "左側控制按鈕顏色", @@ -686,7 +686,8 @@ "theme_edit_modal__remove_tip": "是否真的要移除這個主題?", "theme_edit_modal__save_new": "另存", "theme_edit_modal__select_bg_file": "選擇背景圖片", - "theme_edit_modal__title": "編輯主題", + "theme_edit_modal__title_add": "新增主題", + "theme_edit_modal__title_edit": "編輯主題", "theme_green": "綠意盎然", "theme_grey": "灰常美麗", "theme_happy_new_year": "新年快樂", diff --git a/src/renderer/views/Setting/components/ThemeEditModal/index.vue b/src/renderer/views/Setting/components/ThemeEditModal/index.vue index f4433399..dfcdc7a3 100644 --- a/src/renderer/views/Setting/components/ThemeEditModal/index.vue +++ b/src/renderer/views/Setting/components/ThemeEditModal/index.vue @@ -1,7 +1,7 @@