Style ScrollBar separately in fallback

This commit is contained in:
Sasha Koshka 2024-08-16 18:39:00 -04:00
parent 696460f323
commit fbdc285f2e

View File

@ -263,6 +263,65 @@ rules := []style.Rule {
tomo.ATexture(textureHandleHorizontal),
), tomo.R("", "SliderHandle"), "horizontal"),
// *.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"),
// *.ScrollContainer
style.Ru(style.AS (
tomo.AGap(0, 0),