dave: fix sidebar click

Fixes: #837
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-05-01 19:54:02 -07:00
parent 514e5748b8
commit 3eb9e30e8f
2 changed files with 5 additions and 2 deletions

View File

@@ -279,7 +279,8 @@ impl Chrome {
} }
if ui.add(expand_side_panel_button()).clicked() { if ui.add(expand_side_panel_button()).clicked() {
self.active = (self.active + 1) % (self.apps.len() as i32); //self.active = (self.active + 1) % (self.apps.len() as i32);
// TODO: collapse sidebar ?
} }
ui.add_space(4.0); ui.add_space(4.0);

View File

@@ -316,7 +316,7 @@ impl DaveAvatar {
} }
pub fn render(&mut self, rect: Rect, ui: &mut egui::Ui) -> Response { pub fn render(&mut self, rect: Rect, ui: &mut egui::Ui) -> Response {
let response = ui.allocate_rect(rect, egui::Sense::drag()); let response = ui.allocate_rect(rect, egui::Sense::CLICK | egui::Sense::DRAG);
// Update rotation based on drag or animation // Update rotation based on drag or animation
if response.dragged() { if response.dragged() {
@@ -330,6 +330,8 @@ impl DaveAvatar {
// Apply rotations (order matters) // Apply rotations (order matters)
self.rotation = y_rotation.multiply(&x_rotation).multiply(&self.rotation); self.rotation = y_rotation.multiply(&x_rotation).multiply(&self.rotation);
} else if response.clicked() {
self.random_nudge();
} else { } else {
// Continuous rotation - reduced speed and simplified axis // Continuous rotation - reduced speed and simplified axis
let friction = 0.95; let friction = 0.95;