Skip to content

Commit

Permalink
Add WidgetType::RadioGroup (#5081)
Browse files Browse the repository at this point in the history
Extracted out of #4805

I'm using this widget type in [`egui-theme-switch`] but since it's not
built in I have to call `accesskit_node_builder` which is a bit
cumbersome :)

* [x] I have followed the instructions in the PR template

[`egui-theme-switch`]:
https://github.com/bash/egui-theme-switch/blob/main/src/lib.rs
  • Loading branch information
bash authored Sep 9, 2024
1 parent 6b7f431 commit c6375ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/egui/src/data/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ impl WidgetInfo {
WidgetType::Button => "button",
WidgetType::Checkbox => "checkbox",
WidgetType::RadioButton => "radio",
WidgetType::RadioGroup => "radio group",
WidgetType::SelectableLabel => "selectable",
WidgetType::ComboBox => "combo",
WidgetType::Slider => "slider",
Expand Down
3 changes: 3 additions & 0 deletions crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,9 @@ pub enum WidgetType {

RadioButton,

/// A group of radio buttons.
RadioGroup,

SelectableLabel,

ComboBox,
Expand Down
1 change: 1 addition & 0 deletions crates/egui/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ impl Response {
}
WidgetType::Checkbox => Role::CheckBox,
WidgetType::RadioButton => Role::RadioButton,
WidgetType::RadioGroup => Role::RadioGroup,
WidgetType::SelectableLabel => Role::Button,
WidgetType::ComboBox => Role::ComboBox,
WidgetType::Slider => Role::Slider,
Expand Down

0 comments on commit c6375ef

Please sign in to comment.