Browse Source

fix: 按钮文案

wzl 1 year ago
parent
commit
59ca6ef7aa

+ 2 - 2
packages/core/src/form/add_radio_button.js

@@ -239,14 +239,14 @@ export default class AddRadioButton {
   
       const textfieldArr = annotArr.filter(item => item.type === 'radio-button')
       for (let i = 0; i <= textfieldArr.length; i++) {
-        const name = 'RadioGroup' + (i + 1)
+        const name = 'Group' + (i + 1)
         if (textfieldArr.every(item => item.fieldName !== name)) {
           index = i + 1
           break
         }
       }
     }
-    this.fieldName = 'RadioGroup' + index
+    this.fieldName = 'Group' + index
     console.log('setInitProperty: ', this.fieldName)
   }
 }

+ 2 - 1
packages/core/src/form/combo_box.js

@@ -146,7 +146,8 @@ export default class ComboBox extends Base {
         width: `${Math.abs(rect.width)}px`,
         height: `${Math.abs(rect.height)}px`,
         backgroundColor: annotation.backgroundColor,
-        position: 'relative'
+        position: 'relative',
+        overflow: 'hidden'
       }
     )
 

+ 1 - 1
packages/core/src/ui_utils.js

@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
 const DEFAULT_SCALE_VALUE = 'page-fit';
 const DEFAULT_SCALE = 1.0;
 const DEFAULT_SCALE_DELTA = 1.1;
-const MIN_SCALE = 0.1;
+const MIN_SCALE = 0.05;
 const MAX_SCALE = 10.0;
 const UNKNOWN_SCALE = 0;
 const MAX_AUTO_SCALE = 1.25;

+ 10 - 10
packages/webview/src/components/Annotate/Annotate.vue

@@ -26,28 +26,28 @@
     </Button>
   </div> -->
   <StickyNoteButton />
-  <Button :class="{ active: markupActive && markupTool === 'highlight' }" @click.stop="changeMarkupTool('highlight')"><Highlight /></Button>
-  <Button :class="{ active: markupActive && markupTool === 'underline' }" @click.stop="changeMarkupTool('underline')"><Underline /></Button>
-  <Button :class="{ active: markupActive && markupTool === 'strikeout' }" @click.stop="changeMarkupTool('strikeout')"><Strikeout /></Button>
-  <Button :class="{ active: markupActive && markupTool === 'squiggly' }" @click.stop="changeMarkupTool('squiggly')"><Squiggle /></Button>
-  <Button :class="{ active: activeTool === 'ink' }" @click="changeActiveTool('ink')">
+  <Button :class="{ active: markupActive && markupTool === 'highlight' }" @click.stop="changeMarkupTool('highlight')" title="Highlight"><Highlight /></Button>
+  <Button :class="{ active: markupActive && markupTool === 'underline' }" @click.stop="changeMarkupTool('underline')" title="Underline"><Underline /></Button>
+  <Button :class="{ active: markupActive && markupTool === 'strikeout' }" @click.stop="changeMarkupTool('strikeout')" title="Strikeout"><Strikeout /></Button>
+  <Button :class="{ active: markupActive && markupTool === 'squiggly' }" @click.stop="changeMarkupTool('squiggly')" title="Squiggly"><Squiggle /></Button>
+  <Button :class="{ active: activeTool === 'ink' }" @click="changeActiveTool('ink')" title="Ink">
     <Ink />
   </Button>
   <div class="shape-container markup-container">
-    <Button :class="{ active: shapeActive && shapeTool === 'circle' }" @click.stop="changeShapeTool('circle')">
+    <Button :class="{ active: shapeActive && shapeTool === 'circle' }" @click.stop="changeShapeTool('circle')" title="Circle">
       <EllipseTool />
     </Button>
-    <Button :class="{ active: shapeActive && shapeTool === 'square' }" @click.stop="changeShapeTool('square')">
+    <Button :class="{ active: shapeActive && shapeTool === 'square' }" @click.stop="changeShapeTool('square')" title="Square">
       <RectangleTool />
     </Button>
-    <Button :class="{ active: shapeActive && shapeTool === 'arrow' }" @click.stop="changeShapeTool('arrow')">
+    <Button :class="{ active: shapeActive && shapeTool === 'arrow' }" @click.stop="changeShapeTool('arrow')" title="Arrow">
       <ArrowTool />
     </Button>
-    <Button :class="{ active: shapeActive && shapeTool === 'line' }" @click.stop="changeShapeTool('line')">
+    <Button :class="{ active: shapeActive && shapeTool === 'line' }" @click.stop="changeShapeTool('line')" title="Line">
       <LineTool />
     </Button>
   </div>
-  <Button :class="{ active: activeTool === 'freetext' }" @click="changeActiveTool('freetext')">
+  <Button :class="{ active: activeTool === 'freetext' }" @click="changeActiveTool('freetext')" title="Freetext">
     <Text />
   </Button>
   <div class="divider pc"></div>

+ 1 - 1
packages/webview/src/components/CheckBoxButton/CheckBoxButton.vue

@@ -1,5 +1,5 @@
 <template>
-  <Button class="with-text" :class="{ active: activeTool === 'checkbox' }" @click="changeActiveTool('checkbox')">
+  <Button class="with-text" title="Check Box" :class="{ active: activeTool === 'checkbox' }" @click="changeActiveTool('checkbox')">
     <CheckBoxIcon />
     <span>Check Box</span>
   </Button>

+ 1 - 1
packages/webview/src/components/ComboBox/ComboBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <Button class="with-text" :class="{ active: activeTool === 'combobox' }" @click="changeActiveTool('combobox')">
+  <Button class="with-text" title="Combo Box" :class="{ active: activeTool === 'combobox' }" @click="changeActiveTool('combobox')">
     <ComboBoxIcon />
     <span>Combo Box</span>
   </Button>

+ 1 - 1
packages/webview/src/components/ListBox/ListBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <Button class="with-text" :class="{ active: activeTool === 'listbox' }" @click="changeActiveTool('listbox')">
+  <Button class="with-text" title="List Box" :class="{ active: activeTool === 'listbox' }" @click="changeActiveTool('listbox')">
     <ListBoxIcon />
     <span>List Box</span>
   </Button>

+ 1 - 1
packages/webview/src/components/PageMode/PageMode.vue

@@ -1,5 +1,5 @@
 <template>
-  <Button :class="{ active: pageViewActive }" @click="changePageViewStatus">
+  <Button :class="{ active: pageViewActive }" @click="changePageViewStatus" title="View Setting">
     <Pageset />
   </Button>
 </template>

+ 2 - 2
packages/webview/src/components/PushButton/PushButton.vue

@@ -1,7 +1,7 @@
 <template>
-  <Button class="with-text" :class="{ active: activeTool === 'pushbutton' }" @click="changeActiveTool('pushbutton')">
+  <Button class="with-text" title="PushButton" :class="{ active: activeTool === 'pushbutton' }" @click="changeActiveTool('pushbutton')">
     <PushButtonIcon />
-    <span>Push Button</span>
+    <span>PushButton</span>
   </Button>
 </template>
 

+ 1 - 1
packages/webview/src/components/RadioButton/RadioButton.vue

@@ -1,5 +1,5 @@
 <template>
-  <Button class="with-text" :class="{ active: activeTool === 'radiobutton' }" @click="changeActiveTool('radiobutton')">
+  <Button class="with-text" title="Radio Button" :class="{ active: activeTool === 'radiobutton' }" @click="changeActiveTool('radiobutton')">
     <RadioButtonIcon />
     <span>Radio Button</span>
   </Button>

+ 2 - 2
packages/webview/src/components/RightPanel/RightPanel.vue

@@ -11,7 +11,7 @@
 
     <div class="sidebar-content">
       <!-- 单选框错误提示 -->
-      <div v-show="isOne && selectedElement === 'radiobutton'" class="radio-top-tip">1 button in group. At lease 2 buttons needed.</div>
+      <div v-show="isOne && selectedElement === 'radiobutton'" class="radio-top-tip">Only 1 button is in the group. At least 2 buttons are needed in a group.</div>
 
       <!-- general -->
       <div class="general-container" :class="{ hidden: activePanelTab !== 'GENERAL' }">
@@ -196,7 +196,7 @@
       </div>
 
       <!-- 单选框错误提示 -->
-      <div v-show="selectedElement === 'radiobutton'" class="radio-bottom-tip">To create a set of mutualy exclusive radio buttons (i.e., where only one can be selected at a time), please give the fields the same name.</div>
+      <div v-show="selectedElement === 'radiobutton'" class="radio-bottom-tip">To create a set of mutually exclusive radio buttons (i.e., where only one can be selected at a time), please give the fields the same name to let buttons in one group.</div>
       <!-- 下拉框错误提示 -->
       <div v-show="selectedElement === 'combobox'" class="radio-bottom-tip">Select an item in the item list to make it the default option.</div>
     </div>

+ 6 - 6
packages/webview/src/components/RightPanelPageMode/RightPanelPageMode.vue

@@ -4,21 +4,21 @@
     :class="{
       closed: !isOpen
     }">
-    <div class="sidebar-title">Preview settings</div>
+    <div class="sidebar-title">View Setting</div>
     <div class="mode-container">
       <div class="mode-item">
         <h2>Display Mode</h2>
         <div class="mode-tabs">
-          <Button :class="{ active: scrollMode === 'Vertical' }" @click="handleScrollMode('Vertical', 0)"><VerticalScrolling /></Button>
-          <Button :class="{ active: scrollMode === 'Horizontal' }" @click="handleScrollMode('Horizontal', 1)"><HorizontalScrolling /></Button>
+          <Button :class="{ active: scrollMode === 'Vertical' }" @click="handleScrollMode('Vertical', 0)" title="Vertical"><VerticalScrolling /></Button>
+          <Button :class="{ active: scrollMode === 'Horizontal' }" @click="handleScrollMode('Horizontal', 1)" title="Horizontal"><HorizontalScrolling /></Button>
         </div>
       </div>
       <div class="mode-item">
         <h2>Split View</h2>
         <div class="mode-tabs">
-          <Button :class="{ active: pageMode === 0 }" @click="handleSpreadMode(0)"><SinglePage /></Button>
-          <Button :class="{ active: pageMode === 1 }" @click="handleSpreadMode(1)"><DoublePage /></Button>
-          <Button :class="{ active: pageMode === 2 }" @click="handleSpreadMode(2)"><Pagecover /></Button>
+          <Button :class="{ active: pageMode === 0 }" @click="handleSpreadMode(0)" title="Single Page"><SinglePage /></Button>
+          <Button :class="{ active: pageMode === 1 }" @click="handleSpreadMode(1)" title="Double Page"><DoublePage /></Button>
+          <Button :class="{ active: pageMode === 2 }" @click="handleSpreadMode(2)" title="Cover Mode"><Pagecover /></Button>
         </div>
       </div>
       <div class="mode-item">

+ 1 - 0
packages/webview/src/components/StickyNoteButton/StickyNoteButton.vue

@@ -3,6 +3,7 @@
     :isActive="activeTool === 'text'"
     v-bind="{ ...item }"
     :onClick="onClick"
+    title="Note"
   >
     <Note />
   </Button>

+ 1 - 1
packages/webview/src/components/TextFieldButton/TextFieldButton.vue

@@ -1,5 +1,5 @@
 <template>
-  <Button class="with-text" :class="{ active: activeTool === 'textfield' }" @click="changeActiveTool('textfield')">
+  <Button class="with-text" title="Text Field" :class="{ active: activeTool === 'textfield' }" @click="changeActiveTool('textfield')">
     <TextFieldIcon />
     <span>Text Field</span>
   </Button>

+ 2 - 2
packages/webview/src/components/Toolbar/Toolbar.vue

@@ -10,10 +10,10 @@
       <!-- Form -->
       <TextFieldButton v-if="item.type === 'textFieldButton'" :item="item" />
       <CheckBoxButton v-if="item.type === 'checkBoxButton'" :item="item" />
-      <!-- <RadioButton v-if="item.type === 'radioButton'" :item="item" />
+      <RadioButton v-if="item.type === 'radioButton'" :item="item" />
       <ListBox v-if="item.type === 'listBox'" :item="item" />
       <ComboBox v-if="item.type === 'comboBox'" :item="item" />
-      <PushButton v-if="item.type === 'pushButton'" :item="item" /> -->
+      <PushButton v-if="item.type === 'pushButton'" :item="item" />
     </template>
   </div>
 </template>