2020-05-26 06:51:06 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
2020-06-06 07:44:36 +00:00
|
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/messages"
|
2020-05-26 06:51:06 +00:00
|
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/service"
|
|
|
|
"github.com/gotk3/gotk3/gtk"
|
|
|
|
)
|
|
|
|
|
|
|
|
type window struct {
|
2020-06-13 21:51:03 +00:00
|
|
|
*gtk.Paned
|
2020-05-26 06:51:06 +00:00
|
|
|
Services *service.View
|
2020-06-06 07:44:36 +00:00
|
|
|
MessageView *messages.View
|
2020-05-26 06:51:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func newWindow() *window {
|
|
|
|
services := service.NewView()
|
2020-06-13 21:51:03 +00:00
|
|
|
services.SetSizeRequest(leftMinWidth, -1)
|
|
|
|
services.Show()
|
2020-05-26 06:51:06 +00:00
|
|
|
|
2020-06-13 21:51:03 +00:00
|
|
|
mesgview := messages.NewView()
|
|
|
|
mesgview.Show()
|
2020-05-28 19:26:55 +00:00
|
|
|
|
2020-06-13 21:51:03 +00:00
|
|
|
pane, _ := gtk.PanedNew(gtk.ORIENTATION_HORIZONTAL)
|
|
|
|
pane.Pack1(services, false, false)
|
|
|
|
pane.Pack2(mesgview, true, false)
|
|
|
|
pane.SetPosition(leftCurrentWidth)
|
|
|
|
pane.Show()
|
2020-05-26 06:51:06 +00:00
|
|
|
|
2020-06-13 21:51:03 +00:00
|
|
|
return &window{pane, services, mesgview}
|
2020-05-26 06:51:06 +00:00
|
|
|
}
|