-
Notifications
You must be signed in to change notification settings - Fork 6k
Communicate switch status to semantics on Windows #36177
Communicate switch status to semantics on Windows #36177
Conversation
| varchild.lVal = CHILDID_SELF; | ||
| VARIANT native_state = {}; | ||
| ASSERT_TRUE(SUCCEEDED(native_view->get_accState(varchild, &native_state))); | ||
| EXPECT_FALSE(native_state.lVal & STATE_SYSTEM_PRESSED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to also test its MSAARole is ROLE_SYSTEM_CHECKBUTTON?
|
|
||
| case ax::mojom::Role::kToggleButton: | ||
| return ROLE_SYSTEM_PUSHBUTTON; | ||
| return ROLE_SYSTEM_CHECKBUTTON; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is check button basically a check box? Why do we choose this over push button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the same role as for a checkbox. In #flutter/fluter/111525 we are currently of the opinion that it is the most appropriate role, as it is for interactable widgets with toggleable state, and the materials design guidelines recommend their use in place of checkboxes on mobile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for explanation. SGTM
chunhtai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
||
| case ax::mojom::Role::kToggleButton: | ||
| return ROLE_SYSTEM_PUSHBUTTON; | ||
| return ROLE_SYSTEM_CHECKBUTTON; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for explanation. SGTM
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loic-sharma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nice work!
* Switch semantics * Test native role

Switch widgets used to have the
PUSHBUTTONrole on Windows, which has no associated state. This PR switches it to aCHECKBUTTONand associates thePRESSEDstate with its MSAA node when it is toggled. Adds a unit test to verify that the native state reflects the toggle state of the Switch.Also fixes some typos in comments in the existing checkbox unit test.
Addresses #flutter/flutter/111525
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.