This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
tomo-old/theme/scroll.go

62 lines
1.8 KiB
Go
Raw Normal View History

2023-01-20 12:40:00 -07:00
package theme
import "git.tebibyte.media/sashakoshka/tomo/artist"
2023-01-21 18:58:25 -07:00
var scrollGutterPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: strokePattern },
artist.Stroke {
Weight: 1,
Pattern: artist.Beveled {
artist.NewUniform(hex(0x3b534eFF)),
artist.NewUniform(hex(0x6e8079FF)),
2023-01-21 18:58:25 -07:00
},
},
artist.Stroke { Pattern: artist.NewUniform(hex(0x6e8079FF)) })
var disabledScrollGutterPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: weakForegroundPattern },
artist.Stroke { Pattern: backgroundPattern })
var scrollBarPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: strokePattern },
artist.Stroke {
Weight: 1,
Pattern: artist.Beveled {
artist.NewUniform(hex(0xCCD5D2FF)),
artist.NewUniform(hex(0x4B5B59FF)),
2023-01-21 18:58:25 -07:00
},
},
artist.Stroke { Pattern: artist.NewUniform(hex(0x8D9894FF)) })
var pressedScrollBarPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: strokePattern },
artist.Stroke {
Weight: 1,
Pattern: artist.Beveled {
artist.NewUniform(hex(0xCCD5D2FF)),
artist.NewUniform(hex(0x4B5B59FF)),
2023-01-21 18:58:25 -07:00
},
},
artist.Stroke { Weight: 1, Pattern: artist.NewUniform(hex(0x8D9894FF)) },
artist.Stroke { Pattern: artist.NewUniform(hex(0x7f8c89FF)) })
var disabledScrollBarPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: weakForegroundPattern },
artist.Stroke { Pattern: backgroundPattern })
func ScrollGutterPattern (horizontal, enabled bool) (artist.Pattern) {
2023-01-20 12:40:00 -07:00
if enabled {
2023-01-21 18:58:25 -07:00
return scrollGutterPattern
2023-01-20 12:40:00 -07:00
} else {
2023-01-21 18:58:25 -07:00
return disabledScrollGutterPattern
2023-01-20 12:40:00 -07:00
}
}
2023-01-21 18:58:25 -07:00
func ScrollBarPattern (horizontal, enabled, pressed bool) (artist.Pattern) {
2023-01-20 12:40:00 -07:00
if enabled {
2023-01-21 18:58:25 -07:00
if pressed {
return pressedScrollBarPattern
} else {
return scrollBarPattern
}
2023-01-20 12:40:00 -07:00
} else {
2023-01-21 18:58:25 -07:00
return disabledScrollBarPattern
2023-01-20 12:40:00 -07:00
}
}