Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider default value doesn't stay inside range #1128

Closed
Jacalz opened this issue Jun 24, 2020 · 2 comments
Closed

Slider default value doesn't stay inside range #1128

Jacalz opened this issue Jun 24, 2020 · 2 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Milestone

Comments

@Jacalz
Copy link
Member

Jacalz commented Jun 24, 2020

Describe the bug:

I noticed that having the slider widget inside a grid layout causes the slider to take some sort of weird direction intruding into the grid space assigned to another widget. Trying to drag and tap on the slider makes it go back to the correct spot and functionality.

To Reproduce:

Steps to reproduce the behaviour:

  1. Create a slider.
  2. Place the slider inside a grid layout (2 columns in my case).
  3. Start the application and notice how the slider is inside the other space.

Screenshots:

slider-bug

Example code:

package main

import (
	"fyne.io/fyne"
	"fyne.io/fyne/app"
	"fyne.io/fyne/layout"
	"fyne.io/fyne/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Slider")

	slider := widget.NewSlider(2, 6)

	content := fyne.NewContainerWithLayout(layout.NewGridLayout(2), widget.NewLabel("Buggy slider ->"), slider)

	w.SetContent(widget.NewVBox(content))
	w.ShowAndRun()
}

Device (please complete the following information):

  • OS: Linux (Solus 4.1)
  • Version: 5.6.18
  • Go version: 1.14.4
  • Fyne version: v1.3.0
@andydotxyz andydotxyz added blocker Items that would block a forthcoming release bug Something isn't working labels Jun 25, 2020
@andydotxyz andydotxyz added this to the 1.3.x milestone Jun 25, 2020
@andydotxyz andydotxyz changed the title Slider doesn't stay inside correct grid space Slider default value doesn't stay inside range Jun 25, 2020
@andydotxyz
Copy link
Member

Ah yes, the default value is not checked to be min <= val <= max. This is an easier fix than I thought :)

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 25, 2020
This was previously applied only on drag.
Fixed fyne-io#1128
andydotxyz added a commit that referenced this issue Jun 25, 2020
This was previously applied only on drag.
Fixed #1128
@andydotxyz
Copy link
Member

Fixed on develop for 1.3.1 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants