mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
app/internal/wm: use Option method to initialize windows
Added (*w.window).Option methods to the backends and use them for setting the initial options passed into NewWindow. Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
@@ -82,9 +82,7 @@ func NewWindow(win Callbacks, opts *Options) error {
|
||||
})
|
||||
w.addEventListeners()
|
||||
w.addHistory()
|
||||
if o := opts.WindowMode; o != nil {
|
||||
w.windowMode(*o)
|
||||
}
|
||||
w.Option(opts)
|
||||
w.w = win
|
||||
|
||||
go func() {
|
||||
@@ -476,6 +474,12 @@ func (w *window) WriteClipboard(s string) {
|
||||
w.clipboard.Call("writeText", s)
|
||||
}
|
||||
|
||||
func (w *window) Option(opts *Options) {
|
||||
if o := opts.WindowMode; o != nil {
|
||||
w.windowMode(*o)
|
||||
}
|
||||
}
|
||||
|
||||
func (w *window) SetCursor(name pointer.CursorName) {
|
||||
style := w.cnv.Get("style")
|
||||
style.Set("cursor", string(name))
|
||||
|
||||
Reference in New Issue
Block a user