refact: minor fixes (#971)

* Fix unused float handle mouse function, pub mod appstate

Fix unnecessary usage of pub mod for appstate and resolve unused float handle mouse function

* Resolve clippy warnings

Remove explicit lifetime for floatcontent impl. Use div_ceil instead of manually calculating the rows for hints
This commit is contained in:
Jeevitha Kannan K S 2025-01-10 11:25:39 +05:30 committed by GitHub
parent f67766b174
commit 06c9a4168e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,7 @@ impl<'a> FloatingText<'a> {
}
}
impl<'a> FloatContent for FloatingText<'a> {
impl FloatContent for FloatingText<'_> {
fn draw(&mut self, frame: &mut Frame, area: Rect, _theme: &Theme) {
let block = Block::default()
.borders(Borders::ALL)

View File

@ -36,7 +36,7 @@ pub fn create_shortcut_list(
.unwrap_or(0);
let columns = (render_width as usize / (max_shortcut_width + 4)).max(1);
let rows = (shortcut_spans.len() + columns - 1) / columns;
let rows = shortcut_spans.len().div_ceil(columns);
let mut lines: Vec<Line<'static>> = Vec::with_capacity(rows);

View File

@ -5,7 +5,7 @@ mod floating_text;
mod hint;
mod root;
mod running_command;
pub mod state;
mod state;
mod theme;
#[cfg(feature = "tips")]

View File

@ -480,7 +480,7 @@ impl AppState {
}
match &mut self.focus {
Focus::FloatingWindow(float) => {
float.content.handle_mouse_event(event);
float.handle_mouse_event(event);
}
Focus::ConfirmationPrompt(confirm) => {
confirm.content.handle_mouse_event(event);