Formatting fixes
This commit is contained in:
parent
7fee67474f
commit
bc72333ff0
|
@ -197,12 +197,12 @@ func (Default) MimeIcon (data.Mime, tomo.IconSize, tomo.Case) artist.Icon {
|
||||||
// pattern ID.
|
// pattern ID.
|
||||||
func (Default) Pattern (id tomo.Pattern, state tomo.State, c tomo.Case) artist.Pattern {
|
func (Default) Pattern (id tomo.Pattern, state tomo.State, c tomo.Case) artist.Pattern {
|
||||||
offset := 0; switch {
|
offset := 0; switch {
|
||||||
case state.Disabled: offset = 1
|
case state.Disabled: offset = 1
|
||||||
case state.Pressed && state.On: offset = 4
|
case state.Pressed && state.On: offset = 4
|
||||||
case state.Focused && state.On: offset = 6
|
case state.Focused && state.On: offset = 6
|
||||||
case state.On: offset = 2
|
case state.On: offset = 2
|
||||||
case state.Pressed: offset = 3
|
case state.Pressed: offset = 3
|
||||||
case state.Focused: offset = 5
|
case state.Focused: offset = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
switch id {
|
switch id {
|
||||||
|
|
124
theme.go
124
theme.go
|
@ -6,12 +6,34 @@ import "golang.org/x/image/font"
|
||||||
import "git.tebibyte.media/sashakoshka/tomo/data"
|
import "git.tebibyte.media/sashakoshka/tomo/data"
|
||||||
import "git.tebibyte.media/sashakoshka/tomo/artist"
|
import "git.tebibyte.media/sashakoshka/tomo/artist"
|
||||||
|
|
||||||
// IconSize is a type representing valid icon sizes.
|
// Color lits a number of cannonical colors, each with its own ID.
|
||||||
type IconSize int
|
type Color int; const (
|
||||||
|
// The sixteen ANSI terminal colors:
|
||||||
|
ColorBlack Color = iota
|
||||||
|
ColorRed
|
||||||
|
ColorGreen
|
||||||
|
ColorYellow
|
||||||
|
ColorBlue
|
||||||
|
ColorPurple
|
||||||
|
ColorCyan
|
||||||
|
ColorWhite
|
||||||
|
ColorBrightBlack
|
||||||
|
ColorBrightRed
|
||||||
|
ColorBrightGreen
|
||||||
|
ColorBrightYellow
|
||||||
|
ColorBrightBlue
|
||||||
|
ColorBrightPurple
|
||||||
|
ColorBrightCyan
|
||||||
|
ColorBrightWhite
|
||||||
|
|
||||||
const (
|
// ColorForeground is the text/icon color of the theme.
|
||||||
IconSizeSmall IconSize = 16
|
ColorForeground
|
||||||
IconSizeLarge IconSize = 48
|
|
||||||
|
// ColorBackground is the background color of the theme.
|
||||||
|
ColorBackground
|
||||||
|
|
||||||
|
// ColorAccent is the accent color of the theme.
|
||||||
|
ColorAccent
|
||||||
)
|
)
|
||||||
|
|
||||||
// Pattern lists a number of cannonical pattern types, each with its own ID.
|
// Pattern lists a number of cannonical pattern types, each with its own ID.
|
||||||
|
@ -53,34 +75,12 @@ type Pattern int; const (
|
||||||
PatternMercury
|
PatternMercury
|
||||||
)
|
)
|
||||||
|
|
||||||
// Color lits a number of cannonical colors, each with its own ID.
|
// IconSize is a type representing valid icon sizes.
|
||||||
type Color int; const (
|
type IconSize int
|
||||||
// The sixteen ANSI terminal colors:
|
|
||||||
ColorBlack Color = iota
|
|
||||||
ColorRed
|
|
||||||
ColorGreen
|
|
||||||
ColorYellow
|
|
||||||
ColorBlue
|
|
||||||
ColorPurple
|
|
||||||
ColorCyan
|
|
||||||
ColorWhite
|
|
||||||
ColorBrightBlack
|
|
||||||
ColorBrightRed
|
|
||||||
ColorBrightGreen
|
|
||||||
ColorBrightYellow
|
|
||||||
ColorBrightBlue
|
|
||||||
ColorBrightPurple
|
|
||||||
ColorBrightCyan
|
|
||||||
ColorBrightWhite
|
|
||||||
|
|
||||||
// ColorForeground is the text/icon color of the theme.
|
const (
|
||||||
ColorForeground
|
IconSizeSmall IconSize = 16
|
||||||
|
IconSizeLarge IconSize = 48
|
||||||
// ColorBackground is the background color of the theme.
|
|
||||||
ColorBackground
|
|
||||||
|
|
||||||
// ColorAccent is the accent color of the theme.
|
|
||||||
ColorAccent
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Icon lists a number of cannonical icons, each with its own ID.
|
// Icon lists a number of cannonical icons, each with its own ID.
|
||||||
|
@ -248,6 +248,36 @@ const (
|
||||||
IconEraser
|
IconEraser
|
||||||
IconFill
|
IconFill
|
||||||
IconText)
|
IconText)
|
||||||
|
|
||||||
|
// FontSize specifies the general size of a font face in a semantic way.
|
||||||
|
type FontSize int; const (
|
||||||
|
// FontSizeNormal is the default font size that should be used for most
|
||||||
|
// things.
|
||||||
|
FontSizeNormal FontSize = iota
|
||||||
|
|
||||||
|
// FontSizeLarge is a larger font size suitable for things like section
|
||||||
|
// headings.
|
||||||
|
FontSizeLarge
|
||||||
|
|
||||||
|
// FontSizeHuge is a very large font size suitable for things like
|
||||||
|
// titles, wizard step names, digital clocks, etc.
|
||||||
|
FontSizeHuge
|
||||||
|
|
||||||
|
// FontSizeSmall is a smaller font size. Try not to use this unless it
|
||||||
|
// makes a lot of sense to do so, because it can negatively impact
|
||||||
|
// accessibility. It is useful for things like copyright notices at the
|
||||||
|
// bottom of some window that the average user doesn't actually care
|
||||||
|
// about.
|
||||||
|
FontSizeSmall
|
||||||
|
)
|
||||||
|
|
||||||
|
// FontStyle specifies stylistic alterations to a font face.
|
||||||
|
type FontStyle int; const (
|
||||||
|
FontStyleRegular FontStyle = 0
|
||||||
|
FontStyleBold FontStyle = 1
|
||||||
|
FontStyleItalic FontStyle = 2
|
||||||
|
FontStyleBoldItalic FontStyle = 1 | 2
|
||||||
|
)
|
||||||
|
|
||||||
// Hints specifies rendering hints for a particular pattern. Elements can take
|
// Hints specifies rendering hints for a particular pattern. Elements can take
|
||||||
// these into account in order to gain extra performance.
|
// these into account in order to gain extra performance.
|
||||||
|
@ -372,33 +402,3 @@ type State struct {
|
||||||
// of patterns are typically flattened and greyed-out.
|
// of patterns are typically flattened and greyed-out.
|
||||||
Disabled bool
|
Disabled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// FontStyle specifies stylistic alterations to a font face.
|
|
||||||
type FontStyle int; const (
|
|
||||||
FontStyleRegular FontStyle = 0
|
|
||||||
FontStyleBold FontStyle = 1
|
|
||||||
FontStyleItalic FontStyle = 2
|
|
||||||
FontStyleBoldItalic FontStyle = 1 | 2
|
|
||||||
)
|
|
||||||
|
|
||||||
// FontSize specifies the general size of a font face in a semantic way.
|
|
||||||
type FontSize int; const (
|
|
||||||
// FontSizeNormal is the default font size that should be used for most
|
|
||||||
// things.
|
|
||||||
FontSizeNormal FontSize = iota
|
|
||||||
|
|
||||||
// FontSizeLarge is a larger font size suitable for things like section
|
|
||||||
// headings.
|
|
||||||
FontSizeLarge
|
|
||||||
|
|
||||||
// FontSizeHuge is a very large font size suitable for things like
|
|
||||||
// titles, wizard step names, digital clocks, etc.
|
|
||||||
FontSizeHuge
|
|
||||||
|
|
||||||
// FontSizeSmall is a smaller font size. Try not to use this unless it
|
|
||||||
// makes a lot of sense to do so, because it can negatively impact
|
|
||||||
// accessibility. It is useful for things like copyright notices at the
|
|
||||||
// bottom of some window that the average user doesn't actually care
|
|
||||||
// about.
|
|
||||||
FontSizeSmall
|
|
||||||
)
|
|
||||||
|
|
Reference in New Issue