mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Multiple mouse button support (#135)
Add support for primary, secondary and middle mouse buttons. Also improve ability to click things in low FPS situations.
This introduces a lot of breaking changes:
Backends/integrations now pass mouse events via the even stream.
Response has an interface of mostly methods instead of public members.
input.mouse is now input.pointer and has new interface.
* Rename 'mouse' to 'pointer' everywhere (pointer = mouse or touch)
* Make Response::clicked and Response::double_clicked into methods
* Remove Response::active and add dragged() and interact_pointer_pos()
* Support multiple mouse buttons
* Make PointerState interface all methods
* Make most members of Response private
This commit is contained in:
@@ -31,7 +31,7 @@ impl FontBook {
|
||||
ui.label(format!("{}\nU+{:X}\n\nClick to copy", name, chr as u32));
|
||||
};
|
||||
|
||||
if ui.add(button).on_hover_ui(tooltip_ui).clicked {
|
||||
if ui.add(button).on_hover_ui(tooltip_ui).clicked() {
|
||||
ui.output().copied_text = chr.to_string();
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ impl super::View for FontBook {
|
||||
ui.label("Filter:");
|
||||
ui.text_edit_singleline(&mut self.filter);
|
||||
self.filter = self.filter.to_lowercase();
|
||||
if ui.button("x").clicked {
|
||||
if ui.button("x").clicked() {
|
||||
self.filter.clear();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user