Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

ScrollArea does not expand to fit window size #130

@nick-kanakis

Description

@nick-kanakis

The header is one line Table created like this:

header := tui.NewTable(0, 0) 
header.SetColumnStretch(0, 1)
header.SetColumnStretch(1, 4) 
header.SetColumnStretch(2, 4) 
header.SetColumnStretch(3, 4) 
labelID := tui.NewLabel("ID")
labelNT := tui.NewLabel("Notebook Title")
labelT := tui.NewLabel("Note Title")
labelTags := tui.NewLabel("Tags")

Under the header there is a table created similar to header:

notesInfoList := tui.NewTable(0, 0)
notesInfoList.SetColumnStretch(0, 1)
notesInfoList.SetColumnStretch(1, 4)
notesInfoList.SetColumnStretch(2, 4)
notesInfoList.SetColumnStretch(3, 4)
notesInfoList.SetFocused(true)

for _, note := range jNotes {
		notesInfoList.AppendRow(
			//Note ID
			tui.NewLabel(strconv.Itoa(int(note.ID))),
			//Notebook title
			tui.NewLabel(note.NotebookTitle),
			//Note title
			tui.NewLabel(note.Title),
			//Note tags
			tui.NewLabel(note.Tags),
		)
	}

Everthything is aligned until I put the notesInfoList in a ScrollArea, what I do is:

scrollNotesInfo := tui.NewScrollArea(notesInfoList)
root := tui.NewVBox(header, scrollNotesInfo, mainPart, footer)
ui, err := tui.New(root)
if err != nil {
	log.Fatal(err)
}

Then the scrollable area shrinks to the left

With scrollable :
example

Without scrollable :

example2

Any ideas why this is happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions