feat: use typographySettingsStore everywhere for the typography settings

This commit is contained in:
Ilia Mashkov
2026-04-16 08:44:49 +03:00
parent fbeb84270b
commit 8645c7dcc8
9 changed files with 82 additions and 87 deletions
@@ -14,7 +14,7 @@ import {
import { FontSampler } from '$features/DisplayFont';
import {
TypographyMenu,
controlManager,
typographySettingsStore,
} from '$features/SetupFont';
import { throttle } from '$shared/lib/utils';
import { Skeleton } from '$shared/ui';
@@ -60,11 +60,11 @@ const checkPosition = throttle(() => {
const fontRowHeight = $derived.by(() =>
createFontRowSizeResolver({
getFonts: () => fontStore.fonts,
getWeight: () => controlManager.weight,
getWeight: () => typographySettingsStore.weight,
getPreviewText: () => text,
getContainerWidth: () => containerWidth,
getFontSizePx: () => controlManager.renderedSize,
getLineHeightPx: () => controlManager.height * controlManager.renderedSize,
getFontSizePx: () => typographySettingsStore.renderedSize,
getLineHeightPx: () => typographySettingsStore.height * typographySettingsStore.renderedSize,
getStatus: key => appliedFontsManager.statuses.get(key),
contentHorizontalPadding: SAMPLER_CONTENT_PADDING_X,
chromeHeight: SAMPLER_CHROME_HEIGHT,
@@ -97,7 +97,7 @@ const fontRowHeight = $derived.by(() =>
<FontVirtualList
itemHeight={fontRowHeight}
useWindowScroll={true}
weight={controlManager.weight}
weight={typographySettingsStore.weight}
columns={layoutManager.columns}
gap={layoutManager.gap}
{skeleton}