mirror of
https://github.com/diamondburned/cchat-gtk.git
synced 2024-12-23 12:46:45 +00:00
35 lines
774 B
Go
35 lines
774 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/messages"
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/service"
|
|
"github.com/gotk3/gotk3/gtk"
|
|
)
|
|
|
|
type window struct {
|
|
*gtk.Paned
|
|
Services *service.View
|
|
MessageView *messages.View
|
|
}
|
|
|
|
func newWindow(mainctl service.Controller) *window {
|
|
services := service.NewView(mainctl)
|
|
services.SetSizeRequest(leftMinWidth, -1)
|
|
services.Show()
|
|
|
|
mesgview := messages.NewView()
|
|
mesgview.Show()
|
|
|
|
pane, _ := gtk.PanedNew(gtk.ORIENTATION_HORIZONTAL)
|
|
pane.Pack1(services, false, false)
|
|
pane.Pack2(mesgview, true, false)
|
|
pane.SetPosition(leftCurrentWidth)
|
|
pane.Show()
|
|
|
|
return &window{pane, services, mesgview}
|
|
}
|
|
|
|
func (w *window) AllServices() []*service.Service {
|
|
return w.Services.Services.Services
|
|
}
|