Using normal cursor when control is disabled.

This commit is contained in:
Sander Schobers 2020-05-18 20:28:13 +02:00
parent ea5e1a4989
commit e7ada7fea0
4 changed files with 1 additions and 5 deletions

View File

@ -89,7 +89,6 @@ func (b *Button) Handle(ctx Context, e Event) bool {
result := b.ControlBase.HandleNotify(ctx, e, b) result := b.ControlBase.HandleNotify(ctx, e, b)
if b.over { if b.over {
if b.Disabled { if b.Disabled {
ctx.Renderer().SetMouseCursor(MouseCursorNotAllowed)
return true return true
} }
ctx.Renderer().SetMouseCursor(MouseCursorPointer) ctx.Renderer().SetMouseCursor(MouseCursorPointer)
@ -165,7 +164,7 @@ func (b *Button) textColor(p *Palette) color.Color {
case ButtonTypeContained: case ButtonTypeContained:
return p.TextOnDisabled return p.TextOnDisabled
} }
return p.Disabled return b.disabledColor(p)
} }
if b.Font.Color != nil { if b.Font.Color != nil {
return b.Font.Color return b.Font.Color

View File

@ -81,7 +81,6 @@ func (c *Checkbox) Handle(ctx Context, e Event) bool {
result := c.ControlBase.Handle(ctx, e) result := c.ControlBase.Handle(ctx, e)
if c.over { if c.over {
if c.Disabled { if c.Disabled {
ctx.Renderer().SetMouseCursor(MouseCursorNotAllowed)
return true return true
} }
ctx.Renderer().SetMouseCursor(MouseCursorPointer) ctx.Renderer().SetMouseCursor(MouseCursorPointer)

View File

@ -166,7 +166,6 @@ func (h *sliderHandle) Handle(ctx Context, e Event) bool {
h.ControlBase.Handle(ctx, e) h.ControlBase.Handle(ctx, e)
if h.IsOver() { if h.IsOver() {
if h.Disabled { if h.Disabled {
ctx.Renderer().SetMouseCursor(MouseCursorNotAllowed)
return true return true
} }
ctx.Renderer().SetMouseCursor(MouseCursorPointer) ctx.Renderer().SetMouseCursor(MouseCursorPointer)

View File

@ -133,7 +133,6 @@ func (b *TextBox) Handle(ctx Context, e Event) bool {
if b.over { if b.over {
if b.Disabled { if b.Disabled {
ctx.Renderer().SetMouseCursor(MouseCursorNotAllowed)
return true return true
} }
ctx.Renderer().SetMouseCursor(MouseCursorText) ctx.Renderer().SetMouseCursor(MouseCursorText)