forked from sunglocto/pi-im
Make bookmarks manager show an indicator when a bookamrk does not have a name, fix capitalisation on system tray, use legacy history when joining new room and bump Fyne version to 2.7.1
This commit is contained in:
19
main.go
19
main.go
@@ -178,6 +178,7 @@ func CreateUITab(chatJidStr string) ChatTabUI {
|
||||
btn := widget.NewButtonWithIcon("View media", icon, func() {
|
||||
|
||||
})
|
||||
btn.Hide()
|
||||
|
||||
reactions := container.NewHBox()
|
||||
|
||||
@@ -775,7 +776,7 @@ func main() {
|
||||
w = a.NewWindow("pi")
|
||||
w.SetCloseIntercept(func() {
|
||||
w.RequestFocus()
|
||||
dialog.ShowConfirm("Close pi", "You hit the close button. Do you want Pi to close completely (confirm) or minimize to the tray? (cancel)", func(b bool) {
|
||||
dialog.ShowConfirm("Close pi", "You hit the close button. Do you want Pi to close completely?", func(b bool) {
|
||||
if b {
|
||||
w.Close()
|
||||
a.Quit()
|
||||
@@ -1082,7 +1083,13 @@ func main() {
|
||||
for address, bookmark := range bookmarks {
|
||||
bookmarkWidget := container.NewGridWithColumns(7)
|
||||
|
||||
nameLabel := widget.NewLabel(bookmark.Name)
|
||||
var nameLabel *widget.RichText
|
||||
|
||||
if bookmark.Name != "" {
|
||||
nameLabel = widget.NewRichTextFromMarkdown(bookmark.Name)
|
||||
} else {
|
||||
nameLabel = widget.NewRichTextFromMarkdown("_no name_")
|
||||
}
|
||||
nameLabel.Wrapping = fyne.TextWrapBreak
|
||||
|
||||
bookmarkWidget.Add(nameLabel)
|
||||
@@ -1212,8 +1219,7 @@ func main() {
|
||||
mychannel.Nick = login.DisplayName
|
||||
//ch, err := client.MucClient.Join(client.Ctx, joinjid, client.Session)
|
||||
addChatTab(true, myjid, login.DisplayName)
|
||||
num := uint64(0)
|
||||
_, err = client.ConnectMuc(*mychannel, oasisSdk.MucLegacyHistoryConfig{MaxCount: &num}, context.TODO())
|
||||
_, err = client.ConnectMuc(*mychannel, oasisSdk.MucLegacyHistoryConfig{}, context.TODO())
|
||||
if err != nil {
|
||||
d.Hide()
|
||||
dialog.ShowError(err, w)
|
||||
@@ -1508,7 +1514,7 @@ func main() {
|
||||
|
||||
desk, ok := a.(desktop.App)
|
||||
if ok {
|
||||
desk.SetSystemTrayMenu(fyne.NewMenu("", fyne.NewMenuItem("show", w.Show)))
|
||||
desk.SetSystemTrayMenu(fyne.NewMenu("", fyne.NewMenuItem("Show window", w.Show)))
|
||||
}
|
||||
|
||||
AppTabs = container.NewDocTabs(
|
||||
@@ -1542,10 +1548,11 @@ func main() {
|
||||
if err != nil {
|
||||
dialog.ShowError(err, w)
|
||||
}
|
||||
fyne.Do(func() {
|
||||
AppTabs.Selected().Text = fmt.Sprintf("%s (disconnected)", AppTabs.Selected().Text)
|
||||
AppTabs.Remove(ti)
|
||||
delete(UITabs, activeChatJid)
|
||||
|
||||
})
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user