Skip to content

Commit

Permalink
Replace use of ImageButton with normal Button
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Aug 28, 2024
1 parent 080cc8a commit d65b162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/viewer/re_ui/src/list_item/item_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl super::ItemButton for ItemMenuButton<'_> {
ui.add_enabled_ui(self.enabled, |ui| {
ui.spacing_mut().item_spacing = egui::Vec2::ZERO;

let mut response = egui::menu::menu_image_button(
let mut response = egui::menu::menu_custom_button(
ui,
ui.small_icon_button_widget(self.icon),
self.add_contents,
Expand Down
8 changes: 4 additions & 4 deletions crates/viewer/re_ui/src/ui_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ pub trait UiExt {
self.ui_mut().add(widget)
}

fn small_icon_button_widget<'a>(&self, icon: &'a Icon) -> egui::ImageButton<'a> {
fn small_icon_button_widget<'a>(&self, icon: &'a Icon) -> egui::Button<'a> {
// TODO(emilk): change color and size on hover
egui::ImageButton::new(
egui::Button::image(
icon.as_image()
.fit_to_exact_size(DesignTokens::small_icon_size()),
.fit_to_exact_size(DesignTokens::small_icon_size())
.tint(self.ui().visuals().widgets.inactive.fg_stroke.color),
)
.tint(self.ui().visuals().widgets.inactive.fg_stroke.color)
}

fn medium_icon_toggle_button(&mut self, icon: &Icon, selected: &mut bool) -> egui::Response {
Expand Down

0 comments on commit d65b162

Please sign in to comment.