Attempt to fix right-click user windows
This commit is contained in:
@@ -32,7 +32,7 @@ func createTab(jid string, isMuc bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func switchToTab(jid string) {
|
func switchToTab(jid string, w *gtk.Window) {
|
||||||
current = jid
|
current = jid
|
||||||
tab, ok := tabs.Load(current)
|
tab, ok := tabs.Load(current)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -145,6 +145,7 @@ func switchToTab(jid string) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
win.SetChild(profile_box)
|
win.SetChild(profile_box)
|
||||||
|
win.SetTransientFor(win)
|
||||||
win.Present()
|
win.Present()
|
||||||
})
|
})
|
||||||
userbox.AddController(gesture)
|
userbox.AddController(gesture)
|
||||||
|
|||||||
8
main.go
8
main.go
@@ -45,6 +45,8 @@ var clientroot *xmpp.Client
|
|||||||
|
|
||||||
var uiQueue = make(chan func(), 100)
|
var uiQueue = make(chan func(), 100)
|
||||||
|
|
||||||
|
var window *gtk.ApplicationWindow
|
||||||
|
|
||||||
// stores members of mucs
|
// stores members of mucs
|
||||||
var mucmembers sync.Map
|
var mucmembers sync.Map
|
||||||
|
|
||||||
@@ -243,7 +245,7 @@ func main() {
|
|||||||
b := gtk.NewButtonWithLabel(user)
|
b := gtk.NewButtonWithLabel(user)
|
||||||
b.ConnectClicked(func() {
|
b.ConnectClicked(func() {
|
||||||
b.AddCSSClass("accent")
|
b.AddCSSClass("accent")
|
||||||
switchToTab(user)
|
switchToTab(user, &window.Window)
|
||||||
})
|
})
|
||||||
menu.Append(b)
|
menu.Append(b)
|
||||||
}
|
}
|
||||||
@@ -308,7 +310,7 @@ func activate(app *gtk.Application) {
|
|||||||
gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
|
gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||||
)
|
)
|
||||||
|
|
||||||
window := gtk.NewApplicationWindow(app)
|
window = gtk.NewApplicationWindow(app)
|
||||||
app.SetMenubar(gio.NewMenu())
|
app.SetMenubar(gio.NewMenu())
|
||||||
|
|
||||||
window.SetTitle("Lambda")
|
window.SetTitle("Lambda")
|
||||||
@@ -436,7 +438,7 @@ func activate(app *gtk.Application) {
|
|||||||
b := gtk.NewButtonWithLabel(t)
|
b := gtk.NewButtonWithLabel(t)
|
||||||
b.ConnectClicked(func() {
|
b.ConnectClicked(func() {
|
||||||
b.AddCSSClass("accent")
|
b.AddCSSClass("accent")
|
||||||
switchToTab(t)
|
switchToTab(t, &window.Window)
|
||||||
})
|
})
|
||||||
menu.Append(b)
|
menu.Append(b)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user