mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-26 04:58:07 +00:00
Match the home display type size
This commit is contained in:
@@ -507,12 +507,20 @@ impl PdfCraftApp {
|
||||
/// The app's root values for this frame: appearance mode, motion, interface scale and the
|
||||
/// interface language's direction. The one place the app's `RootEnv` is built.
|
||||
pub(crate) fn root_env(&self, ctx: &egui::Context) -> RootEnv {
|
||||
static SIZES: std::sync::OnceLock<Arc<craft::theme::AppSizes>> = std::sync::OnceLock::new();
|
||||
let sizes = SIZES.get_or_init(|| {
|
||||
let mut sizes = craft::theme::AppSizes::default();
|
||||
sizes.all.insert("typography.display.size".into(), craft::theme::SizeValue::Number(24.0));
|
||||
sizes.all.insert("typography.display.line_height".into(), craft::theme::SizeValue::Number(29.0));
|
||||
Arc::new(sizes)
|
||||
});
|
||||
let lang = i18n::Lang::from_pref(&self.language);
|
||||
let direction = if lang.rtl() { craft_i18n::Direction::Rtl } else { craft_i18n::Direction::Ltr };
|
||||
let system = craft::ui::runtime::env::system_text_scale(ctx).unwrap_or(1.0);
|
||||
let native = ctx.native_pixels_per_point().unwrap_or(1.0);
|
||||
let mut root =
|
||||
RootEnv::new().mode(self.theme_preference).density(craft::theme::Size::Comfortable).direction(direction).scale(Scale::new(crate::ui_scale::zoom(self.ui_scale, system, native)));
|
||||
root.sizes = Arc::clone(sizes);
|
||||
root.motion = self.animation_effects;
|
||||
// Today is the session's day, the one its date formats and Fill & Sign's Date tool use: the calendars ring it
|
||||
// and pick it.
|
||||
|
||||
Reference in New Issue
Block a user