Compare commits

..

No commits in common. "155752ba78705f0502c69d90d5f6fb861a576593" and "611705fa0d179ce6b92a8da7eb77e871b7cce0dd" have entirely different histories.

View File

@ -24,8 +24,6 @@ func NewLabelSwatch (value color.Color, text string) *LabelSwatch {
box.SetRole(tomo.R("objects", "LabelSwatch")) box.SetRole(tomo.R("objects", "LabelSwatch"))
box.swatch.label = text box.swatch.label = text
box.label.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle)) box.label.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle))
box.label.SetSelectable(false)
box.label.SetFocusable(false)
box.Add(box.swatch) box.Add(box.swatch)
box.Add(box.label) box.Add(box.label)
box.SetAttr(tomo.ALayout(layouts.Row { false, true })) box.SetAttr(tomo.ALayout(layouts.Row { false, true }))
@ -63,12 +61,12 @@ func (this *LabelSwatch) OnConfirm (callback func ()) event.Cookie {
} }
func (this *LabelSwatch) handleButtonDown (button input.Button) bool { func (this *LabelSwatch) handleButtonDown (button input.Button) bool {
if !isClickingButton(button) { return true } if button != input.ButtonLeft { return true }
return true return true
} }
func (this *LabelSwatch) handleButtonUp (button input.Button) bool { func (this *LabelSwatch) handleButtonUp (button input.Button) bool {
if !isClickingButton(button) { return true } if button != input.ButtonLeft { return true }
if this.Window().MousePosition().In(this.Bounds()) { if this.Window().MousePosition().In(this.Bounds()) {
this.swatch.SetFocused(true) this.swatch.SetFocused(true)
this.swatch.Choose() this.swatch.Choose()