text: add vertical alignment choices to align
This commit is contained in:
parent
cbcbfab3d1
commit
39a156c898
4 changed files with 14 additions and 5 deletions
|
|
@ -17,7 +17,7 @@ module.exports = class Image extends StaticProperties(Widget, {bypass: true}) {
|
|||
style: {
|
||||
_separator_image_style: 'Image style',
|
||||
size: {type: 'string', value: 'cover', choices: ['cover', 'contain', 'auto'], help: 'CSS background-size'},
|
||||
position: {type: 'string', value: 'center', choices: ['center', 'center top', 'center bottom', 'left center', 'left top', 'left bottom', 'right center', 'right top', 'right bottom'], help: 'CSS background-position'},
|
||||
position: {type: 'string', value: 'center', choices: ['center', 'left', 'right', 'top', 'bottom', 'left top', 'left bottom', 'right top', 'right bottom'], help: 'CSS background-position'},
|
||||
repeat: {type: 'string', value: 'no-repeat', choices: ['no-repeat', 'repeat', 'repeat-x', 'repeat-y', 'space', 'round'], help: 'CSS background-repeat'},
|
||||
},
|
||||
class_specific: {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ module.exports = class Text extends StaticProperties(Widget, {bypass: true, inte
|
|||
wrap: {type: 'boolean', value: false, help: [
|
||||
'Set to `true` to wrap long lines automatically.',
|
||||
]},
|
||||
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Css text-align property.'},
|
||||
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right', 'top', 'bottom', 'left top', 'left bottom', 'right top', 'right bottom'], help: 'Text alignment.'},
|
||||
},
|
||||
osc: {
|
||||
typeTags: null,
|
||||
|
|
@ -41,8 +41,10 @@ module.exports = class Text extends StaticProperties(Widget, {bypass: true, inte
|
|||
this.text = this.widget.appendChild(html`<label></label>`)
|
||||
|
||||
if (this.getProp('vertical')) this.text.classList.add('vertical')
|
||||
if (this.getProp('align') === 'left') this.text.classList.add('left')
|
||||
if (this.getProp('align') === 'right') this.text.classList.add('right')
|
||||
if (this.getProp('align').includes('left')) this.text.classList.add('left')
|
||||
if (this.getProp('align').includes('right')) this.text.classList.add('right')
|
||||
if (this.getProp('align').includes('top')) this.text.classList.add('top')
|
||||
if (this.getProp('align').includes('bottom')) this.text.classList.add('bottom')
|
||||
if (this.getProp('wrap')) this.text.classList.add('wrap')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue