From 7e3763ef3fae663c574f271382928be0329b717f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 6 Jun 2017 09:15:11 +0200 Subject: [PATCH] strip: make explicit dimension act as constraint, rely on explicit flex value for expanding widgets --- app/examples/ardour.js | 43 ++++++++++++++++------------ app/examples/swag-2000.js | 8 +++--- src/browser/js/app/parser.js | 4 +-- src/browser/scss/widgets/_panel.scss | 1 - 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/app/examples/ardour.js b/app/examples/ardour.js index 4aface60..e6721200 100644 --- a/app/examples/ardour.js +++ b/app/examples/ardour.js @@ -2231,18 +2231,17 @@ } ], "tabs": [], - "width": "100%", - "height": "100%", "left": 0, "top": 100, - "css": "width:calc(100% - 120rem); height:calc(100% - 100rem);" + "css": "width:calc(100% - 120rem); height:calc(100% - 100rem);", + "height": "auto", + "width": "auto" }, { "type": "panel", "id": "ch_master", "label": false, "width": 120, - "height": "100%", "css": "right:0; height:calc(100% - 100rem);", "widgets": [ { @@ -2533,7 +2532,8 @@ }, "layout": "", "top": 100, - "left": "auto" + "left": "auto", + "height": "auto" } ], "tabs": [] @@ -2565,7 +2565,6 @@ "id": "ch_master", "label": false, "width": 120, - "height": "100%", "css": "right:0; height:calc(100% - 100rem);", "widgets": [ { @@ -2856,7 +2855,8 @@ }, "layout": "", "top": 100, - "left": "auto" + "left": "auto", + "height": "auto" }, { "type": "panel", @@ -2864,8 +2864,6 @@ "left": 0, "id": "selected_panel", "label": false, - "width": "100%", - "height": "100%", "scroll": true, "color": "auto", "css": "width:calc(100% - 120rem); height:calc(100% - 100rem);", @@ -2879,7 +2877,6 @@ "left": 240, "id": "plugins_panel", "label": false, - "width": "100%", "scroll": true, "color": "auto", "css": "width:calc(100% - 240rem); height: calc(100% - 10rem)", @@ -2894,8 +2891,8 @@ "height": "100%", "value": "No plugin found", "id": "text_7", - "left": "auto", - "top": "auto", + "left": 0, + "top": 0, "vertical": false, "color": "auto", "css": "", @@ -2905,14 +2902,14 @@ } ], "tabs": [], - "height": "auto" + "height": "auto", + "width": "auto" }, { "type": "panel", "id": "chsel", "label": false, "width": 240, - "height": "100%", "css": "", "widgets": [ { @@ -3452,7 +3449,8 @@ "tabs": [], "popupWidth": "75%", "popupHeight": "75%", - "address": "/sends_panel" + "address": "/sends_panel", + "variables": {} }, { "type": "modal", @@ -3487,7 +3485,8 @@ "tabs": [], "popupWidth": "75%", "popupHeight": "75%", - "address": "/receives_panel" + "address": "/receives_panel", + "variables": {} } ], "tabs": [], @@ -3497,10 +3496,13 @@ "layout": "", "left": 0, "top": 0, - "variables": {} + "variables": {}, + "height": "100%" } ], - "tabs": [] + "tabs": [], + "height": "auto", + "width": "auto" }, { "type": "panel", @@ -3968,7 +3970,10 @@ "height": "auto" } ], - "horizontal": false + "horizontal": false, + "stretch": false, + "spacing": 0, + "variables": {} } ] } diff --git a/app/examples/swag-2000.js b/app/examples/swag-2000.js index fdc83cac..3b6434a3 100644 --- a/app/examples/swag-2000.js +++ b/app/examples/swag-2000.js @@ -1878,7 +1878,7 @@ "width": 96.15625, "height": "auto", "color": "auto", - "css": "--display-input:none", + "css": "--display-input:none;", "snap": false, "rangeX": { "min": 0, @@ -1919,9 +1919,9 @@ "preArgs": [], "split": false, "target": [], - "width": "100%", - "css": "", - "height": "auto" + "css": "flex:1", + "height": "auto", + "width": "auto" }, { "type": "strip", diff --git a/src/browser/js/app/parser.js b/src/browser/js/app/parser.js index 711d32ce..1553fd01 100644 --- a/src/browser/js/app/parser.js +++ b/src/browser/js/app/parser.js @@ -167,8 +167,8 @@ module.exports.widgets = function(data, parentNode, parentWidget) { } // dimensions / coordinates css - var styleW = widgetInner.getProp('width') && widgetInner.getProp('width') != 'auto' ? `width: ${geometry.width}; min-width:auto;` : '', - styleH = widgetInner.getProp('height') && widgetInner.getProp('height') != 'auto' ? `height: ${geometry.height}; min-height:auto;` : '', + var styleW = widgetInner.getProp('width') && widgetInner.getProp('width') != 'auto' ? `width: ${geometry.width}; min-width:${geometry.width};` : '', + styleH = widgetInner.getProp('height') && widgetInner.getProp('height') != 'auto' ? `height: ${geometry.height}; min-height:${geometry.height};` : '', styleL = widgetInner.getProp('left') && widgetInner.getProp('left') != 'auto'|| widgetInner.getProp('left') == 0 ?`left: ${geometry.left};` : '', styleT = widgetInner.getProp('top') && widgetInner.getProp('top') != 'auto'|| widgetInner.getProp('top') == 0 ? `top: ${geometry.top};` : '' diff --git a/src/browser/scss/widgets/_panel.scss b/src/browser/scss/widgets/_panel.scss index 21e9bd5d..567b60f8 100644 --- a/src/browser/scss/widgets/_panel.scss +++ b/src/browser/scss/widgets/_panel.scss @@ -103,7 +103,6 @@ > .widget { height: auto!important; max-height: 100%; - min-width: 0!important; margin: calc(var(--spacing) / 2 * 1rem); } left:29rem;