diff --git a/addons/web/static/src/less/navbar.less b/addons/web/static/src/less/navbar.less index 8d68773ecff..d000ed4f469 100644 --- a/addons/web/static/src/less/navbar.less +++ b/addons/web/static/src/less/navbar.less @@ -2,17 +2,17 @@ .o_main_navbar { position: relative; height: @odoo-navbar-height; - border: 1px solid @odoo-navbar-inverse-link-hover-bg; + border-bottom: 1px solid @odoo-navbar-inverse-link-hover-bg; background-color: @odoo-brand-primary; color: white; > a, > button { float: left; - width: @odoo-navbar-height - 2; - height: @odoo-navbar-height - 2; + width: @odoo-navbar-height; + height: @odoo-navbar-height; border: none; padding: 0; - line-height: @odoo-navbar-height - 2; + line-height: @odoo-navbar-height; background-color: transparent; text-align: center; color: inherit; @@ -37,7 +37,7 @@ color: white; font-size: 22px; font-weight: 500; - line-height: @odoo-navbar-height - 2; + line-height: @odoo-navbar-height; @media (max-width: @screen-xs-max) { float: none; @@ -65,10 +65,10 @@ > a { display: block; - height: @odoo-navbar-height - 2; + height: @odoo-navbar-height; padding: 0 10px; color: white; - line-height: @odoo-navbar-height - 2; + line-height: @odoo-navbar-height; &:hover { background-color: @odoo-navbar-inverse-link-hover-bg; @@ -81,7 +81,7 @@ &.o_extra_menu_items { > a { - width: @odoo-navbar-height - 2; + width: @odoo-navbar-height; text-align: center; } &.open > ul { @@ -176,8 +176,8 @@ } &.o_menu_systray { - .o-position-absolute(0px, @odoo-navbar-height - 2, auto, @odoo-navbar-height - 2); - height: @odoo-navbar-height - 2; + .o-position-absolute(0px, @odoo-navbar-height, auto, @odoo-navbar-height); + height: @odoo-navbar-height; text-align: right; > li { diff --git a/addons/web_editor/static/src/js/snippets.options.js b/addons/web_editor/static/src/js/snippets.options.js index c3c97505305..68301312cd5 100644 --- a/addons/web_editor/static/src/js/snippets.options.js +++ b/addons/web_editor/static/src/js/snippets.options.js @@ -329,6 +329,8 @@ odoo.define('web_editor.snippets.options', function (require) { if (change) { self.on_resize(compass, beginClass, current); self.buildingBlock.cover_target(self.$overlay, self.$target); + self.adapt_margin_preview_size(); + $handle.addClass('oe_handle_change'); } }; @@ -343,10 +345,13 @@ odoo.define('web_editor.snippets.options', function (require) { } },0); self.$target.removeClass("resize_editor_busy"); + $handle.removeClass('oe_handle_change'); if (compass === "size") { $fixed_size.addClass("active"); $auto_size.removeClass("active"); + } else { + self._highlight_margins_preview(300); } }; $body.mousemove(body_mousemove); @@ -372,10 +377,14 @@ odoo.define('web_editor.snippets.options', function (require) { on_focus : function () { this._super(); this.change_cursor(); + this.adapt_margin_preview_size(); }, change_cursor : function () { var _class = this.$target.attr("class") || ""; + var $handle_s = this.$overlay.find('.oe_handle.s'); + var $handle_n = this.$overlay.find('.oe_handle.n'); + var $handle_w = this.$overlay.find('.oe_handle.w'); var col = _class.match(/col-md-([0-9-]+)/i); col = col ? +col[1] : 0; @@ -387,20 +396,44 @@ odoo.define('web_editor.snippets.options', function (require) { if (col+offset >= 12) overlay_class+= " block-e-right"; if (col === 1) overlay_class+= " block-w-right block-e-left"; if (offset === 0) overlay_class+= " block-w-left"; + $handle_w.toggleClass('oe_handle_centered', offset > 0).toggleClass('o_handle_edited', offset >= 1 ); var mb = _class.match(/mb([0-9-]+)/i); mb = mb ? +mb[1] : parseInt(this.$target.css('margin-bottom')); if (mb >= 128) overlay_class+= " block-s-bottom"; else if (!mb) overlay_class+= " block-s-top"; + $handle_s.toggleClass('oe_handle_centered', mb >= 32).toggleClass('o_handle_edited', mb > 0 ); var mt = _class.match(/mt([0-9-]+)/i); mt = mt ? +mt[1] : parseInt(this.$target.css('margin-top')); if (mt >= 128) overlay_class+= " block-n-top"; else if (!mt) overlay_class+= " block-n-bottom"; + $handle_n.toggleClass('oe_handle_centered', mt >= 32).toggleClass('o_handle_edited', mt > 0 ); this.$overlay.attr("class", overlay_class); }, + adapt_margin_preview_size : function () { + var self = this, + ml = this.$target.css('margin-left'); + _.each(this.$overlay.find(".oe_handle.n, .oe_handle.s"), function (handle) { + var $handle = $(handle); + var direction = $handle.hasClass('n') ? 'top': 'bottom'; + $handle.height(self.$target.css('margin-' + direction )); + }); + this.$overlay.find(".oe_handle.w").css({ + width: ml, + left: '-' + ml + }); + }, + + _highlight_margins_preview: function (timing) { + var handlers = this.$overlay.find(".oe_handle.n, .oe_handle.s, .oe_handle.w"); + handlers.addClass('oe_handle_active').delay(timing).queue(function(){ + handlers.removeClass('oe_handle_active').dequeue(); + }); + }, + /* on_resize * called when the box is resizing and the class change, before the cover_target * @compass: resize direction : 'n', 's', 'e', 'w' diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 7e0a3ad103a..240a61b0458 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -471,8 +471,8 @@ var ImageDialog = Widget.extend({ this.$('.existing-attachments').replaceWith(QWeb.render('web_editor.dialog.image.existing.content', {rows: rows})); this.parent.$('.pager') - .find('li.previous').toggleClass('disabled', (from === 0)).end() - .find('li.next').toggleClass('disabled', (from + per_screen >= records.length)); + .find('li.previous a').toggleClass('disabled', (from === 0)).end() + .find('li.next a').toggleClass('disabled', (from + per_screen >= records.length)); this.$el.find('.o_image').each(function () { var $div = $(this); diff --git a/addons/web_editor/static/src/less/web_editor.ui.components.less b/addons/web_editor/static/src/less/web_editor.ui.components.less index 826f7b0618d..ac93545c87b 100644 --- a/addons/web_editor/static/src/less/web_editor.ui.components.less +++ b/addons/web_editor/static/src/less/web_editor.ui.components.less @@ -1,49 +1,56 @@ // INPUTS +@o-switch-size: 2ex; +@o-switch-inactive-color: @gray-lighter; + .o_switch { .o-flex-display(); .o-align-items(center); font-weight: normal; - height: 1.5em; cursor: pointer; > input { display: none; + span { - background: #bababa; - border-radius: 0.4em; - height: 1em; - width: 2.5em; + background-color: @o-switch-inactive-color; + box-shadow: inset 0 0 0px 1px darken(@o-switch-inactive-color,10%); + border-radius: 100rem; + height: @o-switch-size; + width: @o-switch-size * 1.8; margin-right: 0.5em; display: inline-block; .transition(all 0.3s @o-we-md-ease); + &:after { content: ""; - background: #fafafa; + background: @o-we-color-paper; display: block; - width: 1.5em; - height: 1.5em; - border-radius: 100em; - margin-top: -0.3em; - margin-left: -0.1em; + width: @o-switch-size - 0.2; + height: @o-switch-size - 0.2; + margin-top: 0.1ex; + margin-left: 0.3ex; + border-radius: 100rem; .transition(all 0.3s @o-we-md-ease); - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); + box-shadow: 0 1px 1px darken(@o-switch-inactive-color,35%), inset 0 0 0 1px lighten(@o-switch-inactive-color,10%); } } &:checked + span { - background-color: rgb(142, 224, 212); - background-color: transparentize(@odoo-brand-optional, 0.5); + box-shadow: none; + .o-linear-gradient(0deg, @o-we-color-success, darken(@o-we-color-success, 10%)); + &:after { - background-color: @odoo-brand-optional; - margin-left: 1.1em; + margin-left: (@o-switch-size*1.8 - @o-switch-size) + 0.1; } } } - &:hover > input + span:after { - background-color: mix(@odoo-brand-optional, #fafafa); - } } + +.dropdown-menu label .o_switch { + margin: 0; + padding: 2px 0; +} + .text-input-group { position: relative; margin-bottom: 45px; @@ -208,16 +215,15 @@ body .modal { width: 80%; .modal-body { + .nav-tabs .active > a[href="#editor-media-icon"] { + background-color: white; + } + li.search { float: right; - ul.pager { - margin: 0; - > li > a { - border-radius: 0px; - margin-left: 2px; - padding: 6px 14px; - } + ul.pager li:last-child{ + margin-left: 2px; } .form-group { position: relative; @@ -233,6 +239,7 @@ body .modal { } .well { + border-color: @gray-lighter; border-top-width: 0; label { diff --git a/addons/web_editor/static/src/less/web_editor.ui.less b/addons/web_editor/static/src/less/web_editor.ui.less index 3ba3621db9f..1e44204c906 100644 --- a/addons/web_editor/static/src/less/web_editor.ui.less +++ b/addons/web_editor/static/src/less/web_editor.ui.less @@ -299,7 +299,7 @@ html[lang] > body.editor_enable [data-oe-translation-state] { // MANIPULATORS #oe_manipulators { - @odoo-handle-edge-size: 8px; + @odoo-handle-edge-size: 1px; @odoo-handle-border-width: 1px; // SNIPPET MANIPULATORS @@ -534,34 +534,78 @@ html[lang] > body.editor_enable [data-oe-translation-state] { // HANDLES > .oe_handles { @o-handles-offset-to-hide: 10000px; + @o-handless-accent-color: #00e2ff; .o-position-absolute(-@o-handles-offset-to-hide, 0, auto, 0); - > .oe_handle { - @o-handle-size: 18px; + &:hover > .oe_handle { + background-color: fade(@o-handless-accent-color, 5%); + } + > .oe_handle { + @o-handle-btn-size: 18px; opacity: 0.5; .o-transition(opacity, 400ms); - &:hover { - opacity: 0.9; + border: 0 solid @o-handless-accent-color; + + // MARGINS PREVIEW + &.n, &.s, &.w { + position: relative; + .o-transition(background, 0.3s); + + &.oe_handle_change, &.oe_handle_active, &:hover { + background-color: fade(@o-handless-accent-color, 20%); + } + + &.o_handle_edited { + opacity: 0.9; + + &:after { + color: white; + border-color: darken(@o-handless-accent-color, 10%); + background-color: darken(@o-handless-accent-color, 20%); + } + } + + &.oe_handle_change, &:hover { + opacity: 1; + + &:before { + .o-position-absolute(0, @left:50%); + width: 1px; + height: 100%; + margin-left: -1px; + background-color: fade(@o-handless-accent-color, 50%); + content:''; + } + + &.w:before { + .o-position-absolute(50%,@left: 0); + width: 100%; + height: 1px; + } + + &:after { + border-color: darken(@o-handless-accent-color, 10%); + background-color: darken(@o-handless-accent-color, 20%); + } + } } - border: 0 dashed black; &:after { display: block; - width: @o-handle-size; - height: @o-handle-size; + width: @o-handle-btn-size; + height: @o-handle-btn-size; border: solid 1px rgba(0, 0, 0, 0.2); - line-height: @o-handle-size - 2; + line-height: @o-handle-btn-size - 2; font-size: 14px; font-family: FontAwesome; background-color: @o-we-color-light; color: @o-we-color-text-light; } - &:hover:after { - background-color: @o-we-color-dark; - color: white; - box-shadow: 0 0 5px 3px rgba(255,255,255,0.7); + &:hover { + opacity: 0.9; } + &.w:after, &.e:after { content: "\f07e"; } @@ -570,14 +614,18 @@ html[lang] > body.editor_enable [data-oe-translation-state] { } &.w { - border-left-width: @odoo-handle-border-width; + border-width: @odoo-handle-border-width; + border-right-width: 0; cursor: e-resize; width: @odoo-handle-edge-size; .o-position-absolute(@o-handles-offset-to-hide, auto, -@o-handles-offset-to-hide, 0); &:after { - .o-position-absolute(@top: 50%, @left: -@odoo-handle-border-width); - margin-top: -@o-handle-size/2; + .o-position-absolute(@top: 50%, @left: 50%); + margin-top: -@o-handle-btn-size/2; + } + &.oe_handle_centered:after { + margin-left: -@o-handle-btn-size/2; } } &.e { @@ -588,29 +636,33 @@ html[lang] > body.editor_enable [data-oe-translation-state] { &:after { .o-position-absolute(@top: 50%, @right: -@odoo-handle-border-width); - margin-top: -@o-handle-size/2; + margin-top: -@o-handle-btn-size/2; } } &.n { border-top-width: @odoo-handle-border-width; - cursor: s-resize; - height: @odoo-handle-edge-size; .o-position-absolute(@o-handles-offset-to-hide, 0, auto, 0); &:after { - .o-position-absolute(@left: 50%, @top: -@odoo-handle-border-width); - margin-left: -@o-handle-size/2; + .o-position-absolute(@left: 50%, @top: 50%); + margin-left: -@o-handle-btn-size/2; } } &.s { border-bottom-width: @odoo-handle-border-width; - cursor: n-resize; - height: @odoo-handle-edge-size; .o-position-absolute(auto, 0, -@o-handles-offset-to-hide, 0); &:after { - .o-position-absolute(@left: 50%, @bottom: -@odoo-handle-border-width); - margin-left: -@o-handle-size/2; + .o-position-absolute(@left: 50%, @bottom: 50%); + margin-left: -@o-handle-btn-size/2; + } + } + &.n, &.s { + cursor: ns-resize; + + &.oe_handle_centered:after { + .o-position-absolute(@left: 50%, @top: 50%); + margin-top: -@o-handle-btn-size/2; } } @@ -689,17 +741,17 @@ html[lang] > body.editor_enable [data-oe-translation-state] { &.block-e-left.block-e-right .e:after { display: none !important; } - &.block-s-top .s:after { - content: "" !important; + &.block-s-bottom .s, &.block-n-top .n { + cursor: n-resize!important; + &:after { + content: "\f062" !important; + } } - &.block-s-bottom .s:after { - content: "" !important; - } - &.block-n-top .n:after { - content: "" !important; - } - &.block-n-bottom .n:after { - content: "" !important; + &.block-s-top .s, &.block-n-bottom .n { + cursor: s-resize!important; + &:after { + content: "\f063" !important; + } } } } diff --git a/addons/web_editor/static/src/less/web_editor.variables.less b/addons/web_editor/static/src/less/web_editor.variables.less index 327befe5438..188d62b955d 100644 --- a/addons/web_editor/static/src/less/web_editor.variables.less +++ b/addons/web_editor/static/src/less/web_editor.variables.less @@ -9,7 +9,7 @@ @o-we-color-divider: #33363e; @o-we-color-light: #4e525b; @o-we-color-normal: #50545d; -@o-we-color-paper: #fbfbfd; +@o-we-color-paper: #fcfcfc; @o-we-color-text-normal: #999999; @o-we-color-text-light: #d4d5d7; @o-we-color-danger: #e6586c; @@ -115,6 +115,12 @@ outline: none!important; } } + + .label { + &:hover a, a { + color: #fff; + } + } } .o-w-preserve-forms() { @@ -128,6 +134,13 @@ background-color: #fff; border-radius: 0; } + + select.form-control { + .o-appearance(none); + background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1 sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIHdpZHRoPScyNCcgaGVpZ2 h0PScyNCcgdmlld0JveD0nMCAwIDI0IDI0Jz48cGF0aCBpZD0nc3ZnXzEnIGQ9J203LjQwNiw3L jgyOGw0LjU5NCw0LjU5NGw0LjU5NCwtNC41OTRsMC40MDYsMS40MDZsLTUsNC43NjZsLTUsLTQu NzY2bDAuNDA2LC0xLjQwNnonIGZpbGw9JyM4ODgnLz48L3N2Zz4='); + background-position: 100% 65%; + background-repeat: no-repeat; + } } .o-w-preserve-modals() { @@ -146,6 +159,31 @@ } } +.o-w-preserve-tabs() { + .nav-tabs { + border-bottom: 1px solid @gray-lighter; + + > li { + > a { + line-height: 1.42857143; + color: @o-we-color-light; + &:hover { + border-color: @gray-lighter; + } + } + + &.active > a { + &, &:hover, &:focus { + color: @o-we-color-normal; + background-color: @o-we-color-paper; + border-color: @gray-lighter; + border-bottom-color: transparent; + } + } + } + } +} + .o-w-preserve-btn() { .btn:not(.o_btn_preview) { border-width: 1px; @@ -155,11 +193,9 @@ &.btn-primary { .button-variant(white, @odoo-brand-optional, darken(@odoo-brand-optional,5%)); - text-transform: uppercase; } &.btn-default { - .button-variant(@odoo-brand-optional, white, @o-we-color-text-light); - text-transform: uppercase; + .button-variant(@o-we-color-normal, white, @o-we-color-text-light); } &.btn-link { .button-variant(@odoo-brand-optional, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)); diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml index e8fdacc42d3..39bb389f1de 100644 --- a/addons/web_editor/static/src/xml/editor.xml +++ b/addons/web_editor/static/src/xml/editor.xml @@ -53,11 +53,11 @@
|
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Suggested Most searched topics related to your keywords, ordered by importance: |
+
| + | + Legend: + Not used + In title + In description + In page's content + |
+
- Warning! Don't forget to update all links referring to this page: -
+