fix some timeline glitching
This commit is contained in:
30
main.go
30
main.go
@@ -174,7 +174,7 @@ func CreateUITab(chatJidStr string) ChatTabUI {
|
|||||||
content.Wrapping = fyne.TextWrapWord
|
content.Wrapping = fyne.TextWrapWord
|
||||||
content.Selectable = true
|
content.Selectable = true
|
||||||
content.Importance = widget.MediumImportance
|
content.Importance = widget.MediumImportance
|
||||||
//content.SizeName = fyne.ThemeSizeName(theme.SizeNameText)
|
content.SizeName = fyne.ThemeSizeName(theme.SizeNameText)
|
||||||
icon := theme.FileVideoIcon()
|
icon := theme.FileVideoIcon()
|
||||||
replytext := widget.NewLabel(">fallback reply text")
|
replytext := widget.NewLabel(">fallback reply text")
|
||||||
replytext.Hide()
|
replytext.Hide()
|
||||||
@@ -218,6 +218,7 @@ func CreateUITab(chatJidStr string) ChatTabUI {
|
|||||||
if ok {
|
if ok {
|
||||||
author.SetText("Ignored user")
|
author.SetText("Ignored user")
|
||||||
content.SetText("This user is ignored due to: " + reason)
|
content.SetText("This user is ignored due to: " + reason)
|
||||||
|
content.Importance = widget.LowImportance
|
||||||
return // message is from blocked user
|
return // message is from blocked user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -236,6 +237,8 @@ func CreateUITab(chatJidStr string) ChatTabUI {
|
|||||||
|
|
||||||
if chatTabs[chatJidStr].Messages[i].Important {
|
if chatTabs[chatJidStr].Messages[i].Important {
|
||||||
content.Importance = widget.DangerImportance
|
content.Importance = widget.DangerImportance
|
||||||
|
} else {
|
||||||
|
content.Importance = widget.MediumImportance
|
||||||
}
|
}
|
||||||
btn.Hidden = true // Hide by default
|
btn.Hidden = true // Hide by default
|
||||||
msgContent := chatTabs[chatJidStr].Messages[i].Content
|
msgContent := chatTabs[chatJidStr].Messages[i].Content
|
||||||
@@ -310,9 +313,13 @@ func CreateUITab(chatJidStr string) ChatTabUI {
|
|||||||
|
|
||||||
sl := strings.Split(msgContent, " ")
|
sl := strings.Split(msgContent, " ")
|
||||||
|
|
||||||
|
content.SizeName = fyne.ThemeSizeName(theme.SizeNameText)
|
||||||
if len(sl) == 1 && isemoji.IsEmoji(sl[0]) {
|
if len(sl) == 1 && isemoji.IsEmoji(sl[0]) {
|
||||||
content.SizeName = fyne.ThemeSizeName(theme.SizeNameHeadingText)
|
content.SizeName = fyne.ThemeSizeName(theme.SizeNameHeadingText)
|
||||||
content.Refresh()
|
content.Refresh()
|
||||||
|
} else {
|
||||||
|
content.SizeName = fyne.ThemeSizeName(theme.SizeNameText)
|
||||||
|
content.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
if sl[0] == "/me" {
|
if sl[0] == "/me" {
|
||||||
@@ -1573,7 +1580,21 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AppTabs.OnUnselected = func(ti *container.TabItem) {
|
||||||
|
fmt.Println("hiding")
|
||||||
|
selectedScroller, ok := AppTabs.Selected().Content.(*widget.List)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
selectedScroller.Hidden = true
|
||||||
|
}
|
||||||
|
|
||||||
|
var MainSplit *container.Split
|
||||||
|
|
||||||
AppTabs.OnSelected = func(ti *container.TabItem) {
|
AppTabs.OnSelected = func(ti *container.TabItem) {
|
||||||
|
fmt.Println("showing")
|
||||||
chatSidebar.Resize(chatSidebar.Size())
|
chatSidebar.Resize(chatSidebar.Size())
|
||||||
if AppTabs.Selected() == AppTabs.Items[0] {
|
if AppTabs.Selected() == AppTabs.Items[0] {
|
||||||
chatSidebar.Hidden = true
|
chatSidebar.Hidden = true
|
||||||
@@ -1584,6 +1605,8 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedScroller.Hidden = false
|
||||||
|
|
||||||
var activeChatJid string
|
var activeChatJid string
|
||||||
for jid, tabData := range UITabs {
|
for jid, tabData := range UITabs {
|
||||||
if tabData.Scroller == selectedScroller {
|
if tabData.Scroller == selectedScroller {
|
||||||
@@ -1654,14 +1677,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
chatSidebar.Hidden = false
|
chatSidebar.Hidden = false
|
||||||
chatSidebar.Refresh()
|
chatSidebar.Refresh()
|
||||||
chatSidebar.Resize(chatSidebar.Size())
|
MainSplit.Resize(MainSplit.Size())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
chatSidebar.Hidden = false
|
chatSidebar.Hidden = false
|
||||||
statBar.SetText("")
|
statBar.SetText("")
|
||||||
chatInfo = *container.NewHBox(widget.NewLabel(""))
|
chatInfo = *container.NewHBox(widget.NewLabel(""))
|
||||||
MainSplit := container.NewHSplit(AppTabs, &chatSidebar)
|
MainSplit = container.NewHSplit(AppTabs, &chatSidebar)
|
||||||
DownSplit := container.NewHSplit(entry, container.NewGridWithRows(1, sendbtn, replybtn))
|
DownSplit := container.NewHSplit(entry, container.NewGridWithRows(1, sendbtn, replybtn))
|
||||||
|
|
||||||
BigSplit := container.NewVSplit(MainSplit, DownSplit)
|
BigSplit := container.NewVSplit(MainSplit, DownSplit)
|
||||||
|
|||||||
Reference in New Issue
Block a user