refactor: improve enum definitions

This commit is contained in:
Piotr Grabowski 2022-07-10 14:57:11 +02:00
parent f2989afd92
commit 5557af8306
3 changed files with 7 additions and 7 deletions

View file

@ -33,14 +33,14 @@ type CursorsState struct {
ForceVisible bool ForceVisible bool
} }
type Cursor int
const ( const (
cursorNone = iota cursorNone Cursor = iota
cursorDefault cursorDefault
cursorGrabbing cursorGrabbing
) )
type Cursor int
type CursorCache = map[Cursor]*gdk.Cursor type CursorCache = map[Cursor]*gdk.Cursor
func (cursor *CursorsState) init() { func (cursor *CursorsState) init() {

View file

@ -39,13 +39,13 @@ type JumpmarksCycle struct {
dontClear bool dontClear bool
} }
type JumpmarkCycleDirection int
const ( const (
cycleDirectionBackward = iota cycleDirectionBackward JumpmarkCycleDirection = iota
cycleDirectionForward cycleDirectionForward
) )
type JumpmarkCycleDirection int
func (jumpmarks Jumpmarks) has(page int) bool { func (jumpmarks Jumpmarks) has(page int) bool {
for _, mark := range jumpmarks.list { for _, mark := range jumpmarks.list {
// ASSUMPTION: The slice is sorted // ASSUMPTION: The slice is sorted

View file

@ -31,7 +31,7 @@ var (
type NotificationLength = int type NotificationLength = int
const ( const (
ShortNotification = iota ShortNotification NotificationLength = iota
LongNotification LongNotification
) )