From 0c8db2d243a0fb66a95195dcea11041a4dfcafb9 Mon Sep 17 00:00:00 2001 From: NI Date: Sun, 15 Dec 2019 16:22:26 +0800 Subject: [PATCH] Adjust console font resize interface for easier access, and make min-allowed font size to 8 --- ui/common.css | 12 +++-- ui/widgets/screen_console.css | 42 +++++++++++++++ ui/widgets/screen_console.vue | 97 ++++++++++++++++++++--------------- 3 files changed, 107 insertions(+), 44 deletions(-) diff --git a/ui/common.css b/ui/common.css index 38cab432..ae32bd25 100644 --- a/ui/common.css +++ b/ui/common.css @@ -285,12 +285,18 @@ body { box-shadow: 1px 1px 0 2px #0003; } -.icon.icon-keyboardkey2 { - background: #fff; - color: #999; +.icon.icon-iconed-bottom1 { padding: 4px 6px; display: inline-block; border-radius: 3px; + text-align: center; +} +.icon.icon-iconed-bottom1 > i { + font-style: normal; + display: block; + margin: 3px; + font-size: 2em; + font-weight: normal; } /* Windows */ diff --git a/ui/widgets/screen_console.css b/ui/widgets/screen_console.css index 60af20e1..22a167c7 100644 --- a/ui/widgets/screen_console.css +++ b/ui/widgets/screen_console.css @@ -57,6 +57,28 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group.console-toolbar-group-left { + border-right: 1px solid #0001; + margin-right: -1px; + float: left; +} + +#home-content + > .screen + > .screen-screen + > .screen-console + > .console-toolbar + > .console-toolbar-group.console-toolbar-group-main { + border-left: 1px solid #0001; + overflow: auto; +} + +#home-content + > .screen + > .screen-screen + > .screen-console + > .console-toolbar + > .console-toolbar-group > .console-toolbar-item { padding: 15px; float: left; @@ -67,6 +89,7 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-title { font-size: 0.7em; @@ -81,6 +104,7 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-item { display: block; @@ -96,6 +120,7 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-item:active { background: #fff3; @@ -106,6 +131,7 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-item > .tb-key-icon { @@ -119,6 +145,20 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group + > .console-toolbar-item + .tb-item + > .tb-key-icon.tb-key-resize-icon { + display: block; + padding: 5px; +} + +#home-content + > .screen + > .screen-screen + > .screen-console + > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-item > .tb-key-icon:first-child { @@ -130,6 +170,7 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-item > .tb-key-icon:last-child { @@ -141,6 +182,7 @@ > .screen-screen > .screen-console > .console-toolbar + > .console-toolbar-group > .console-toolbar-item .tb-item:active .tb-key-icon { diff --git a/ui/widgets/screen_console.vue b/ui/widgets/screen_console.vue index ef0381a6..cdafc3a5 100644 --- a/ui/widgets/screen_console.vue +++ b/ui/widgets/screen_console.vue @@ -47,40 +47,54 @@ >

Tool bar

-
-

Text size

- - +
+
+

Text size

+ + +
-
-

{{ keyType.title }}

- -
    -
  • - -
  • -
+
+
+

{{ keyType.title }}

+ +
    +
  • + +
  • +
+
@@ -107,7 +121,7 @@ const termTypeFaceLoadError = termFallbackTypeFace + '" instead until the remote font is loaded'; const termDefaultFontSize = 16; -const termMinFontSize = 14; +const termMinFontSize = 8; const termMaxFontSize = 36; class Term { @@ -223,14 +237,6 @@ class Term { }); } - setFont(value) { - if (this.closed) { - return; - } - - this.term.setOption("fontFamily", value); - } - init(root, callbacks) { if (this.closed) { return; @@ -322,6 +328,15 @@ class Term { } } + setFont(value) { + if (this.closed) { + return; + } + + this.term.setOption("fontFamily", value); + this.refit(); + } + fontSizeUp() { if (this.closed) { return;