Skip to content

Commit

Permalink
Expose the AboutSlint widget in the accessibility tree
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny committed Feb 10, 2025
1 parent 7d41ba4 commit 0645781
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/compiler/widgets/common/about-slint.slint
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export component AboutSlint {
source: Palette.color-scheme == ColorScheme.dark ? @image-url("MadeWithSlint-logo-dark.svg") : @image-url("MadeWithSlint-logo-light.svg");
preferred-width: 256px;
min-height: 48px;
accessible-role: image;
accessible-label: "#MadeWithSlint";
}

Text {
Expand Down
22 changes: 22 additions & 0 deletions tests/cases/widgets/about.slint
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright © SixtyFPS GmbH <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

import { AboutSlint } from "std-widgets.slint";

export component TestCase inherits Window {
about := AboutSlint { }
}


/*
```rust
use i_slint_backend_testing::AccessibleRole;
let instance = TestCase::new().unwrap();
let mut image_search = slint_testing::ElementHandle::find_by_accessible_label(&instance, "#MadeWithSlint");
let image = image_search.next().unwrap();
assert_eq!(image.accessible_role(), Some(AccessibleRole::Image));
```
*/

0 comments on commit 0645781

Please sign in to comment.