2024-06-03 01:04:29 -06:00
|
|
|
package fallbackStyle
|
2024-05-03 17:58:28 -06:00
|
|
|
|
2024-07-27 19:36:00 -06:00
|
|
|
import "io"
|
|
|
|
import "bytes"
|
|
|
|
import "image"
|
|
|
|
import _ "embed"
|
|
|
|
import _ "image/png"
|
2024-05-03 17:58:28 -06:00
|
|
|
import "image/color"
|
2024-05-27 14:02:57 -06:00
|
|
|
import "git.tebibyte.media/tomo/tomo"
|
2024-07-27 19:36:00 -06:00
|
|
|
import "git.tebibyte.media/tomo/tomo/event"
|
2024-08-10 19:55:05 -06:00
|
|
|
import "git.tebibyte.media/tomo/backend/style"
|
2024-07-27 19:36:00 -06:00
|
|
|
|
|
|
|
var colorFocus = color.RGBA { R: 61, G: 128, B: 143, A: 255 }
|
|
|
|
var colorInput = color.RGBA { R: 208, G: 203, B: 150, A: 255 }
|
|
|
|
var colorCarved = color.RGBA { R: 151, G: 160, B: 150, A: 255 }
|
|
|
|
var colorGutter = color.RGBA { R: 116, G: 132, B: 126, A: 255 }
|
|
|
|
var colorShadow = color.RGBA { R: 57, G: 59, B: 57, A: 255 }
|
|
|
|
var colorShade = color.RGBA { A: 128 }
|
|
|
|
var colorInputShadow = color.RGBA { R: 143, G: 146, B: 91, A: 255 }
|
|
|
|
var colorHighlight = color.RGBA { R: 207, G: 215, B: 210, A: 255 }
|
|
|
|
var colorBackground = color.RGBA { R: 169, G: 171, B: 168, A: 255 }
|
|
|
|
var colorCarvedPressed = color.RGBA { R: 129, G: 142, B: 137, A: 255 }
|
|
|
|
var colorForeground = color.Black
|
|
|
|
var colorOutline = color.Black
|
|
|
|
var colorCalendarWeekdayHeader = color.RGBA { R: 194, G: 162, B: 132, A: 255 }
|
|
|
|
var colorCalendarWeekend = color.RGBA { R: 165, G: 185, B: 120, A: 255 }
|
|
|
|
var colorCalendarDay = color.RGBA { R: 194, G: 189, B: 132, A: 255 }
|
|
|
|
var colorInactive = color.RGBA { R: 131, G: 147, B: 134, A: 255 }
|
|
|
|
|
|
|
|
var outline = tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: [4]color.Color {
|
|
|
|
colorOutline,
|
|
|
|
colorOutline,
|
|
|
|
colorOutline,
|
|
|
|
colorOutline,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
var borderColorOutline = [4]color.Color { colorOutline, colorOutline, colorOutline, colorOutline }
|
|
|
|
var borderColorEngraved = [4]color.Color { colorShadow, colorHighlight, colorHighlight, colorShadow }
|
|
|
|
var borderColorLifted = [4]color.Color { colorHighlight, colorShadow, colorShadow, colorHighlight }
|
|
|
|
var borderColorInput = [4]color.Color { colorInputShadow, colorInput, colorInput, colorInputShadow }
|
|
|
|
var borderColorFocused = [4]color.Color { colorFocus, colorFocus, colorFocus, colorFocus }
|
|
|
|
var borderColorShade = [4]color.Color { colorShade, colorShade, colorShade, colorShade }
|
|
|
|
|
|
|
|
//go:embed assets/atlas.png
|
|
|
|
var atlasBytes []byte
|
|
|
|
|
|
|
|
type closerCookie struct { io.Closer }
|
|
|
|
func (cookie closerCookie) Close () { cookie.Closer.Close() }
|
|
|
|
func newCloserCookie (closer io.Closer) event.Cookie {
|
|
|
|
return closerCookie { Closer: closer }
|
|
|
|
}
|
2024-05-03 17:58:28 -06:00
|
|
|
|
2024-06-11 22:19:12 -06:00
|
|
|
// New returns Wintergreen, the default Tomo style. It is neutral-gray with
|
|
|
|
// green and turquoise accents.
|
2024-08-10 19:55:05 -06:00
|
|
|
func New () (*style.Style, event.Cookie) {
|
2024-07-27 19:36:00 -06:00
|
|
|
atlasImage, _, err := image.Decode(bytes.NewReader(atlasBytes))
|
|
|
|
if err != nil { panic(err) }
|
|
|
|
atlasTexture := tomo.NewTexture(atlasImage)
|
|
|
|
|
|
|
|
textureCheckboxChecked := atlasTexture.SubTexture(image.Rect( 0, 0, 12, 11))
|
2024-08-14 09:59:03 -06:00
|
|
|
// textureCorkboard := atlasTexture.SubTexture(image.Rect(16, 0, 28, 12))
|
2024-07-27 19:36:00 -06:00
|
|
|
textureTearLine := atlasTexture.SubTexture(image.Rect(16, 12, 18, 13))
|
|
|
|
textureHandleVertical := atlasTexture.SubTexture(image.Rect(28, 0, 29, 2))
|
|
|
|
textureHandleHorizontal := atlasTexture.SubTexture(image.Rect(28, 0, 30, 1))
|
|
|
|
|
|
|
|
cookie := event.MultiCookie(newCloserCookie(atlasTexture))
|
|
|
|
|
2024-08-10 19:55:05 -06:00
|
|
|
rules := []style.Rule {
|
2024-07-27 19:36:00 -06:00
|
|
|
// *.*
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ATextColor (tomo.ColorForeground),
|
|
|
|
tomo.ADotColor (tomo.ColorAccent ),
|
|
|
|
tomo.AGap (8, 8 ),
|
|
|
|
), tomo.R("", "")),
|
|
|
|
|
|
|
|
// *.Button
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrPadding(tomo.I(4, 8)),
|
|
|
|
tomo.AttrColor { Color: tomo.ColorRaised },
|
|
|
|
), tomo.R("", "Button")),
|
|
|
|
|
|
|
|
// *.Button[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
), tomo.R("", "Button"), "focused"),
|
|
|
|
|
|
|
|
// *.Button[pressed]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrPadding(tomo.I(5, 8, 4, 9)),
|
|
|
|
tomo.AttrColor { Color: colorCarvedPressed },
|
|
|
|
), tomo.R("", "Button"), "pressed"),
|
|
|
|
|
|
|
|
// *.TextInput
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorInput,
|
|
|
|
}),
|
|
|
|
tomo.AColor(colorInput),
|
|
|
|
tomo.APadding(5, 4, 4, 5),
|
|
|
|
), tomo.R("", "TextInput")),
|
|
|
|
|
|
|
|
// *.TextInput[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
}),
|
|
|
|
), tomo.R("", "TextInput"), "focused"),
|
|
|
|
|
|
|
|
// *.TextView
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
}),
|
|
|
|
tomo.AColor(tomo.ColorSunken),
|
|
|
|
tomo.APadding(8),
|
|
|
|
), tomo.R("", "TextView")),
|
|
|
|
|
|
|
|
// *.NumberInput
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AGap(0, 0),
|
|
|
|
), tomo.R("", "NumberInput")),
|
|
|
|
|
|
|
|
// *.Container[sunken]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
}),
|
2024-08-14 09:59:03 -06:00
|
|
|
tomo.AColor(tomo.ColorSunken),
|
|
|
|
// tomo.ATexture(textureCorkboard),
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.APadding(8),
|
|
|
|
), tomo.R("", "Container"), "sunken"),
|
|
|
|
|
|
|
|
// *.Container[outer]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrColor { Color: tomo.ColorBackground },
|
|
|
|
tomo.AttrPadding(tomo.I(8)),
|
|
|
|
), tomo.R("", "Container"), "outer"),
|
|
|
|
|
|
|
|
// *.Container[menu]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrColor { Color: tomo.ColorBackground },
|
|
|
|
tomo.AttrGap { },
|
|
|
|
), tomo.R("", "Container"), "menu"),
|
|
|
|
|
|
|
|
// *.Heading
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AAlign(tomo.AlignMiddle, tomo.AlignMiddle),
|
|
|
|
), tomo.R("", "Heading")),
|
2024-08-14 09:59:03 -06:00
|
|
|
|
|
|
|
// *.Heading
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.APadding(4, 8),
|
|
|
|
), tomo.R("", "Heading"), "menu"),
|
2024-07-27 19:36:00 -06:00
|
|
|
|
|
|
|
// *.Separator
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
), tomo.R("", "Separator")),
|
|
|
|
|
|
|
|
// *.Slider
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrColor { Color: colorGutter },
|
|
|
|
tomo.AttrPadding(tomo.I(0, 1, 1, 0)),
|
|
|
|
), tomo.R("", "Slider")),
|
|
|
|
|
|
|
|
// *.Slider[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
}),
|
|
|
|
tomo.APadding(0),
|
|
|
|
), tomo.R("", "Slider"), "focused"),
|
|
|
|
|
|
|
|
// *.Slider[horizontal]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AMinimumSize(48, 0),
|
|
|
|
), tomo.R("", "Slider"), "horizontal"),
|
|
|
|
|
|
|
|
// *.Slider[vertical]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AMinimumSize(0, 48),
|
|
|
|
), tomo.R("", "Slider"), "vertical"),
|
|
|
|
|
|
|
|
// *.SliderHandle
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: [4]color.Color {
|
|
|
|
tomo.ColorRaised, tomo.ColorRaised,
|
|
|
|
tomo.ColorRaised, tomo.ColorRaised,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
tomo.AColor(nil),
|
|
|
|
tomo.ATexture(textureHandleVertical),
|
|
|
|
tomo.AMinimumSize(12, 12),
|
|
|
|
), tomo.R("", "SliderHandle")),
|
|
|
|
|
|
|
|
// *.SliderHandle[horizontal]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ATexture(textureHandleHorizontal),
|
|
|
|
), tomo.R("", "SliderHandle"), "horizontal"),
|
|
|
|
|
2024-08-16 16:39:00 -06:00
|
|
|
// *.Scrollbar
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrColor { Color: colorGutter },
|
|
|
|
tomo.AttrPadding(tomo.I(0, 1, 1, 0)),
|
|
|
|
), tomo.R("", "Scrollbar")),
|
|
|
|
|
|
|
|
// *.Scrollbar[focused]
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
}),
|
|
|
|
tomo.APadding(0),
|
|
|
|
), tomo.R("", "Scrollbar"), "focused"),
|
|
|
|
|
|
|
|
// *.Scrollbar[horizontal]
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.AMinimumSize(48, 0),
|
|
|
|
), tomo.R("", "Scrollbar"), "horizontal"),
|
|
|
|
|
|
|
|
// *.Scrollbar[vertical]
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.AMinimumSize(0, 48),
|
|
|
|
), tomo.R("", "Scrollbar"), "vertical"),
|
|
|
|
|
|
|
|
// *.ScrollbarHandle
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: [4]color.Color {
|
|
|
|
tomo.ColorRaised, tomo.ColorRaised,
|
|
|
|
tomo.ColorRaised, tomo.ColorRaised,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
tomo.AColor(nil),
|
|
|
|
tomo.ATexture(textureHandleVertical),
|
|
|
|
tomo.AMinimumSize(12, 12),
|
|
|
|
), tomo.R("", "ScrollbarHandle")),
|
|
|
|
|
|
|
|
// *.ScrollbarHandle[horizontal]
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.ATexture(textureHandleHorizontal),
|
|
|
|
), tomo.R("", "ScrollbarHandle"), "horizontal"),
|
|
|
|
|
2024-07-27 19:36:00 -06:00
|
|
|
// *.ScrollContainer
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AGap(0, 0),
|
|
|
|
), tomo.R("", "ScrollContainer")),
|
|
|
|
|
|
|
|
// *.Checkbox
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
}),
|
|
|
|
tomo.AColor(tomo.ColorSunken),
|
|
|
|
tomo.APadding(0, 1, 1, 0),
|
|
|
|
tomo.AMinimumSize(19, 19),
|
|
|
|
tomo.ATexture(nil),
|
|
|
|
tomo.ATextureMode(tomo.TextureModeCenter),
|
|
|
|
), tomo.R("", "Checkbox")),
|
|
|
|
|
|
|
|
// *.Checkbox[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
}),
|
|
|
|
tomo.APadding(0),
|
|
|
|
), tomo.R("", "Checkbox"), "focused"),
|
|
|
|
|
|
|
|
// *.Checkbox[checked]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ATexture(textureCheckboxChecked),
|
|
|
|
), tomo.R("", "Checkbox"), "checked"),
|
|
|
|
|
|
|
|
// *.MenuItem
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrPadding(tomo.I(4)),
|
|
|
|
tomo.AttrGap { X: 4, Y: 4 },
|
|
|
|
tomo.AttrColor { Color: color.Transparent },
|
|
|
|
), tomo.R("", "MenuItem")),
|
|
|
|
|
|
|
|
// *MenuItem[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrColor { Color: tomo.ColorAccent },
|
|
|
|
), tomo.R("", "MenuItem"), "focused"),
|
|
|
|
|
|
|
|
// *.MenuItem[hovered]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrColor { Color: tomo.ColorAccent },
|
|
|
|
), tomo.R("", "MenuItem"), "hovered"),
|
|
|
|
|
|
|
|
// *.File
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrColor { Color: color.Transparent },
|
|
|
|
), tomo.R("", "File")),
|
|
|
|
|
|
|
|
// *.File[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrColor { Color: tomo.ColorAccent },
|
|
|
|
), tomo.R("", "File"), "focused"),
|
|
|
|
|
|
|
|
// *.TearLine
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.ABorder (
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(3),
|
|
|
|
Color: [4]color.Color {
|
|
|
|
color.Transparent,
|
|
|
|
color.Transparent,
|
|
|
|
color.Transparent,
|
|
|
|
color.Transparent,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
tomo.ATexture(textureTearLine),
|
|
|
|
tomo.APadding(1, 0, 0, 1),
|
|
|
|
), tomo.R("", "TearLine")),
|
|
|
|
|
|
|
|
// *.TearLine[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(3),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
), tomo.R("", "TearLine"), "focused"),
|
|
|
|
|
|
|
|
// *.TearLine[hovered]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(3),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
), tomo.R("", "TearLine"), "hovered"),
|
|
|
|
|
|
|
|
// *.Calendar
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 1, 1, 0),
|
|
|
|
Color: borderColorShade,
|
|
|
|
},
|
|
|
|
outline,
|
|
|
|
},
|
|
|
|
tomo.AttrColor { Color: colorInput },
|
|
|
|
tomo.AttrPadding(tomo.I(2)),
|
|
|
|
tomo.AttrGap { X: 2, Y: 2 },
|
|
|
|
), tomo.R("", "Calendar")),
|
|
|
|
|
|
|
|
// *.CalendarGrid
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrGap { X: 2, Y: 2 },
|
|
|
|
), tomo.R("", "CalendarGrid")),
|
|
|
|
|
|
|
|
// *.CalendarWeekdayHeader
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrPadding(tomo.I(2)),
|
|
|
|
tomo.AttrColor { Color: colorCalendarWeekdayHeader },
|
|
|
|
), tomo.R("", "CalendarWeekdayHeader")),
|
|
|
|
|
|
|
|
// *.CalendarDay[weekday]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrPadding(tomo.I(2)),
|
|
|
|
tomo.AttrMinimumSize { X: 32, Y: 32 },
|
|
|
|
tomo.AttrColor { Color: colorCalendarDay },
|
|
|
|
), tomo.R("", "CalendarDay"), "weekday"),
|
|
|
|
|
|
|
|
// *.CalendarDay[weekend]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrPadding(tomo.I(2)),
|
|
|
|
tomo.AttrMinimumSize { X: 32, Y: 32 },
|
|
|
|
tomo.AttrColor { Color: colorCalendarWeekend },
|
|
|
|
), tomo.R("", "CalendarDay"), "weekend"),
|
|
|
|
|
|
|
|
// *.TabbedContainer
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AGap(0, 0),
|
|
|
|
), tomo.R("", "TabbedContainer")),
|
|
|
|
|
|
|
|
// *.TabRow
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 1, 0, 1),
|
|
|
|
Color: borderColorOutline,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrGap { X: 0, Y: 0 },
|
|
|
|
tomo.AttrColor { Color: colorGutter },
|
|
|
|
tomo.AttrPadding(tomo.I(1, 0, 0, 0)),
|
|
|
|
), tomo.R("", "TabRow")),
|
|
|
|
|
|
|
|
// *.TabSpacer[left]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 0, 1, 0),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 0, 1, 0),
|
|
|
|
Color: borderColorOutline,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrMinimumSize { X: 1 },
|
|
|
|
), tomo.R("", "TabSpacer")),
|
|
|
|
|
|
|
|
// *.TabSpacer[right]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 0),
|
|
|
|
Color: [4]color.Color {
|
|
|
|
colorGutter, colorGutter,
|
|
|
|
colorGutter, colorGutter,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 0, 1, 0),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 0, 1, 1),
|
|
|
|
Color: borderColorOutline,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 0, 0, 1),
|
|
|
|
Color: borderColorShade,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrMinimumSize { X: 3 },
|
|
|
|
), tomo.R("", "TabSpacer"), "right"),
|
|
|
|
|
|
|
|
// *.Tab
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 0),
|
|
|
|
Color: [4]color.Color {
|
|
|
|
colorGutter, colorGutter,
|
|
|
|
colorGutter, colorGutter,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(0, 0, 1, 0),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 1, 1),
|
|
|
|
Color: borderColorOutline,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 1, 0, 1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrPadding(tomo.I(4, 8, 4, 8)),
|
|
|
|
tomo.AttrColor { Color: tomo.ColorRaised },
|
|
|
|
), tomo.R("", "Tab")),
|
|
|
|
|
|
|
|
// *.Tab[active]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorOutline,
|
|
|
|
},
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 1, 0, 1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
},
|
2024-08-14 09:59:03 -06:00
|
|
|
tomo.AttrPadding(tomo.I(4, 8, 7, 8)),
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrColor { Color: tomo.ColorBackground },
|
|
|
|
), tomo.R("", "Tab"), "active"),
|
|
|
|
|
|
|
|
// *.Swatch
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
},
|
|
|
|
tomo.AttrMinimumSize { X: 19, Y: 19 },
|
|
|
|
), tomo.R("", "Swatch")),
|
|
|
|
|
|
|
|
// *.Swatch[focused]
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
), tomo.R("", "Swatch"), "focused"),
|
|
|
|
|
|
|
|
// *.ColorPickerMap
|
2024-08-10 19:55:05 -06:00
|
|
|
style.Ru(style.AS (
|
2024-07-27 19:36:00 -06:00
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrColor { Color: tomo.ColorSunken },
|
|
|
|
tomo.AttrMinimumSize { X: 128, Y: 128 },
|
|
|
|
), tomo.R("", "ColorPickerMap")),
|
2024-08-16 15:26:20 -06:00
|
|
|
|
|
|
|
// *.Dropdown
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorLifted,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrPadding(tomo.I(4, 8)),
|
|
|
|
tomo.AttrColor { Color: tomo.ColorRaised },
|
|
|
|
), tomo.R("", "Dropdown")),
|
|
|
|
|
|
|
|
// *.Dropdown[focused]
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1),
|
|
|
|
Color: borderColorFocused,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
), tomo.R("", "Dropdown"), "focused"),
|
|
|
|
|
|
|
|
// *.Dropdown[pressed]
|
|
|
|
style.Ru(style.AS (
|
|
|
|
tomo.AttrBorder {
|
|
|
|
outline,
|
|
|
|
tomo.Border {
|
|
|
|
Width: tomo.I(1, 0, 0, 1),
|
|
|
|
Color: borderColorEngraved,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tomo.AttrPadding(tomo.I(5, 8, 4, 9)),
|
|
|
|
tomo.AttrColor { Color: colorCarvedPressed },
|
|
|
|
), tomo.R("", "Dropdown"), "pressed"),
|
2024-07-27 19:36:00 -06:00
|
|
|
}
|
|
|
|
|
2024-08-10 19:55:05 -06:00
|
|
|
return &style.Style {
|
2024-07-25 15:47:50 -06:00
|
|
|
Rules: rules,
|
2024-05-27 14:02:57 -06:00
|
|
|
Colors: map[tomo.Color] color.Color {
|
|
|
|
tomo.ColorBackground: colorBackground,
|
|
|
|
tomo.ColorForeground: colorForeground,
|
|
|
|
tomo.ColorRaised: colorCarved,
|
|
|
|
tomo.ColorSunken: colorCarved,
|
|
|
|
tomo.ColorAccent: colorFocus,
|
2024-05-03 17:58:28 -06:00
|
|
|
},
|
2024-07-27 19:36:00 -06:00
|
|
|
}, cookie
|
2024-05-03 17:58:28 -06:00
|
|
|
}
|