egui/crates
Antoine Beyeler 26206526d6
Hide toolip when opening `ComboBox` drop-down (#4546)
- Fixes #4338


https://github.com/emilk/egui/assets/49431240/73ea87a1-41ad-40b1-b451-d6be2b38c7e0



Tested using `example/hello_world` modified to:
```rust
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
#![allow(rustdoc::missing_crate_level_docs)] // it's an example

use eframe::egui;

fn main() -> Result<(), eframe::Error> {
    env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
        ..Default::default()
    };
    eframe::run_native(
        "My egui App",
        options,
        Box::new(|cc| {
            // This gives us image support:
            egui_extras::install_image_loaders(&cc.egui_ctx);

            Box::<MyApp>::default()
        }),
    )
}

struct MyApp {
    name: String,
    age: u32,
}

impl Default for MyApp {
    fn default() -> Self {
        Self {
            name: "Arthur".to_owned(),
            age: 42,
        }
    }
}

impl eframe::App for MyApp {
    fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
        egui::CentralPanel::default().show(ctx, |ui| {
            ui.heading("My egui Application");
            egui::ComboBox::new("combo", "combo box")
                .selected_text(&self.name)
                .show_ui(ui, |ui| {
                    ui.selectable_value(&mut self.name, "Arthur".into(), "Arthur")
                        .on_hover_text("This is Arthur");
                    ui.selectable_value(&mut self.name, "Ford".into(), "Ford")
                        .on_hover_text("This is Ford");
                    ui.selectable_value(&mut self.name, "Trillian".into(), "Trillian")
                        .on_hover_text("This is Trillian");
                })
                .response
                .on_hover_text("This is a combo box");
        });
    }
}
```

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-05-28 14:17:37 +02:00
..
ecolor Move dependencies to workspace (#4495) 2024-05-14 11:02:49 +02:00
eframe Fix: Don't `.forget()` RAF closure (#4551) 2024-05-27 21:55:23 +02:00
egui Hide toolip when opening `ComboBox` drop-down (#4546) 2024-05-28 14:17:37 +02:00
egui-wgpu Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui-winit Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_demo_app Add support for text truncation to `egui::Style` (#4556) 2024-05-28 13:10:41 +02:00
egui_demo_lib Add support for text truncation to `egui::Style` (#4556) 2024-05-28 13:10:41 +02:00
egui_extras Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_glow Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_plot Add support for text truncation to `egui::Style` (#4556) 2024-05-28 13:10:41 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Move dependencies to workspace (#4495) 2024-05-14 11:02:49 +02:00
epaint Add support for text truncation to `egui::Style` (#4556) 2024-05-28 13:10:41 +02:00