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

Appending options to a disabled widget.RadioGroup shows them as enabled #1697

Closed
polarctos opened this issue Dec 30, 2020 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@polarctos
Copy link

Describe the bug:

When options are added to an existing widget.RadioGroup that was previously disabled using (w *DisableableWidget) Disable(), the options are added in the styling for enabled elements.
Thus with a black text and icon instead of grey ones.
They also show the hover effect and are highlighted when clicked, but the option cannot actually be selected.

To Reproduce:

Steps to reproduce the behaviour: (see code below)

  1. Create RadioGroup with some elements
  2. Disable the RadioGroup
  3. Append Options to the RadioGroup
  4. See error, additional options are shown in black instead of grey

Screenshots:

Before, correctly shown as disabled: Appended option is not shown as disabled:
image image

Example code:

Full reproducer:

package main

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

func main() {
	application := app.New()
	w := application.NewWindow("test")
	radioGroup := widget.NewRadioGroup([]string{"one", "two"}, func(string) {})
	radioGroup.SetSelected("one")
	radioGroup.Disable()
	button := widget.NewButton("Append three", func() {
		radioGroup.Append("three") // this option is then shown enabled
		radioGroup.Disable() // even disabling the group again does not help too
	})
	c := container.NewVBox(radioGroup, button)
	w.SetContent(c)
	w.ShowAndRun()
}

Device:

  • OS: macOS 10.15.7 (19H114)
  • Version: Catalina
  • Go version: go version go1.16beta1 darwin/amd64
  • Fyne version: fyne.io/fyne v1.4.2 h1:vh5P0ZIpczIAUu3uqh8YPjAPOy2XzgK7DcBD3CHj+3k=
@andydotxyz andydotxyz added the bug Something isn't working label Dec 30, 2020
jasinskp added a commit to jasinskp/fyne that referenced this issue Jan 8, 2021
fyne-io#1697

In updateItems function added set of item.DisableableWidget.disable based on whole RadioGroup Disable
@andydotxyz andydotxyz self-assigned this Jan 16, 2021
@andydotxyz
Copy link
Member

On develop for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants