Add incomplete support for new api

This commit is contained in:
Sasha Koshka 2023-08-21 00:14:26 -04:00
parent 449d7c6440
commit 0d7536b575
2 changed files with 26 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import "git.tebibyte.media/tomo/aluminum"
import "git.tebibyte.media/tomo/tomo/theme"
func init () {
theme.SetTheme(aluminum.Theme { })
theme.SetTheme(new(aluminum.Theme))
}
func Name () string {

View File

@ -4,6 +4,7 @@ import "image"
import "image/color"
import "git.tebibyte.media/tomo/tomo"
import "golang.org/x/image/font/basicfont"
import "git.tebibyte.media/tomo/tomo/data"
import "git.tebibyte.media/tomo/tomo/theme"
import "git.tebibyte.media/tomo/tomo/input"
import "git.tebibyte.media/tomo/tomo/event"
@ -46,7 +47,7 @@ var gutterColorHovered = hex(0xc5cbd6FF)
type Theme struct { }
func (Theme) RGBA (id theme.Color) (r, g, b, a uint32) {
func (this *Theme) RGBA (id theme.Color) (r, g, b, a uint32) {
switch id {
case theme.ColorBackground: return backgroundColor .RGBA()
case theme.ColorForeground: return textColor .RGBA()
@ -57,7 +58,7 @@ func (Theme) RGBA (id theme.Color) (r, g, b, a uint32) {
}
}
func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
func (this *Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
box := object.GetBox()
box.SetColor(backgroundColor)
@ -216,3 +217,25 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
}
return event.MultiCookie()
}
func (this *Theme) Icon (theme.Icon, theme.IconSize) tomo.Texture {
this.ensure()
// TODO
return nil
}
func (this *Theme) MimeIcon (data.Mime, theme.IconSize) tomo.Texture {
this.ensure()
// TODO
return nil
}
func (this *Theme) ApplicationIcon (theme.ApplicationIcon, theme.IconSize) tomo.Texture {
this.ensure()
// TODO
return nil
}
func (this *Theme) ensure () {
// TODO
}