mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
ui/app: unexport Window.SetTextInput
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-8
@@ -11,8 +11,8 @@ import (
|
|||||||
|
|
||||||
"gioui.org/ui"
|
"gioui.org/ui"
|
||||||
"gioui.org/ui/app/internal/gpu"
|
"gioui.org/ui/app/internal/gpu"
|
||||||
"gioui.org/ui/input"
|
|
||||||
iinput "gioui.org/ui/app/internal/input"
|
iinput "gioui.org/ui/app/internal/input"
|
||||||
|
"gioui.org/ui/input"
|
||||||
"gioui.org/ui/internal/ops"
|
"gioui.org/ui/internal/ops"
|
||||||
"gioui.org/ui/key"
|
"gioui.org/ui/key"
|
||||||
)
|
)
|
||||||
@@ -80,12 +80,7 @@ func (w *Window) Timings() string {
|
|||||||
return w.timings
|
return w.timings
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) SetTextInput(s key.TextInputState) {
|
func (w *Window) setTextInput(s key.TextInputState) {
|
||||||
w.mu.Lock()
|
|
||||||
defer w.mu.Unlock()
|
|
||||||
if !w.isAlive() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if s != w.inputState && (s == key.TextInputClose || s == key.TextInputOpen) {
|
if s != w.inputState && (s == key.TextInputClose || s == key.TextInputOpen) {
|
||||||
w.driver.setTextInput(s)
|
w.driver.setTextInput(s)
|
||||||
}
|
}
|
||||||
@@ -143,11 +138,11 @@ func (w *Window) Draw(root *ui.Ops) {
|
|||||||
}
|
}
|
||||||
w.gpu.Draw(w.Profiling, size, root)
|
w.gpu.Draw(w.Profiling, size, root)
|
||||||
w.router.Frame(root)
|
w.router.Frame(root)
|
||||||
w.SetTextInput(w.router.InputState())
|
|
||||||
w.reader.Reset(root)
|
w.reader.Reset(root)
|
||||||
redrawTime, redraw := collectRedraws(&w.reader)
|
redrawTime, redraw := collectRedraws(&w.reader)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
w.mu.Lock()
|
w.mu.Lock()
|
||||||
|
w.setTextInput(w.router.InputState())
|
||||||
frameDur := now.Sub(w.lastFrame)
|
frameDur := now.Sub(w.lastFrame)
|
||||||
frameDur = frameDur.Truncate(100 * time.Microsecond)
|
frameDur = frameDur.Truncate(100 * time.Microsecond)
|
||||||
w.lastFrame = now
|
w.lastFrame = now
|
||||||
|
|||||||
Reference in New Issue
Block a user