forked from joejulian/gio
widget: [API] replace Focus methods with explicit FocusCmds
Now that widgets by convention may be focused by issuing FocusCmd directly, remove the now redundant Focus methods on Clickable, Editor, Selectable. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-6
@@ -257,7 +257,7 @@ func (e *Editor) processPointer(gtx layout.Context) {
|
||||
X: int(math.Round(float64(evt.Position.X))),
|
||||
Y: int(math.Round(float64(evt.Position.Y))),
|
||||
})
|
||||
e.Focus(gtx)
|
||||
gtx.Execute(key.FocusCmd{Tag: e})
|
||||
if e.scroller.State() != gesture.StateFlinging {
|
||||
e.scrollCaret = true
|
||||
}
|
||||
@@ -560,11 +560,6 @@ func (e *Editor) command(gtx layout.Context, k key.Event) {
|
||||
}
|
||||
}
|
||||
|
||||
// Focus requests the input focus for the Editor.
|
||||
func (e *Editor) Focus(gtx layout.Context) {
|
||||
gtx.Execute(key.FocusCmd{Tag: e})
|
||||
}
|
||||
|
||||
// Focused returns whether the editor is focused or not.
|
||||
func (e *Editor) Focused() bool {
|
||||
return e.focused
|
||||
|
||||
Reference in New Issue
Block a user