fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.29k stars 1.41k forks source link

Tables do not render fully on develop #3443

Closed rkmpa closed 1 year ago

rkmpa commented 2 years ago

Checklist

Describe the bug

A simple table does not render fully on latest develop. After clicking a cell, the previously missing cells render correctly. Unlike in v2.2.4, resizing the window to cover all available screen space does not trigger the cells to render.

How to reproduce

  1. Setup Ubuntu 22.04.01 LTS
  2. Download Go v1.18.1
  3. Run code below after setting up Fyne

Screenshots

Bildschirmfoto vom 2022-11-30 22-47-53

:point_up_2: before clicking cell

Bildschirmfoto vom 2022-11-30 22-48-11

:point_up_2: after clicking cell

Example code

package main

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

func main() {

    fyneApp := app.New()
    window := fyneApp.NewWindow("Playground")

    tableData := [][]string{
        {"Col 1", "Col 2", "Col3"},
        {"1", "2", "3"},
        {"4", "5", "6"}}

    table := widget.NewTable(func() (int, int) {
        return 3, 3
    },
        func() fyne.CanvasObject {
            return widget.NewLabel("")
        },
        func(tci widget.TableCellID, co fyne.CanvasObject) {
            co.(*widget.Label).SetText(tableData[tci.Col][tci.Row])
        })

    table.SetColumnWidth(0, 40)
    table.SetColumnWidth(1, 40)
    table.SetColumnWidth(2, 40)

    window.Resize(fyne.Size{1000, 1000})
    window.SetContent(table)
    window.ShowAndRun()

}

Fyne version

v2.2.5-0.20221129230658-dbdb9fc26091

Go compiler version

v1.18.1

Operating system

Linux

Operating system version

Ubuntu 22.04.1 LTS

Additional Information

No response

andydotxyz commented 2 years ago

This seems to be only an issue when the table is larger than its content. Not sure how this slipped by!

andydotxyz commented 2 years ago

Adding blocker as this is a regression

ddkwork commented 2 years ago

This seems to be only an issue when the table is larger than its content. Not sure how this slipped by!

i have the same problem.

eliranwong commented 2 years ago

I encounter the same issue, the only workaround I found, so far, is to scroll to the bottom when it is loaded.

table.ScrollToBottom()

Obviously, it is not a good solution, please kindly let me know if there is a better one.

andydotxyz commented 2 years ago

I'm not much for recommending workarounds. But I can say this will be fixed in the upcoming release v2.3.0 that we are testing.

andydotxyz commented 2 years ago

After a false start looks like that is resolved (in the PR)

andydotxyz commented 1 year ago

Fixed on develop ready for v2.3.0

junmaqiang commented 1 year ago

WX20230107-134942

Jacalz commented 1 year ago

@junmaqiang If you have questions, please direct them on slack or through discussions. This is a solved issue and not the right place to ask unrelated questions. Thanks for understanding.