style: set 0 duration tooltip delay
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::app_style::{create_text_styles, dark_mode, desktop_font_size, mobile_font_size};
|
||||
use crate::app_style::{create_custom_style, dark_mode, desktop_font_size, mobile_font_size};
|
||||
use crate::fonts::setup_fonts;
|
||||
use crate::ui::is_mobile;
|
||||
use eframe::NativeOptions;
|
||||
@@ -47,8 +47,8 @@ pub fn setup_cc(cc: &eframe::CreationContext<'_>) {
|
||||
ctx.set_visuals(dark_mode(is_mobile(ctx)));
|
||||
|
||||
ctx.set_style(if is_mobile(ctx) {
|
||||
create_text_styles(ctx, mobile_font_size)
|
||||
create_custom_style(ctx, mobile_font_size)
|
||||
} else {
|
||||
create_text_styles(ctx, desktop_font_size)
|
||||
create_custom_style(ctx, desktop_font_size)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::colors::{
|
||||
};
|
||||
use egui::{
|
||||
epaint::Shadow,
|
||||
style::{Selection, WidgetVisuals, Widgets},
|
||||
style::{Interaction, Selection, WidgetVisuals, Widgets},
|
||||
Button, Context, FontFamily, FontId, Rounding, Stroke, Style, TextStyle, Ui, Visuals,
|
||||
};
|
||||
use strum::IntoEnumIterator;
|
||||
@@ -50,7 +50,7 @@ pub fn user_requested_visuals_change(
|
||||
}
|
||||
|
||||
/// Create custom text sizes for any FontSizes
|
||||
pub fn create_text_styles(ctx: &Context, font_size: fn(&NotedeckTextStyle) -> f32) -> Style {
|
||||
pub fn create_custom_style(ctx: &Context, font_size: fn(&NotedeckTextStyle) -> f32) -> Style {
|
||||
let mut style = (*ctx.style()).clone();
|
||||
|
||||
style.text_styles = NotedeckTextStyle::iter()
|
||||
@@ -62,6 +62,11 @@ pub fn create_text_styles(ctx: &Context, font_size: fn(&NotedeckTextStyle) -> f3
|
||||
})
|
||||
.collect();
|
||||
|
||||
style.interaction = Interaction {
|
||||
tooltip_delay: 0.0,
|
||||
..Interaction::default()
|
||||
};
|
||||
|
||||
style
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user