diff --git a/xkcd/main.go b/xkcd/main.go index bb1c502..548547a 100644 --- a/xkcd/main.go +++ b/xkcd/main.go @@ -118,6 +118,10 @@ func (x *XKCD) DataToScreen() { if newline := strings.IndexAny(v, "\n.-,"); newline > -1 { v = v[:newline] + "..." } + // NOTE: See Id == 1459 + if len(v) > 100 { + v = v[:100] + "..." + } x.labels[tag].SetText(v) } } @@ -167,8 +171,14 @@ func Show(app fyne.App) { }), submit) x.image = &canvas.Image{FillMode: canvas.ImageFillOriginal} + imageContainer := widget.NewScrollContainer(x.image) + controlsContainer := fyne.NewContainerWithLayout( + layout.NewBorderLayout(buttons, form, nil, nil), + buttons, form) w.SetContent(fyne.NewContainerWithLayout( - layout.NewBorderLayout(form, buttons, nil, nil), - form, buttons, x.image)) + layout.NewBorderLayout(controlsContainer, nil, nil, nil), + controlsContainer, imageContainer)) + w.Resize(fyne.NewSize(1000, 800)) // will limit to screensize + w.CenterOnScreen() w.Show() }