Fixed theming bug in button and button group.

This commit is contained in:
2019-08-08 13:46:02 +02:00
parent cdc6461064
commit 97d33cf177
72 changed files with 255 additions and 844 deletions
+14 -7
View File
@@ -113,8 +113,8 @@ export default class ButtonGroup extends PIXI.Container {
strokeActive: theme.strokeActive,
strokeActiveWidth: theme.strokeActiveWidth,
strokeActiveAlpha: theme.strokeActiveAlpha,
textStyle: theme.textStyle,
textStyleActive: theme.textStyleActive,
textStyle: {},
textStyleActive: {},
style: 'default',
radius: theme.radius,
disabled: null,
@@ -127,6 +127,9 @@ export default class ButtonGroup extends PIXI.Container {
opts
)
this.opts.textStyle = Object.assign({}, theme.textStyle, this.opts.textStyle)
this.opts.textStyleActive = Object.assign({}, theme.textStyleActive, this.opts.textStyleActive)
this.buttons = []
this._disabled = null
@@ -440,8 +443,10 @@ export default class ButtonGroup extends PIXI.Container {
* @param {*} event
*/
onStart(event) {
if ((this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) || (this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)) {
if (
(this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) ||
(this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)
) {
this.__dragging = true
this.capture(event)
@@ -509,7 +514,7 @@ export default class ButtonGroup extends PIXI.Container {
// stack!
const distanceToTop = this.container.y
const distanceToBottom = this.opts.maxHeight - this.container.y - this.__initHeight
if (distanceToTop > 0) {
throwProps.y.end = 0
} else if (distanceToBottom > 0) {
@@ -549,8 +554,10 @@ export default class ButtonGroup extends PIXI.Container {
* @param {*} event
*/
onScroll(event) {
if ((this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) || (this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)) {
if (
(this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) ||
(this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)
) {
this.capture(event)
if (this.opts.orientation === 'horizontal') {