Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/egui/src/containers/scroll_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use epaint::Margin;

use crate::{
Context, CursorIcon, Id, NumExt as _, Pos2, Rangef, Rect, Response, Sense, Ui, UiBuilder,
UiKind, UiStackInfo, Vec2, Vec2b, emath, epaint, lerp, pass_state, pos2, remap, remap_clamp,
UiKind, UiStackInfo, Vec2, Vec2b, WidgetInfo, emath, epaint, lerp, pass_state, pos2, remap,
remap_clamp,
};

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -1286,6 +1287,8 @@ impl Prepared {
// Also: it make sense to detect any hover where the scroll bar _will_ be.
let response = ui.interact(max_bar_rect, interact_id, sense);

response.widget_info(|| WidgetInfo::new(crate::WidgetType::ScrollBar));

// top/bottom of a horizontal scroll (d==0).
// left/rigth of a vertical scroll (d==1).
let cross = if scroll_style.floating {
Expand Down
3 changes: 3 additions & 0 deletions crates/egui/src/containers/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ fn resize_interaction(
},
true,
);

response.widget_info(|| WidgetInfo::new(crate::WidgetType::ResizeHandle));

SideResponse {
hover: response.hovered(),
drag: response.dragged(),
Expand Down
2 changes: 2 additions & 0 deletions crates/egui/src/data/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ impl WidgetInfo {
WidgetType::Panel => "panel",
WidgetType::ProgressIndicator => "progress indicator",
WidgetType::Window => "window",
WidgetType::ScrollBar => "scroll bar",
WidgetType::ResizeHandle => "resize handle",
WidgetType::Label | WidgetType::Other => "",
};

Expand Down
4 changes: 4 additions & 0 deletions crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,10 @@ pub enum WidgetType {

Window,

ResizeHandle,

ScrollBar,

/// If you cannot fit any of the above slots.
///
/// If this is something you think should be added, file an issue.
Expand Down
4 changes: 4 additions & 0 deletions crates/egui/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,10 @@ impl Response {
WidgetType::Panel => Role::Pane,
WidgetType::ProgressIndicator => Role::ProgressIndicator,
WidgetType::Window => Role::Window,

WidgetType::ResizeHandle => Role::Splitter,
WidgetType::ScrollBar => Role::ScrollBar,

WidgetType::Other => Role::Unknown,
});
if !info.enabled {
Expand Down