Changed the order of the Theme.Pattern method

This commit is contained in:
Sasha Koshka 2023-02-12 10:58:23 -05:00
parent 82e92f1e2e
commit 7f0462d588
3 changed files with 6 additions and 6 deletions

View File

@ -307,7 +307,7 @@ func (element *Piano) drawFlat (
) { ) {
state.Pressed = pressed state.Pressed = pressed
pattern := element.theme.Theme.Pattern ( pattern := element.theme.Theme.Pattern (
theme.PatternButton, theme.C("fun", "flatKey"), state) theme.PatternButton, state, theme.C("fun", "flatKey"))
artist.FillRectangle(element, pattern, bounds) artist.FillRectangle(element, pattern, bounds)
} }
@ -318,6 +318,6 @@ func (element *Piano) drawSharp (
) { ) {
state.Pressed = pressed state.Pressed = pressed
pattern := element.theme.Theme.Pattern ( pattern := element.theme.Theme.Pattern (
theme.PatternButton, theme.C("fun", "sharpKey"), state) theme.PatternButton, state, theme.C("fun", "sharpKey"))
artist.FillRectangle(element, pattern, bounds) artist.FillRectangle(element, pattern, bounds)
} }

View File

@ -24,7 +24,7 @@ func (Default) FontFace (style FontStyle, size FontSize, c Case) font.Face {
} }
// Icon returns an icon from the default set corresponding to the given name. // Icon returns an icon from the default set corresponding to the given name.
func (Default) Icon (string, Case, IconSize) canvas.Image { func (Default) Icon (string, IconSize, Case) canvas.Image {
// TODO // TODO
return nil return nil
} }
@ -33,8 +33,8 @@ func (Default) Icon (string, Case, IconSize) canvas.Image {
// pattern ID. // pattern ID.
func (Default) Pattern ( func (Default) Pattern (
pattern Pattern, pattern Pattern,
c Case,
state PatternState, state PatternState,
c Case,
) artist.Pattern { ) artist.Pattern {
switch pattern { switch pattern {
case PatternAccent: case PatternAccent:

View File

@ -66,7 +66,7 @@ type Theme interface {
// Pattern returns an appropriate pattern given a pattern name, case, // Pattern returns an appropriate pattern given a pattern name, case,
// and state. // and state.
Pattern (Pattern, Case, PatternState) artist.Pattern Pattern (Pattern, PatternState, Case) artist.Pattern
// Inset returns the area on all sides of a given pattern that is not // Inset returns the area on all sides of a given pattern that is not
// meant to be drawn on. // meant to be drawn on.
@ -101,7 +101,7 @@ func (wrapped Wrapped) Icon (name string, size IconSize) canvas.Image {
// Pattern returns an appropriate pattern given a pattern name and state. // Pattern returns an appropriate pattern given a pattern name and state.
func (wrapped Wrapped) Pattern (id Pattern, state PatternState) artist.Pattern { func (wrapped Wrapped) Pattern (id Pattern, state PatternState) artist.Pattern {
real := wrapped.ensure() real := wrapped.ensure()
return real.Pattern(id, wrapped.Case, state) return real.Pattern(id, state, wrapped.Case)
} }
// Inset returns the area on all sides of a given pattern that is not meant to // Inset returns the area on all sides of a given pattern that is not meant to