Skip to main content

Module density

Module density 

Source
Expand description

Row/header/type-ramp sizing every Hyprforge app shares, derived from font metrics rather than copied out of a mockup as pixel constants.

Files’ design came first and moved here when Settings adopted the same one, so the two draw a row, a bar and a corner the same size. What only Files needs — the grid, its menus, its sidebar — stayed in hyprforge-files-core.

The design specifies a 40px header, 28px rows, a 15px type ramp and a 6px-inner/12px-outer radius pair — but those numbers are only true at the theme’s default text size and 100% FontScale. Pillar 7 puts font scaling in the shared layer for exactly this reason: a 28.0 literal for row height clips its own text the moment someone raises the scale past 1.0, because the text grows and the row does not. So every design pixel value here is stored as its ratio to BASE_TEXT_SIZE at identity scale.

Two different things come out of that ratio, deliberately kept apart:

At 100% the numbers below reproduce the design’s own values exactly (pinned in the tests); above 100% the row, the header and the text inside them grow together instead of the text alone overflowing a row that stayed put.

Radii take the same “ratio, not constant” shape but from hyprforge_look::Theme::rounding instead of text size: the design’s outer/inner pair is preserved as a relationship (inner is exactly half the outer) rather than as two independent magic numbers, so a user who changes Hyprland’s own decoration:rounding gets an inner radius that stays visibly tighter than the outer one instead of one that quietly drifts to match or overtake it.

Constants§

META_TEXT_BASE
The metadata text size inside a row — size, modified, kind — also unscaled. The design only names the 15px primary size; this keeps the 13/15 relationship the crate’s earlier hand-picked 13.0-vs-14.0 pairing already had, expressed as a ratio of the primary size instead of a second independent constant.
ROW_TEXT_BASE
The primary text size inside a row — a file’s name — unscaled: feed this straight to scaled_text/meta_text as the base_size argument, which applies FontScale itself, the same way every other call site feeds it BASE_TEXT_SIZE. It is already in the same “logical px before scale” unit BASE_TEXT_SIZE is, so no further division by it is needed — this constant is the design’s 15px type ramp at identity scale, not a ratio applied to something else.
SECTION_LABEL_BASE
A sidebar section heading — PLACES, PINNED, TRASH.

Functions§

bar_height
The header bar’s height. 44px at 100% scale.
card_radius
A card’s corner — a setting row, a hero card, a table row. The mockup’s 9px, and its most common radius by far.
field_height
A text field — the path bar, the search field. 28px at 100%.
glyph_button
A glyph button — the nav cluster, a view-mode segment. 26px at 100%.
inner_radius
A row’s/sidebar button’s corner radius — the design’s “6px inner”. See the module doc: this is deliberately half of outer_radius rather than its own constant.
nested_radius
The radius on something nested inside a control — the path bar’s current-directory chip, a segment inside the view-mode track.
outer_radius
The window’s own corner radius — the design’s “12px outer”. Taken straight from the active hyprforge_look::Theme rather than duplicated: Theme::rounding already is Hyprland’s own decoration:rounding, and it happens to default to 12, which is a measured fact about the default theme rather than a coincidence this function relies on.
row_height
A list row’s final height in logical pixels, FontScale already applied. 28.0 at FontScale::default; grows proportionally above 100%.
setting_row_height
A setting row’s least height — the design’s 52px card row at 100%.