From 2b9595ee3c5eae01ab7c7b0c48f7ad3787ac4dff Mon Sep 17 00:00:00 2001 From: Addis Webb <48153815+addiswebb@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:36:29 +0300 Subject: [PATCH] Add `TableRow::set_hovered` (#4820) I added a util function `set_hovered` to change the hovered state of a row from tables in `egui_extras` which matches the already present `set_selected` function. * [x] I have followed the instructions in the PR template --- crates/egui_extras/src/table.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/egui_extras/src/table.rs b/crates/egui_extras/src/table.rs index b09a477bce5..eb3cc7def3f 100644 --- a/crates/egui_extras/src/table.rs +++ b/crates/egui_extras/src/table.rs @@ -1256,6 +1256,12 @@ impl<'a, 'b> TableRow<'a, 'b> { self.selected = selected; } + /// Set the hovered highlight state for cells added after a call to this function. + #[inline] + pub fn set_hovered(&mut self, hovered: bool) { + self.hovered = hovered; + } + /// Returns a union of the [`Response`]s of the cells added to the row up to this point. /// /// You need to add at least one row to the table before calling this function.