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

The color selection of cells by condition is lost when scrolling rows in the table for v2.4.1 #4351

Closed
2 tasks done
Dmitriy147 opened this issue Oct 30, 2023 · 3 comments
Closed
2 tasks done
Labels
unverified A bug that has been reported but not verified

Comments

@Dmitriy147
Copy link

Dmitriy147 commented Oct 30, 2023

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

When creating a table in version 2.4.1, when using a large number of rows with scrolling, the highlighting of cells by condition is lost. Artifacts also appear in the font of the strings.
The same code in version 2.3.5 works stably.

How to reproduce

  1. Create a project with the code below
  2. Use v.2.3.5
  3. Try to run and scroll the rows
  4. Change v.2.3.5 to v.2.4.1
  5. Run the project and try to scroll thw rows - the haotic color of cell will appeare.

Screenshots

For v.2.4.1:
Безымянный

For v.2.3.5:
Безымянный

Example code

package main

import (
	"fmt"
	"image/color"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/widget"
)

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("Table Widget")
	myWindow.Resize(fyne.NewSize(500, 300))
	myWindow.CenterOnScreen()

	table := widget.NewTable(nil, nil, nil)
	table.Length = func() (int, int) {
		return 20, 3
	}
	table.CreateCell = func() fyne.CanvasObject {
		return canvas.NewText("p", nil)
	}
	table.UpdateCell = func(i widget.TableCellID, o fyne.CanvasObject) {
		o.(*canvas.Text).Text = fmt.Sprintf("%v %v", i.Row, i.Col)
		o.(*canvas.Text).Alignment = fyne.TextAlign(fyne.TextAlignCenter)
		o.(*canvas.Text).Color = nil
		if i.Row == 2 {
			o.(*canvas.Text).Color = color.NRGBA{R: 222, G: 222, B: 22, A: 255}
		}
	}

	table.SetColumnWidth(0, 100)
	table.SetColumnWidth(1, 100)
	table.SetColumnWidth(2, 300)

	myWindow.SetContent(table)
	myWindow.ShowAndRun()
}

Fyne version

2.3.5 and 2.4.1

Go compiler version

1.21.3

Operating system and version

windows 10 x64 Pro

Additional Information

No response

@Dmitriy147 Dmitriy147 added the unverified A bug that has been reported but not verified label Oct 30, 2023
@Nyx2022
Copy link

Nyx2022 commented Oct 30, 2023

i have the similar problem #4352

@andydotxyz
Copy link
Member

After you manually change internal fields of a canvas object you must call Refresh() or it may not update immediately.

@Dmitriy147
Copy link
Author

Great! Solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

3 participants