forked from joejulian/gio
app: add support for system cursors
Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
@@ -79,9 +79,29 @@ type Source uint8
|
||||
// Buttons is a set of mouse buttons
|
||||
type Buttons uint8
|
||||
|
||||
// CursorName is the name of a cursor.
|
||||
type CursorName string
|
||||
|
||||
// Must match app/internal/input.areaKind
|
||||
type areaKind uint8
|
||||
|
||||
const (
|
||||
// CursorDefault is the default cursor.
|
||||
CursorDefault CursorName = ""
|
||||
// CursorText is the cursor for text.
|
||||
CursorText CursorName = "text"
|
||||
// CursorPointer is the cursor for a link.
|
||||
CursorPointer CursorName = "pointer"
|
||||
// CursorCrossHair is the cursor for precise location.
|
||||
CursorCrossHair CursorName = "crosshair"
|
||||
// CursorColResize is the cursor for vertical resize.
|
||||
CursorColResize CursorName = "col-resize"
|
||||
// CursorRowResize is the cursor for horizontal resize.
|
||||
CursorRowResize CursorName = "row-resize"
|
||||
// CursorNone hides the cursor. To show it again, use any other cursor.
|
||||
CursorNone CursorName = "none"
|
||||
)
|
||||
|
||||
const (
|
||||
// A Cancel event is generated when the current gesture is
|
||||
// interrupted by other handlers or the system.
|
||||
@@ -242,4 +262,11 @@ func (b Buttons) String() string {
|
||||
return strings.Join(strs, "|")
|
||||
}
|
||||
|
||||
func (c CursorName) String() string {
|
||||
if c == CursorDefault {
|
||||
return "default"
|
||||
}
|
||||
return string(c)
|
||||
}
|
||||
|
||||
func (Event) ImplementsEvent() {}
|
||||
|
||||
Reference in New Issue
Block a user