mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
+4
-5
@@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// WindowOption configures a Window.
|
// WindowOption configures a Window.
|
||||||
type WindowOption struct{
|
type WindowOption struct {
|
||||||
apply func(opts *windowOptions)
|
apply func(opts *windowOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,7 +328,6 @@ func (q *Queue) Next(k input.Key) (input.Event, bool) {
|
|||||||
return q.q.Next(k)
|
return q.q.Next(k)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// WithTitle returns an option that sets the window title.
|
// WithTitle returns an option that sets the window title.
|
||||||
func WithTitle(t string) WindowOption {
|
func WithTitle(t string) WindowOption {
|
||||||
return WindowOption{
|
return WindowOption{
|
||||||
@@ -340,19 +339,19 @@ func WithTitle(t string) WindowOption {
|
|||||||
|
|
||||||
// WithWidth returns an option that sets the window width.
|
// WithWidth returns an option that sets the window width.
|
||||||
func WithWidth(w ui.Value) WindowOption {
|
func WithWidth(w ui.Value) WindowOption {
|
||||||
if w.V<= 0 {
|
if w.V <= 0 {
|
||||||
panic("width must be larger than or equal to 0")
|
panic("width must be larger than or equal to 0")
|
||||||
}
|
}
|
||||||
return WindowOption{
|
return WindowOption{
|
||||||
apply: func(opts *windowOptions) {
|
apply: func(opts *windowOptions) {
|
||||||
opts.Width= w
|
opts.Width = w
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithHeight returns an option that sets the window height.
|
// WithHeight returns an option that sets the window height.
|
||||||
func WithHeight(h ui.Value) WindowOption {
|
func WithHeight(h ui.Value) WindowOption {
|
||||||
if h.V<= 0 {
|
if h.V <= 0 {
|
||||||
panic("height must be larger than or equal to 0")
|
panic("height must be larger than or equal to 0")
|
||||||
}
|
}
|
||||||
return WindowOption{
|
return WindowOption{
|
||||||
|
|||||||
Reference in New Issue
Block a user