Add incomplete support for new api
This commit is contained in:
		
							parent
							
								
									449d7c6440
								
							
						
					
					
						commit
						0d7536b575
					
				@ -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 {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										27
									
								
								theme.go
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								theme.go
									
									
									
									
									
								
							@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user