make clippy happy

This commit is contained in:
William Casarin
2025-07-31 11:55:39 -07:00
parent a896a6ecfa
commit a8c6baeacb
5 changed files with 31 additions and 19 deletions

View File

@@ -1,8 +1,6 @@
use crate::NotedeckTextStyle;
pub const NARROW_SCREEN_WIDTH: f32 = 550.0;
/// Determine if the screen is narrow. This is useful for detecting mobile
/// contexts, but with the nuance that we may also have a wide android tablet.
pub fn richtext_small<S>(text: S) -> egui::RichText
where
@@ -11,6 +9,8 @@ where
egui::RichText::new(text).text_style(NotedeckTextStyle::Small.text_style())
}
/// Determine if the screen is narrow. This is useful for detecting mobile
/// contexts, but with the nuance that we may also have a wide android tablet.
pub fn is_narrow(ctx: &egui::Context) -> bool {
let screen_size = ctx.input(|c| c.screen_rect().size());
screen_size.x < NARROW_SCREEN_WIDTH