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:
Elias Naur
2023-11-25 14:52:30 -06:00
parent 6dcebf205f
commit ab9f42c820
7 changed files with 13 additions and 29 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ func TestClickable(t *testing.T) {
r.Frame(gtx.Ops)
}
// frame: request focus for button 1
b1.Focus(gtx)
gtx.Execute(key.FocusCmd{Tag: &b1})
frame()
// frame: gain focus for button 1
frame()
@@ -78,7 +78,7 @@ func TestClickable(t *testing.T) {
t.Error("button 1 got clicked, even if it only got return press")
}
// frame: request focus for button 2
b2.Focus(gtx)
gtx.Execute(key.FocusCmd{Tag: &b2})
frame()
// frame: gain focus for button 2
frame()