From eac10321ba170d685297ef50f3a2b5ada7cbc371 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 7 Mar 2018 18:24:01 +0100 Subject: [PATCH 1/3] Reduce toolbar height on mobiles --- customize.dist/src/less2/include/toolbar.less | 169 ++++++++++++++---- 1 file changed, 131 insertions(+), 38 deletions(-) diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index a0c01e377..50c51f611 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -362,53 +362,146 @@ flex: 1; } } - &:not(.cp-toolbar-notitle) { - .cp-toolbar-top { - @media screen and (max-width: @browser_media-medium-screen) { - flex-wrap: wrap; - height: auto; - .cp-toolbar-top-filler { - flex: 1; - } - .cp-toolbar-title { - flex: auto; + .cp-toolbar-top { + @media screen and (max-width: @browser_media-medium-screen) { + flex-wrap: wrap; + height: @toolbar_line-height; + .cp-pad-not-pinned { + line-height: 32px; + flex: unset; + padding: 0; + align-self: auto; + margin: 0 5px; + } + .cp-toolbar-top-filler { + height: 32px; + } + .cp-toolbar-title { + height: @toolbar_line-height; + line-height: initial; + margin: 0; + .cp-toolbar-title-hoverable { width: 100%; - order: 10; + } + .cp-toolbar-title-value-page { + padding: 5px; + line-height: unset; + border: 0; + } + .cp-toolbar-title-editable, .cp-toolbar-title-value-page { + max-width: ~"calc(100vw - 26px)"; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + font-size: @colortheme_app-font-size; height: @toolbar_line-height; - line-height: initial; - margin: 0; - .cp-toolbar-title-hoverable { - width: 100%; - } - .cp-toolbar-title-editable { - max-width: ~"calc(100vw - 26px)"; - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; + box-sizing: border-box; + line-height: 20px; + } + .cp-toolbar-title-edit, .cp-toolbar-title-save { + box-sizing: border-box; + height: @toolbar_line-height; + line-height: @colortheme_app-font-size; + display: inline-block; + + .fa { font-size: @colortheme_app-font-size; + } + } + input { + height: @toolbar_line-height; + font-size: @colortheme_app-font-size; + flex: 1; + max-width: none; + line-height: calc(@toolbar_line-height - 12px); // padding + border + } + } + .cp-toolbar-link { + height: @toolbar_line-height; + width: @toolbar_line-height; + .cp-toolbar-link-logo { + padding: 5px; + } + } + .cp-toolbar-user { + height: @toolbar_line-height; + .cp-toolbar-new { + height: @toolbar_line-height; + width: @toolbar_line-height; + margin-left: 0; + button { height: @toolbar_line-height; - box-sizing: border-box; - line-height: 20px; + width: @toolbar_line-height; + font-size: 20px; + margin-top: -1px; } - .cp-toolbar-title-edit, .cp-toolbar-title-save { - box-sizing: border-box; + } + .cp-toolbar-user-dropdown { + height: @toolbar_line-height; + width: @toolbar_line-height; + &> button { height: @toolbar_line-height; - line-height: @colortheme_app-font-size; - display: inline-block; - - .fa { - font-size: @colortheme_app-font-size; + width: @toolbar_line-height; + span { font-size: unset; } + } + &> button.cp-avatar.cp-avatar { + media-tag { + margin: 4px; + max-width: 24px; + min-width: 24px; + max-height: 24px; + min-height: 24px; } } - input { - height: @toolbar_line-height; + } + .cp-toolbar-limit { + line-height: 32px; + margin: 0; + } + } + /* + .cp-toolbar-top-filler { + flex: 1; + } + .cp-toolbar-title { + flex: auto; + width: 100%; + order: 10; + height: @toolbar_line-height; + line-height: initial; + margin: 0; + .cp-toolbar-title-hoverable { + width: 100%; + } + .cp-toolbar-title-editable { + max-width: ~"calc(100vw - 26px)"; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + font-size: @colortheme_app-font-size; + height: @toolbar_line-height; + box-sizing: border-box; + line-height: 20px; + } + .cp-toolbar-title-edit, .cp-toolbar-title-save { + box-sizing: border-box; + height: @toolbar_line-height; + line-height: @colortheme_app-font-size; + display: inline-block; + + .fa { font-size: @colortheme_app-font-size; - flex: 1; - max-width: none; - line-height: calc(@toolbar_line-height - 12px); // padding + border } } + input { + height: @toolbar_line-height; + font-size: @colortheme_app-font-size; + flex: 1; + max-width: none; + line-height: calc(@toolbar_line-height - 12px); // padding + border + } } + */ } } @@ -471,9 +564,9 @@ overflow: hidden; white-space: nowrap; - align-self: center; - padding-left: 20px; - padding-right: 5px; + line-height: @toolbar_top-height; + padding: 0; + margin: 0 5px; font-size: @colortheme_app-font-size; color: @warn-color; .cp-pnp-msg { From cbd29794b85606734c062baf127c4ddcaad69685 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 8 Mar 2018 12:16:40 +0100 Subject: [PATCH 2/3] Improve keyboard shortcuts in the pad creation screen --- www/common/common-ui-elements.js | 16 ++++++++++++++-- www/settings/inner.js | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 15e3c7b8c..5239f43f7 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1804,6 +1804,7 @@ define([ }; // Owned pads + // Default is Owned pad var owned = h('div.cp-creation-owned', [ h('h2', [ Messages.creation_ownedTitle, @@ -1829,7 +1830,7 @@ define([ ]); $creation.append(owned); - // If set to "open pad" or not set, check "open pad" + // If set to "open pad", check "open pad" if (!cfg.owned && typeof cfg.owned !== "undefined") { $creation.find('#cp-creation-owned-false').attr('checked', true); } @@ -1877,6 +1878,16 @@ define([ ]) ]); $creation.append(expire); + $creation.find('#cp-creation-expire-val').keydown(function (e) { + if (e.which === 9) { + e.stopPropagation(); + } + }); + $creation.find('#cp-creation-expire-unit').keydown(function (e) { + if (e.which === 9 && e.shiftKey) { + e.stopPropagation(); + } + }); UIElements.setExpirationValue(cfg.expire, $creation); @@ -1945,6 +1956,7 @@ define([ }); var $button = $('