From e2696ad137f9726b0e783cc1f1d2e9737bf2a780 Mon Sep 17 00:00:00 2001 From: Zhilin Liu Date: Tue, 16 Jan 2024 11:16:49 +0800 Subject: [PATCH] feat: button Tooltip --- src/Lang/Locale/en-US/ToolBar.json | 3 +- src/Lang/Locale/zh-CN/ToolBar.json | 3 +- .../ToolBar/components/Home/FontStyle.vue | 134 ++++++++++-------- .../ToolBar/components/Home/Paragraph.vue | 70 +++++---- .../ToolBar/components/Insert/Text.vue | 2 +- src/UserInterface/components/Tooltip.vue | 22 +++ 6 files changed, 144 insertions(+), 90 deletions(-) create mode 100644 src/UserInterface/components/Tooltip.vue diff --git a/src/Lang/Locale/en-US/ToolBar.json b/src/Lang/Locale/en-US/ToolBar.json index 84875ae..12dc543 100644 --- a/src/Lang/Locale/en-US/ToolBar.json +++ b/src/Lang/Locale/en-US/ToolBar.json @@ -76,7 +76,8 @@ "title": "Link" }, "textBox": { - "title": "Text Box" + "title": "Text", + "textBox": "Text Box" }, "footer": { "title": "Footer" diff --git a/src/Lang/Locale/zh-CN/ToolBar.json b/src/Lang/Locale/zh-CN/ToolBar.json index 83c676c..9544fbe 100644 --- a/src/Lang/Locale/zh-CN/ToolBar.json +++ b/src/Lang/Locale/zh-CN/ToolBar.json @@ -76,7 +76,8 @@ "title": "链接" }, "textBox": { - "title": "文本框" + "title": "文本", + "textBox": "文本框" }, "footer": { "title": "页脚" diff --git a/src/UserInterface/ToolBar/components/Home/FontStyle.vue b/src/UserInterface/ToolBar/components/Home/FontStyle.vue index 2c20e84..636e920 100644 --- a/src/UserInterface/ToolBar/components/Home/FontStyle.vue +++ b/src/UserInterface/ToolBar/components/Home/FontStyle.vue @@ -22,6 +22,7 @@ import { FONT_FAMILY_RANGE, FONT_SIZE_RANGE, } from '@Const/font' +import Tooltip from '@UserInterface/components/Tooltip.vue' const buttonStyle = 'menu-btn w-[32px] h-[30px]' const activeButtonStyle = 'border border-black bg-gray-200' @@ -103,65 +104,84 @@ richTextObserver.on(async (newState) => { --> - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UserInterface/ToolBar/components/Home/Paragraph.vue b/src/UserInterface/ToolBar/components/Home/Paragraph.vue index 9c4a55d..dd4769f 100644 --- a/src/UserInterface/ToolBar/components/Home/Paragraph.vue +++ b/src/UserInterface/ToolBar/components/Home/Paragraph.vue @@ -15,6 +15,7 @@ import { AlignType, TextBoxBlock } from '@BlockHub/TextBoxBlock/TextBoxBlock' import { selectionManager } from '@Kernel/index' import { ref, shallowRef } from 'vue' import { computed } from 'vue' +import Tooltip from '@UserInterface/components/Tooltip.vue' const buttonStyle = 'menu-btn w-[34px] h-[34px]' const activeButtonStyle = 'border border-black bg-gray-200' @@ -74,36 +75,45 @@ const updateAlign = (value: AlignType) => { --> - - - + + + + + + + + + + + + diff --git a/src/UserInterface/ToolBar/components/Insert/Text.vue b/src/UserInterface/ToolBar/components/Insert/Text.vue index 25d6198..d8c401f 100644 --- a/src/UserInterface/ToolBar/components/Insert/Text.vue +++ b/src/UserInterface/ToolBar/components/Insert/Text.vue @@ -17,7 +17,7 @@ import ToolButton from '../ToolButton.vue' :strokeWidth="2" /> - + diff --git a/src/UserInterface/components/Tooltip.vue b/src/UserInterface/components/Tooltip.vue new file mode 100644 index 0000000..00f5247 --- /dev/null +++ b/src/UserInterface/components/Tooltip.vue @@ -0,0 +1,22 @@ + + +