core: Make objects focusable by default

Since is_focusable has been moved to InteractiveObject,
it may now return true by default, because non-interactive objects
do not implement this method anymore.
This commit is contained in:
Kamil Jarosz 2024-04-09 21:46:31 +02:00 committed by Adrian Wielgosik
parent 5173fa4118
commit 47758e1fb3
4 changed files with 3 additions and 15 deletions

View File

@ -624,10 +624,6 @@ impl<'gc> TInteractiveObject<'gc> for Avm1Button<'gc> {
}
}
fn is_focusable(&self, _context: &mut UpdateContext<'_, 'gc>) -> bool {
true
}
fn on_focus_changed(
&self,
context: &mut UpdateContext<'_, 'gc>,

View File

@ -824,10 +824,6 @@ impl<'gc> TInteractiveObject<'gc> for Avm2Button<'gc> {
}
}
fn is_focusable(&self, _context: &mut UpdateContext<'_, 'gc>) -> bool {
true
}
fn on_focus_changed(
&self,
_context: &mut UpdateContext<'_, 'gc>,

View File

@ -2471,11 +2471,6 @@ impl<'gc> TInteractiveObject<'gc> for EditText<'gc> {
}
}
fn is_focusable(&self, _context: &mut UpdateContext<'_, 'gc>) -> bool {
// Even if this isn't selectable or editable, a script can focus on it manually.
true
}
fn on_focus_changed(
&self,
context: &mut UpdateContext<'_, 'gc>,

View File

@ -511,9 +511,10 @@ pub trait TInteractiveObject<'gc>:
MouseCursor::Hand
}
/// Whether this clip may be focusable for keyboard input.
/// Whether this object is focusable for keyboard input.
fn is_focusable(&self, _context: &mut UpdateContext<'_, 'gc>) -> bool {
false
// By default, all interactive objects are focusable.
true
}
/// Called whenever the focus tracker has deemed this display object worthy, or no longer worthy,