Compare commits
No commits in common. "ddde2a79a828d45b341e0caa56a489b55bfa3101" and "a92951f8914226bacb0ac32d5a0e7f816b33df7f" have entirely different histories.
ddde2a79a8
...
a92951f891
@ -336,6 +336,13 @@ func (this *box) handleMouseDown (button input.Button) (caught bool) {
|
|||||||
this.invalidateStyle()
|
this.invalidateStyle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if this.focusable {
|
||||||
|
this.SetFocused(true)
|
||||||
|
} else {
|
||||||
|
hierarchy := this.getHierarchy()
|
||||||
|
if hierarchy == nil { return }
|
||||||
|
hierarchy.focus(nil)
|
||||||
|
}
|
||||||
for _, listener := range this.on.buttonDown.Listeners() {
|
for _, listener := range this.on.buttonDown.Listeners() {
|
||||||
if listener(button) { caught = true }
|
if listener(button) { caught = true }
|
||||||
}
|
}
|
||||||
|
@ -62,16 +62,7 @@ func (this *Hierarchy) HandleKeyUp (key input.Key, numberPad bool) {
|
|||||||
// information, HandleMouseMove must be called *before* HandleMouseDown.
|
// information, HandleMouseMove must be called *before* HandleMouseDown.
|
||||||
func (this *Hierarchy) HandleMouseDown (button input.Button) {
|
func (this *Hierarchy) HandleMouseDown (button input.Button) {
|
||||||
boxes := []anyBox { }
|
boxes := []anyBox { }
|
||||||
first := true
|
|
||||||
this.boxesUnder(this.mousePosition)(func (box anyBox) bool {
|
this.boxesUnder(this.mousePosition)(func (box anyBox) bool {
|
||||||
if first {
|
|
||||||
if box.canBeFocused() {
|
|
||||||
this.focus(box)
|
|
||||||
} else {
|
|
||||||
this.focus(nil)
|
|
||||||
}
|
|
||||||
first = false
|
|
||||||
}
|
|
||||||
boxes = append(boxes, box)
|
boxes = append(boxes, box)
|
||||||
return !box.handleMouseDown(button)
|
return !box.handleMouseDown(button)
|
||||||
})
|
})
|
||||||
|
@ -186,10 +186,12 @@ func (this *textBox) drawDot (can canvas.Canvas) {
|
|||||||
face := this.attrFace.Value().Face
|
face := this.attrFace.Value().Face
|
||||||
textColor := this.attrTextColor.Value().Color
|
textColor := this.attrTextColor.Value().Color
|
||||||
dotColor := this.attrDotColor.Value().Color
|
dotColor := this.attrDotColor.Value().Color
|
||||||
if textColor == nil { textColor = color.Black }
|
if textColor == nil { textColor = color.Transparent }
|
||||||
if dotColor == nil { dotColor = color.RGBA { G: 255, B: 255, A: 255 } }
|
if dotColor == nil { dotColor = color.RGBA { G: 255, B: 255, A: 255 } }
|
||||||
|
|
||||||
pen := can.Pen()
|
pen := can.Pen()
|
||||||
|
pen.Fill(color.Transparent)
|
||||||
|
pen.Stroke(textColor)
|
||||||
|
|
||||||
bounds := this.InnerBounds()
|
bounds := this.InnerBounds()
|
||||||
metrics := face.Metrics()
|
metrics := face.Metrics()
|
||||||
@ -202,7 +204,6 @@ func (this *textBox) drawDot (can canvas.Canvas) {
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case dot.Empty():
|
case dot.Empty():
|
||||||
pen.Stroke(textColor)
|
|
||||||
pen.StrokeWeight(1)
|
pen.StrokeWeight(1)
|
||||||
pen.Path(roundPt(start.Add(ascent)), roundPt(start.Sub(descent)))
|
pen.Path(roundPt(start.Add(ascent)), roundPt(start.Sub(descent)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user