2020-06-06 07:44:36 +00:00
|
|
|
package compact
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/diamondburned/cchat"
|
|
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/messages/container"
|
|
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/messages/input"
|
2020-06-13 07:29:32 +00:00
|
|
|
"github.com/diamondburned/cchat-gtk/internal/ui/primitives"
|
2020-06-06 07:44:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Container struct {
|
|
|
|
*container.GridContainer
|
|
|
|
}
|
|
|
|
|
2020-06-13 07:29:32 +00:00
|
|
|
func NewContainer(ctrl container.Controller) *Container {
|
|
|
|
c := container.NewGridContainer(constructor{}, ctrl)
|
|
|
|
primitives.AddClass(c, "compact-conatainer")
|
|
|
|
return &Container{c}
|
2020-06-06 07:44:36 +00:00
|
|
|
}
|
|
|
|
|
2020-06-07 04:27:28 +00:00
|
|
|
type constructor struct{}
|
|
|
|
|
|
|
|
func (constructor) NewMessage(msg cchat.MessageCreate) container.GridMessage {
|
2020-06-06 07:44:36 +00:00
|
|
|
return NewMessage(msg)
|
|
|
|
}
|
|
|
|
|
2020-06-07 04:27:28 +00:00
|
|
|
func (constructor) NewPresendMessage(msg input.PresendMessage) container.PresendGridMessage {
|
2020-06-06 07:44:36 +00:00
|
|
|
return NewPresendMessage(msg)
|
|
|
|
}
|