|
|
|
@ -39,7 +39,7 @@ export class Switch extends BasicButton {
|
|
|
|
|
width: 12, |
|
|
|
|
height: 12, |
|
|
|
|
top: tgap, |
|
|
|
|
left: o.selected ? 28 : 4, |
|
|
|
|
left: o.selected ? o.width - 16 : 4, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label.xtype, |
|
|
|
@ -78,7 +78,7 @@ export class Switch extends BasicButton {
|
|
|
|
|
|
|
|
|
|
setSelected(v) { |
|
|
|
|
super.setSelected(...arguments); |
|
|
|
|
this.layout.attr("items")[0].left = v ? 28 : 4; |
|
|
|
|
this.layout.attr("items")[0].left = v ? this.options.width - 16 : 4; |
|
|
|
|
this.layout.resize(); |
|
|
|
|
this.options.showTip && this.openTip.setVisible(v); |
|
|
|
|
this.options.showTip && this.closeTip.setVisible(!v); |
|
|
|
|