mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-01-30 22:34:27 +00:00
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:
parent
f67766b174
commit
06c9a4168e
|
@ -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) {
|
fn draw(&mut self, frame: &mut Frame, area: Rect, _theme: &Theme) {
|
||||||
let block = Block::default()
|
let block = Block::default()
|
||||||
.borders(Borders::ALL)
|
.borders(Borders::ALL)
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub fn create_shortcut_list(
|
||||||
.unwrap_or(0);
|
.unwrap_or(0);
|
||||||
|
|
||||||
let columns = (render_width as usize / (max_shortcut_width + 4)).max(1);
|
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);
|
let mut lines: Vec<Line<'static>> = Vec::with_capacity(rows);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ mod floating_text;
|
||||||
mod hint;
|
mod hint;
|
||||||
mod root;
|
mod root;
|
||||||
mod running_command;
|
mod running_command;
|
||||||
pub mod state;
|
mod state;
|
||||||
mod theme;
|
mod theme;
|
||||||
|
|
||||||
#[cfg(feature = "tips")]
|
#[cfg(feature = "tips")]
|
||||||
|
|
|
@ -480,7 +480,7 @@ impl AppState {
|
||||||
}
|
}
|
||||||
match &mut self.focus {
|
match &mut self.focus {
|
||||||
Focus::FloatingWindow(float) => {
|
Focus::FloatingWindow(float) => {
|
||||||
float.content.handle_mouse_event(event);
|
float.handle_mouse_event(event);
|
||||||
}
|
}
|
||||||
Focus::ConfirmationPrompt(confirm) => {
|
Focus::ConfirmationPrompt(confirm) => {
|
||||||
confirm.content.handle_mouse_event(event);
|
confirm.content.handle_mouse_event(event);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user