mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 04:04:25 +00:00
ui-contract: a label patch names a Label-role node by its value, as egui names its labels
This commit is contained in:
@@ -12,7 +12,12 @@ pub(crate) fn write_label_patch(ctx: &Context, patch: &LabelPatch) {
|
||||
if node.role() == accesskit::Role::Unknown {
|
||||
node.set_role(accesskit::Role::Label);
|
||||
}
|
||||
if node.label().is_none() {
|
||||
// A `Label` is named by its value, as egui names its own labels; other roles by their label.
|
||||
if node.role() == accesskit::Role::Label {
|
||||
if node.value().is_none() {
|
||||
node.set_value(text.clone());
|
||||
}
|
||||
} else if node.label().is_none() {
|
||||
node.set_label(text.clone());
|
||||
}
|
||||
if *disabled {
|
||||
|
||||
Reference in New Issue
Block a user