widgets: remove colorBg for all widgets except containers; widgets background color is now transparent by default (can be overridden with css)

This commit is contained in:
bordun 2020-10-02 17:22:46 +02:00
parent ea4fb54b7b
commit 248e51b615
8 changed files with 19 additions and 3 deletions

View file

@ -71,7 +71,6 @@ class Widget extends EventEmitter {
_style: 'style',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},
colorText: {type: 'string', value: 'auto', help: 'Text color. Set to "auto" to inherit from parent widget.'},
colorWidget: {type: 'string', value: 'auto', help: 'Widget\'s default accent color. Set to "auto" to inherit from parent widget.'},
colorStroke: {type: 'string', value: 'auto', help: 'Stroke color. Set to "auto" to use `colorWidget`.'},

View file

@ -19,6 +19,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) {
_class_specific: 'matrix',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},
widgetType: {type: 'string', value: 'button', help: 'Defines the type of the widgets in the matrix'},
quantity: {type: 'number', value: 4, help: 'Defines the number of widgets in the matrix'},
start: {type: 'integer', value: 0, help: 'First widget\'s index'},

View file

@ -20,6 +20,7 @@ class Modal extends Panel {
_class_specific: 'modal',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},
label: {type: 'string|boolean', value: 'auto', help: [
'Set to `false` to hide completely',
'- Insert icons using the prefix ^ followed by the icon\'s name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)',

View file

@ -19,6 +19,7 @@ class Panel extends Container() {
_class_specific: 'panel',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
@ -241,6 +242,8 @@ class Panel extends Container() {
this.setTraversing()
return
case 'colorBg':
this.setCssVariables()
case 'colorText':
case 'colorWidget':
case 'colorFill':
@ -248,7 +251,6 @@ class Panel extends Container() {
case 'alphaStroke':
case 'alphaFillOff':
case 'alphaFillOn':
case 'colorBg':
case 'padding':
for (var w of this.children) {
if (w) w.onPropChanged(propName)
@ -286,7 +288,12 @@ class Panel extends Container() {
}
Panel.cssVariables = Panel.prototype.constructor.cssVariables.concat(
{js: 'colorBg', css: '--color-background'}
)
Panel.dynamicProps = Panel.prototype.constructor.dynamicProps.concat(
'colorBg',
'variables',
'traversing'
)

View file

@ -16,6 +16,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro
_class_specific: 'panel',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},

View file

@ -18,6 +18,7 @@ class Tab extends Panel {
_class_specific: 'panel',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},
label: {type: 'string|boolean', value: 'auto', help: [
'Set to `false` to hide completely',
'- Insert icons using the prefix ^ followed by the icon\'s name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)',

View file

@ -40,7 +40,7 @@
color: var(--color-text);
background-color: var(--color-background);
background-color: transparent;
background-clip: content-box;