diff --git a/crates/egui/src/data/output.rs b/crates/egui/src/data/output.rs index 809fae34..0a658965 100644 --- a/crates/egui/src/data/output.rs +++ b/crates/egui/src/data/output.rs @@ -713,7 +713,6 @@ impl WidgetInfo { WidgetType::Slider => "slider", WidgetType::DragValue => "drag value", WidgetType::ColorButton => "color button", - WidgetType::ImageButton => "image button", WidgetType::Image => "image", WidgetType::CollapsingHeader => "collapsing header", WidgetType::ProgressIndicator => "progress indicator", diff --git a/crates/egui/src/lib.rs b/crates/egui/src/lib.rs index 75f80457..f8e9308a 100644 --- a/crates/egui/src/lib.rs +++ b/crates/egui/src/lib.rs @@ -668,8 +668,6 @@ pub enum WidgetType { ColorButton, - ImageButton, - Image, CollapsingHeader, diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index 85dc8a60..06ac7bc0 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -847,14 +847,13 @@ impl Response { WidgetType::Label => Role::Label, WidgetType::Link => Role::Link, WidgetType::TextEdit => Role::TextInput, - WidgetType::Button | WidgetType::ImageButton | WidgetType::CollapsingHeader => { + WidgetType::Button | WidgetType::CollapsingHeader | WidgetType::SelectableLabel => { Role::Button } WidgetType::Image => Role::Image, WidgetType::Checkbox => Role::CheckBox, WidgetType::RadioButton => Role::RadioButton, WidgetType::RadioGroup => Role::RadioGroup, - WidgetType::SelectableLabel => Role::Button, WidgetType::ComboBox => Role::ComboBox, WidgetType::Slider => Role::Slider, WidgetType::DragValue => Role::SpinButton, diff --git a/crates/egui/src/widgets/image_button.rs b/crates/egui/src/widgets/image_button.rs index a765a745..752980bb 100644 --- a/crates/egui/src/widgets/image_button.rs +++ b/crates/egui/src/widgets/image_button.rs @@ -6,6 +6,7 @@ use crate::{ /// A clickable image within a frame. #[must_use = "You should put this widget in a ui with `ui.add(widget);`"] #[derive(Clone, Debug)] +#[deprecated(since = "0.33.0", note = "Use egui::Button::image instead")] pub struct ImageButton<'a> { pub(crate) image: Image<'a>, sense: Sense, @@ -14,6 +15,7 @@ pub struct ImageButton<'a> { alt_text: Option, } +#[expect(deprecated, reason = "Deprecated in egui 0.33.0")] impl<'a> ImageButton<'a> { pub fn new(image: impl Into>) -> Self { Self { @@ -82,6 +84,7 @@ impl<'a> ImageButton<'a> { } } +#[expect(deprecated, reason = "Deprecated in egui 0.33.0")] impl Widget for ImageButton<'_> { fn ui(self, ui: &mut Ui) -> Response { let padding = if self.frame { @@ -101,7 +104,7 @@ impl Widget for ImageButton<'_> { let padded_size = image_size + 2.0 * padding; let (rect, response) = ui.allocate_exact_size(padded_size, self.sense); response.widget_info(|| { - let mut info = WidgetInfo::new(WidgetType::ImageButton); + let mut info = WidgetInfo::new(WidgetType::Button); info.label = self.alt_text.clone(); info }); diff --git a/crates/egui/src/widgets/mod.rs b/crates/egui/src/widgets/mod.rs index 9cf003c9..9cdefb69 100644 --- a/crates/egui/src/widgets/mod.rs +++ b/crates/egui/src/widgets/mod.rs @@ -24,6 +24,7 @@ pub mod text_edit; #[expect(deprecated)] pub use self::selected_label::SelectableLabel; +#[expect(deprecated, reason = "Deprecated in egui 0.33.0")] pub use self::{ button::Button, checkbox::Checkbox,