Skip to content

Commit

Permalink
Merge pull request #3382 from Jacalz/3381-slider-track-colour
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Nov 6, 2022
2 parents 3b2b181 + ddc9d06 commit cae867c
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 7 deletions.
Binary file modified dialog/testdata/color/channel_layout_foobar_0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dialog/testdata/color/channel_layout_foobar_50.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dialog/testdata/color/dialog_expanded_theme_default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dialog/testdata/color/picker_layout_advanced.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified driver/software/testdata/canvas.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified driver/software/testdata/canvas_mobile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions widget/slider.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,9 @@ func (s *Slider) MinSize() fyne.Size {
// CreateRenderer links this widget to its renderer.
func (s *Slider) CreateRenderer() fyne.WidgetRenderer {
s.ExtendBaseWidget(s)
track := canvas.NewRectangle(theme.ShadowColor())
track := canvas.NewRectangle(theme.InputBackgroundColor())
active := canvas.NewRectangle(theme.ForegroundColor())
thumb := &canvas.Circle{
FillColor: theme.ForegroundColor(),
StrokeWidth: 0}
thumb := &canvas.Circle{FillColor: theme.ForegroundColor()}

objects := []fyne.CanvasObject{track, active, thumb}

Expand Down Expand Up @@ -271,7 +269,7 @@ type sliderRenderer struct {

// Refresh updates the widget state for drawing.
func (s *sliderRenderer) Refresh() {
s.track.FillColor = theme.ShadowColor()
s.track.FillColor = theme.InputBackgroundColor()
s.thumb.FillColor = theme.ForegroundColor()
s.active.FillColor = theme.ForegroundColor()

Expand Down
2 changes: 1 addition & 1 deletion widget/testdata/slider/horizontal.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<canvas padded size="220x50">
<content>
<widget pos="6,6" size="208x38" type="*widget.Slider">
<rectangle fillColor="shadow" pos="14,18" size="178x2"/>
<rectangle fillColor="inputBackground" pos="14,18" size="178x2"/>
<rectangle fillColor="foreground" pos="14,18" size="0x2"/>
<circle fillColor="foreground" pos="6,10" size="16x16"/>
</widget>
Expand Down
2 changes: 1 addition & 1 deletion widget/testdata/slider/vertical.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<canvas padded size="50x220">
<content>
<widget pos="6,6" size="38x208" type="*widget.Slider">
<rectangle fillColor="shadow" pos="18,14" size="2x178"/>
<rectangle fillColor="inputBackground" pos="18,14" size="2x178"/>
<rectangle fillColor="foreground" pos="18,193" size="2x0"/>
<circle fillColor="foreground" pos="10,185" size="16x16"/>
</widget>
Expand Down

0 comments on commit cae867c

Please sign in to comment.