Fix timeline glitches

This commit is contained in:
2025-09-07 08:10:47 +01:00
parent 0c26b7a8cf
commit d63fc073de

21
main.go
View File

@@ -19,6 +19,7 @@ import (
"fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/driver/desktop"
"fyne.io/fyne/v2/storage" "fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
@@ -40,7 +41,7 @@ var chatInfo fyne.Container
var chatSidebar fyne.Container var chatSidebar fyne.Container
var replyNameIcon string = ">" var replyNameIcon string = ">"
var replyBodyIcon string = ">" var replyBodyIcon string = ">"
var newlineIcon string = "|->" var newlineIcon string = " |-> "
var agreesToSendingHotFuckIntoChannel bool = false var agreesToSendingHotFuckIntoChannel bool = false
// by sunglocto // by sunglocto
@@ -174,13 +175,16 @@ func CreateUITab(chatJidStr string) ChatTabUI {
ico.FillMode = canvas.ImageFillOriginal ico.FillMode = canvas.ImageFillOriginal
author := widget.NewLabel("author") author := widget.NewLabel("author")
author.TextStyle.Bold = true author.TextStyle.Bold = true
author.Selectable = true
content := widget.NewLabel("content") content := widget.NewLabel("content")
content.Wrapping = fyne.TextWrapWord content.Wrapping = fyne.TextWrapWord
content.Selectable = true content.Selectable = true
content.Importance = widget.MediumImportance
icon := theme.FileVideoIcon() icon := theme.FileVideoIcon()
replytext := widget.NewLabel(">fallback reply text") replytext := widget.NewLabel(">fallback reply text")
replytext.Hide() replytext.Hide()
replytext.Importance = widget.SuccessImportance replytext.Importance = widget.SuccessImportance
replytext.Selectable = true
btn := widget.NewButtonWithIcon("View media", icon, func() { btn := widget.NewButtonWithIcon("View media", icon, func() {
}) })
@@ -286,7 +290,13 @@ func CreateUITab(chatJidStr string) ChatTabUI {
} }
scroller.SetItemHeight(i, vbox.MinSize().Height) scroller.SetItemHeight(i, vbox.MinSize().Height)
scroller.CreateItem().Refresh()
vbox.Refresh() vbox.Refresh()
/*
fyne.Do(func() {
scroller.RefreshItem(i)
})
*/
}, },
) )
@@ -294,6 +304,7 @@ func CreateUITab(chatJidStr string) ChatTabUI {
selectedId = id selectedId = id
} }
myUITab := ChatTabUI{} myUITab := ChatTabUI{}
scroller.CreateItem() scroller.CreateItem()
@@ -675,7 +686,8 @@ func main() {
}() }()
a = app.New() a = app.New()
//a.Settings().SetTheme(&myTheme{})
w = a.NewWindow("pi") w = a.NewWindow("pi")
w.Resize(fyne.NewSize(500, 500)) w.Resize(fyne.NewSize(500, 500))
@@ -1278,6 +1290,11 @@ func main() {
ma := fyne.NewMainMenu(menu_help, menu_changeroom, menu_configureview, menu_messageoptions, menu_jokes) ma := fyne.NewMainMenu(menu_help, menu_changeroom, menu_configureview, menu_messageoptions, menu_jokes)
w.SetMainMenu(ma) w.SetMainMenu(ma)
desk, ok := a.(desktop.App)
if ok {
desk.SetSystemTrayMenu(menu_help)
}
AppTabs = container.NewAppTabs( AppTabs = container.NewAppTabs(
container.NewTabItem("τίποτα", widget.NewLabel(` container.NewTabItem("τίποτα", widget.NewLabel(`
pi pi