-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdefaultwidget.go
43 lines (32 loc) · 973 Bytes
/
defaultwidget.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2025 Hajime Hoshi
package guigui
import "github.com/hajimehoshi/ebiten/v2"
type DefaultWidget struct {
widgetState_ widgetState
}
func (*DefaultWidget) Layout(context *Context, appender *ChildWidgetAppender) {
}
func (*DefaultWidget) HandleInput(context *Context) HandleInputResult {
return HandleInputResult{}
}
func (*DefaultWidget) Update(context *Context) error {
return nil
}
func (*DefaultWidget) CursorShape(context *Context) (ebiten.CursorShapeType, bool) {
return 0, false
}
func (*DefaultWidget) Draw(context *Context, dst *ebiten.Image) {
}
func (*DefaultWidget) IsPopup() bool {
return false
}
func (d *DefaultWidget) Size(context *Context) (int, int) {
if d.widgetState_.parent == nil {
return context.app.bounds().Dx(), context.app.bounds().Dy()
}
return d.widgetState_.parent.Size(context)
}
func (d *DefaultWidget) widgetState() *widgetState {
return &d.widgetState_
}