diff options
author | geireann <60007097+geireann@users.noreply.github.com> | 2021-08-24 18:10:13 -0400 |
---|---|---|
committer | geireann <60007097+geireann@users.noreply.github.com> | 2021-08-24 18:10:13 -0400 |
commit | 325d3a8c931cb9ff7eadfa29603a3c7ca747911b (patch) | |
tree | 19289019d5061feee16c0e5a33e70d68b9cdcd48 /src/client/util/CurrentUserUtils.ts | |
parent | d1ea2f764d0207963788eb4238ede79bcffa23f6 (diff) |
css changes for toggle button
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
-rw-r--r-- | src/client/util/CurrentUserUtils.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 73a66332f..8044f59f0 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -46,7 +46,9 @@ interface Button { icon?: string; btnType?: ButtonType; click?: string; - numType?: NumButtonType; + numBtnType?: NumButtonType; + numBtnMin?: number; + numBtnMax?: number; switchToggle?: boolean; script?: string; width?: number; @@ -946,7 +948,7 @@ export class CurrentUserUtils { "Comic Sans MS", "Tahoma", "Impact", "Crimson Text"], script: 'changeFont' }, - { title: "Font size", toolTip: "Font size", btnType: ButtonType.NumberButton, numType: NumButtonType.DropdownOptions, ignoreClick: true, script: 'changeFontSize'}, + { title: "Font size", toolTip: "Font size", width: 75, btnType: ButtonType.NumberButton, numBtnMax: 200, numBtnMin: 0, numBtnType: NumButtonType.DropdownOptions, ignoreClick: true, script: 'changeFontSize'}, { title: "Bold", toolTip: "Bold (Ctrl+B)", btnType: ButtonType.ToggleButton, icon: "bold", click: 'toggleBold()', script: 'toggleBold' }, { title: "Italic", toolTip: "Italic (Ctrl+I)", btnType: ButtonType.ToggleButton, icon: "italic", click: 'toggleItalic()', script: 'toggleItalic' }, { title: "Underline", toolTip: "Underline (Ctrl+U)", btnType: ButtonType.ToggleButton, icon: "underline", click: 'toggleUnderline()', script: 'toggleUnderline' }, @@ -970,7 +972,7 @@ export class CurrentUserUtils { { title: "Circle", toolTip: "Circle (Ctrl+Shift+C)", btnType: ButtonType.ToggleButton, icon: "circle", click: 'setActiveInkTool("circle")' }, { title: "Square", toolTip: "Square (Ctrl+Shift+S)", btnType: ButtonType.ToggleButton, icon: "square", click: 'setActiveInkTool("square")' }, { title: "Line", toolTip: "Line (Ctrl+Shift+L)", btnType: ButtonType.ToggleButton, icon: "fill-drip", click: 'setActiveInkTool("line")' }, - { title: "Stroke width", toolTip: "Stroke width", width:75, btnType: ButtonType.NumberButton, numType: NumButtonType.Slider, ignoreClick: true, script: 'setLineWidth'}, + { title: "Stroke width", toolTip: "Stroke width", btnType: ButtonType.NumberButton, numBtnType: NumButtonType.Slider, ignoreClick: true, script: 'setStrokeWidth'}, ]; return tools; } @@ -982,6 +984,7 @@ export class CurrentUserUtils { title: "Show preview", toolTip: "Show preview of selected document", btnType: ButtonType.ToggleButton, + width: 50, switchToggle: true, icon: "eye", click: 'toggleSchemaShow()', @@ -1050,9 +1053,10 @@ export class CurrentUserUtils { tools = CurrentUserUtils.textTools(doc); break; default: + tools = CurrentUserUtils.textTools(doc); break; } - tools.map(({ title, toolTip, icon, btnType, numType, click, script, width, list, ignoreClick }) => { + tools.map(({ title, toolTip, icon, btnType, numBtnType, click, script, width, list, ignoreClick, switchToggle }) => { menuDocList.push(Docs.Create.FontIconDocument({ _nativeWidth: width ? width : 25, _nativeHeight: 25, @@ -1060,7 +1064,7 @@ export class CurrentUserUtils { _height: 25, icon, toolTip, - numType, + numBtnType, script, btnType: btnType, btnList: new List<string>(list), @@ -1070,6 +1074,7 @@ export class CurrentUserUtils { system: true, dontUndo: true, title, + switchToggle, color: Colors.WHITE, backgroundColor: "transparent", _dropAction: "alias", |