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>