mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
289fe02b90
We're about to reduce the scope of the Window.Queue by moving it to FrameEvent. As a consequence, Context can no longer rely on a Queue constant over its lifetime. Signed-off-by: Elias Naur <mail@eliasnaur.com>
28 lines
584 B
Go
28 lines
584 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
package layout
|
|
|
|
import (
|
|
"image"
|
|
"testing"
|
|
)
|
|
|
|
func TestStack(t *testing.T) {
|
|
var gtx Context
|
|
gtx.Reset(nil, nil, image.Point{X: 100, Y: 100})
|
|
gtx.Constraints.Width.Min = 0
|
|
gtx.Constraints.Height.Min = 0
|
|
exp := image.Point{X: 60, Y: 70}
|
|
Stack{Alignment: Center}.Layout(>x,
|
|
Expanded(func() {
|
|
gtx.Dimensions.Size = exp
|
|
}),
|
|
Stacked(func() {
|
|
gtx.Dimensions.Size = image.Point{X: 50, Y: 50}
|
|
}),
|
|
)
|
|
if got := gtx.Dimensions.Size; got != exp {
|
|
t.Errorf("Stack ignored Expanded size, got %v expected %v", got, exp)
|
|
}
|
|
}
|