From 4d879722352a97a3f4a26d1edfe0ce2f4cb86c36 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 14 Feb 2023 17:21:05 -0500 Subject: [PATCH] Hot themeing tweaks --- elements/basic/list.go | 1 - theme/default.go | 14 +++++++++++--- theme/defaultpatterns.go | 10 ++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/elements/basic/list.go b/elements/basic/list.go index 75c7a0d..0219e76 100644 --- a/elements/basic/list.go +++ b/elements/basic/list.go @@ -460,7 +460,6 @@ func (element *List) draw () { 0, 0, innerBounds.Dx(), element.contentHeight, ).Add(innerBounds.Min).Intersect(innerBounds) - pattern := element.theme.Pattern(theme.PatternSunken, state) tiles := shatter.Shatter(bounds, covered) for _, tile := range tiles { diff --git a/theme/default.go b/theme/default.go index 9afb6f2..e947199 100644 --- a/theme/default.go +++ b/theme/default.go @@ -144,10 +144,18 @@ func (Default) Pattern ( } } case PatternGutter: - if state.Disabled { - return disabledScrollGutterPattern + if c == C("basic", "sliderVertical") || c == C("basic", "sliderHorizontal") { + if state.Disabled { + return disabledThinScrollGutterPattern + } else { + return thinScrollGutterPattern + } } else { - return scrollGutterPattern + if state.Disabled { + return disabledScrollGutterPattern + } else { + return scrollGutterPattern + } } case PatternHandle: if state.Disabled { diff --git a/theme/defaultpatterns.go b/theme/defaultpatterns.go index 9dca6db..aa17ba5 100644 --- a/theme/defaultpatterns.go +++ b/theme/defaultpatterns.go @@ -207,9 +207,19 @@ var scrollGutterPattern = artist.NewMultiBordered ( }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x6e8079FF)) }) +var thinScrollGutterPattern = artist.Padded { + Fill: scrollGutterPattern, + Stroke: sunkenPattern, + Sides: []int{ 6, 6, 6, 6 }, +} var disabledScrollGutterPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: weakForegroundPattern }, artist.Stroke { Pattern: backgroundPattern }) +var disabledThinScrollGutterPattern = artist.Padded { + Fill: disabledScrollGutterPattern, + Stroke: disabledButtonPattern, + Sides: []int{ 6, 6, 6, 6}, +} var scrollBarPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: strokePattern }, artist.Stroke {