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 {
|
|
|
|
*gtk.Box
|
|
|
|
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()
|
|
|
|
services.SetSizeRequest(LeftWidth, -1)
|
2020-06-06 07:44:36 +00:00
|
|
|
mesgview := messages.NewView()
|
2020-05-26 06:51:06 +00:00
|
|
|
|
2020-05-28 19:26:55 +00:00
|
|
|
separator, _ := gtk.SeparatorNew(gtk.ORIENTATION_VERTICAL)
|
|
|
|
separator.Show()
|
|
|
|
|
2020-05-26 06:51:06 +00:00
|
|
|
box, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0)
|
|
|
|
box.PackStart(services, false, false, 0)
|
2020-05-28 19:26:55 +00:00
|
|
|
box.PackStart(separator, false, false, 0)
|
2020-05-26 06:51:06 +00:00
|
|
|
box.PackStart(mesgview, true, true, 0)
|
2020-05-28 19:26:55 +00:00
|
|
|
box.Show()
|
2020-05-26 06:51:06 +00:00
|
|
|
|
|
|
|
return &window{box, services, mesgview}
|
|
|
|
}
|