diff options
author | Devaev Maxim <[email protected]> | 2021-04-23 19:19:55 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-04-23 19:19:55 +0300 |
commit | 4572cd586ecb26346f7ec5236ba7b9c6f3623657 (patch) | |
tree | a1363ae2e78508a283d6ec272e38570510091c9a | |
parent | 1a584492c62079f085f972f330e6aa4a9de5fbf9 (diff) |
button to reduce the window
-rw-r--r-- | web/kvm/index.html | 1 | ||||
-rw-r--r-- | web/kvm/window-stream.pug | 1 | ||||
-rw-r--r-- | web/share/css/window.css | 10 | ||||
-rw-r--r-- | web/share/js/wm.js | 14 |
4 files changed, 23 insertions, 3 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html index 1daf80d1..69b18cf8 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -508,6 +508,7 @@ <div class="window-grab">Stream</div> <button class="window-button-close">×</button> <button class="window-button-maximize">☐</button> + <button class="window-button-original">•</button> <button class="window-button-full-screen">⤢</button> </div> <div id="stream-info"></div> diff --git a/web/kvm/window-stream.pug b/web/kvm/window-stream.pug index 567654b7..802ac87c 100644 --- a/web/kvm/window-stream.pug +++ b/web/kvm/window-stream.pug @@ -3,6 +3,7 @@ div(id="stream-window" class="window window-resizable" data-show-by-button="show div(class="window-grab") Stream button(class="window-button-close") × button(class="window-button-maximize") ☐ + button(class="window-button-original") • button(class="window-button-full-screen") ⤢ div(id="stream-info") diff --git a/web/share/css/window.css b/web/share/css/window.css index ff74d21b..01d9c796 100644 --- a/web/share/css/window.css +++ b/web/share/css/window.css @@ -108,6 +108,7 @@ div.window div.window-header-grabbed { } div.window div.window-header button.window-button-full-screen, +div.window div.window-header button.window-button-original, div.window div.window-header button.window-button-maximize, div.window div.window-header button.window-button-close { border: none; @@ -121,14 +122,17 @@ div.window div.window-header button.window-button-close { display: inline-block; } div.window div.window-header button.window-button-full-screen { - right: 90px; + right: 135px; } -div.window div.window-header button.window-button-close { - right: 0px; +div.window div.window-header button.window-button-original { + right: 90px; } div.window div.window-header button.window-button-maximize { right: 45px; } +div.window div.window-header button.window-button-close { + right: 0px; +} @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { /* iPad */ diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 44238447..e735f526 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -88,6 +88,7 @@ function __WindowManager() { let el_close_button = el_window.querySelector(".window-header .window-button-close"); if (el_close_button) { + el_close_button.title = "Close window"; tools.setOnClick(el_close_button, function() { __closeWindow(el_window); __activateLastWindow(el_window); @@ -96,14 +97,27 @@ function __WindowManager() { let el_maximize_button = el_window.querySelector(".window-header .window-button-maximize"); if (el_maximize_button) { + el_maximize_button.title = "Maximize window"; tools.setOnClick(el_maximize_button, function() { __maximizeWindow(el_window); __activateLastWindow(el_window); }); } + let el_orig_button = el_window.querySelector(".window-header .window-button-original"); + if (el_orig_button) { + el_maximize_button.title = "Reduce window to its original size and center it"; + tools.setOnClick(el_orig_button, function() { + el_window.style.width = ""; + el_window.style.height = ""; + __centerWindow(el_window); + __activateLastWindow(el_window); + }); + } + let el_full_screen_button = el_window.querySelector(".window-header .window-button-full-screen"); if (el_full_screen_button && __getFullScreenFunction(el_window)) { + el_full_screen_button.title = "Go to full-screen mode"; tools.setOnClick(el_full_screen_button, function() { __fullScreenWindow(el_window); __activateLastWindow(el_window); |