mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
app: add Window.Config, export app.Config
A Window configuration with its current option values can now be fetched during a FrameEvent. The WindowMode and Orientation options have moved to methods on their corresponding types. Fixes #260 Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
+8
-3
@@ -95,6 +95,7 @@ type window struct {
|
||||
|
||||
visible bool
|
||||
cursor pointer.CursorName
|
||||
config Config
|
||||
|
||||
pointerMap []C.CFTypeRef
|
||||
}
|
||||
@@ -268,7 +269,11 @@ func (w *window) WriteClipboard(s string) {
|
||||
C.writeClipboard(chars, C.NSUInteger(len(u16)))
|
||||
}
|
||||
|
||||
func (w *window) Configure(cnf *config) {}
|
||||
func (w *window) Configure([]Option) {}
|
||||
|
||||
func (w *window) Config() Config {
|
||||
return w.config
|
||||
}
|
||||
|
||||
func (w *window) SetAnimating(anim bool) {
|
||||
v := w.view
|
||||
@@ -329,8 +334,8 @@ func (w *window) SetInputHint(_ key.InputHint) {}
|
||||
// Close the window. Not implemented for iOS.
|
||||
func (w *window) Close() {}
|
||||
|
||||
func newWindow(win *callbacks, cnf *config) error {
|
||||
mainWindow.in <- windowAndConfig{win, cnf}
|
||||
func newWindow(win *callbacks, options []Option) error {
|
||||
mainWindow.in <- windowAndConfig{win, options}
|
||||
return <-mainWindow.errs
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user