From d63fc073debf191c470f157f43e57934942909f5 Mon Sep 17 00:00:00 2001 From: sunglocto Date: Sun, 7 Sep 2025 08:10:47 +0100 Subject: [PATCH] Fix timeline glitches --- main.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 24354f1..902418b 100644 --- a/main.go +++ b/main.go @@ -19,6 +19,7 @@ import ( "fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/dialog" + "fyne.io/fyne/v2/driver/desktop" "fyne.io/fyne/v2/storage" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" @@ -40,7 +41,7 @@ var chatInfo fyne.Container var chatSidebar fyne.Container var replyNameIcon string = ">" var replyBodyIcon string = ">" -var newlineIcon string = "|->" +var newlineIcon string = " |-> " var agreesToSendingHotFuckIntoChannel bool = false // by sunglocto @@ -174,13 +175,16 @@ func CreateUITab(chatJidStr string) ChatTabUI { ico.FillMode = canvas.ImageFillOriginal author := widget.NewLabel("author") author.TextStyle.Bold = true + author.Selectable = true content := widget.NewLabel("content") content.Wrapping = fyne.TextWrapWord content.Selectable = true + content.Importance = widget.MediumImportance icon := theme.FileVideoIcon() replytext := widget.NewLabel(">fallback reply text") replytext.Hide() replytext.Importance = widget.SuccessImportance + replytext.Selectable = true btn := widget.NewButtonWithIcon("View media", icon, func() { }) @@ -286,7 +290,13 @@ func CreateUITab(chatJidStr string) ChatTabUI { } scroller.SetItemHeight(i, vbox.MinSize().Height) + scroller.CreateItem().Refresh() vbox.Refresh() + /* + fyne.Do(func() { + scroller.RefreshItem(i) + }) + */ }, ) @@ -294,6 +304,7 @@ func CreateUITab(chatJidStr string) ChatTabUI { selectedId = id } + myUITab := ChatTabUI{} scroller.CreateItem() @@ -675,7 +686,8 @@ func main() { }() a = app.New() - //a.Settings().SetTheme(&myTheme{}) + + w = a.NewWindow("pi") 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) w.SetMainMenu(ma) + desk, ok := a.(desktop.App) + if ok { + desk.SetSystemTrayMenu(menu_help) + } + AppTabs = container.NewAppTabs( container.NewTabItem("τίποτα", widget.NewLabel(` pi