diff --git a/artist/icon.go b/artist/icon.go new file mode 100644 index 0000000..399d1c9 --- /dev/null +++ b/artist/icon.go @@ -0,0 +1,14 @@ +package artist + +import "image" +import "image/color" +import "git.tebibyte.media/sashakoshka/tomo/canvas" + +type Icon interface { + // Draw draws the icon to the destination canvas at the specified point, + // using the specified color (if the icon is monochrome). + Draw (destination canvas.Canvas, color color.RGBA, at image.Point) + + // Bounds returns the bounds of the icon. + Bounds () image.Rectangle +} diff --git a/theme/assets/wintergreen-icons-small.png b/theme/assets/wintergreen-icons-small.png new file mode 100644 index 0000000..cd65704 Binary files /dev/null and b/theme/assets/wintergreen-icons-small.png differ diff --git a/theme/default.go b/theme/default.go index 7233cc5..304b77e 100644 --- a/theme/default.go +++ b/theme/default.go @@ -84,14 +84,14 @@ func (Default) FontFace (style FontStyle, size FontSize, c Case) font.Face { } // Icon returns an icon from the default set corresponding to the given name. -func (Default) Icon (string, IconSize, Case) canvas.Image { +func (Default) Icon (string, IconSize, Case) artist.Icon { // TODO return nil } // MimeIcon returns an icon from the default set corresponding to the given mime. // type. -func (Default) MimeIcon (data.Mime, IconSize, Case) canvas.Image { +func (Default) MimeIcon (data.Mime, IconSize, Case) artist.Icon { // TODO return nil } diff --git a/theme/theme.go b/theme/theme.go index dbeb3d0..f3341ab 100644 --- a/theme/theme.go +++ b/theme/theme.go @@ -5,7 +5,6 @@ import "image/color" import "golang.org/x/image/font" import "git.tebibyte.media/sashakoshka/tomo/data" import "git.tebibyte.media/sashakoshka/tomo/artist" -import "git.tebibyte.media/sashakoshka/tomo/canvas" // IconSize is a type representing valid icon sizes. type IconSize int @@ -148,6 +147,7 @@ type Icon int; const ( IconRemoveBookmark IconAddFavorite IconRemoveFavorite + IconPlay IconPause IconStop @@ -197,11 +197,11 @@ type Theme interface { FontFace (FontStyle, FontSize, Case) font.Face // Icon returns an appropriate icon given an icon name, size, and case. - Icon (string, IconSize, Case) canvas.Image + Icon (string, IconSize, Case) artist.Icon // Icon returns an appropriate icon given a file mime type, size, and, // case. - MimeIcon (data.Mime, IconSize, Case) canvas.Image + MimeIcon (data.Mime, IconSize, Case) artist.Icon // Pattern returns an appropriate pattern given a pattern name, case, // and state. diff --git a/theme/wrapped.go b/theme/wrapped.go index 200a5e2..a2c8706 100644 --- a/theme/wrapped.go +++ b/theme/wrapped.go @@ -5,7 +5,6 @@ import "image/color" import "golang.org/x/image/font" import "git.tebibyte.media/sashakoshka/tomo/data" import "git.tebibyte.media/sashakoshka/tomo/artist" -import "git.tebibyte.media/sashakoshka/tomo/canvas" // Wrapped wraps any theme and injects a case into it automatically so that it // doesn't need to be specified for each query. Additionally, if the underlying @@ -22,13 +21,13 @@ func (wrapped Wrapped) FontFace (style FontStyle, size FontSize) font.Face { } // Icon returns an appropriate icon given an icon name. -func (wrapped Wrapped) Icon (name string, size IconSize) canvas.Image { +func (wrapped Wrapped) Icon (name string, size IconSize) artist.Icon { real := wrapped.ensure() return real.Icon(name, size, wrapped.Case) } // MimeIcon returns an appropriate icon given file mime type. -func (wrapped Wrapped) MimeIcon (mime data.Mime, size IconSize) canvas.Image { +func (wrapped Wrapped) MimeIcon (mime data.Mime, size IconSize) artist.Icon { real := wrapped.ensure() return real.MimeIcon(mime, size, wrapped.Case) }