Skip to main content

Module widgets

Module widgets 

Source
Expand description

Every widget the suite shares.

The functions in this file are the original set; the modules below arrived with the Settings redesign and Files’ path bar and are re-exported, so every widget is hyprforge_ui::widgets::<name> wherever it happens to live. DESIGN-SYSTEM.md beside this crate’s manifest catalogues all of them, and check.sh fails if it misses one.

Structs§

Anchored
base, with below hung from its bottom edge when there is one.
ClampedText
See clamped_text.
DragCard
What the card under the pointer says.
Marquee
content, with a rubber band drawn across empty space. See the module doc.
Suggestion
One row: what it is, and an optional dim note at its right edge.
WheelZoom
content, zoomed by Ctrl+wheel: on_zoom(1) for each step in (away from you, the way a page zooms in), on_zoom(-1) for each step out.

Enums§

Change
What a change_row is saying about its thing.
DropLook
How a drop target is drawn.
SegmentLook
What the lit segment of a segmented control means.
Tint
Which of the theme’s roles a mark, a chip or a hero card is drawn in.

Constants§

ELLIPSIS
What is put where the text was cut.
PIXELS_PER_STEP
How far a touchpad has to scroll, in logical pixels, to make one step.
SCRIM_ALPHA
How much of the window behind a scrim hides. Enough that the card is plainly what the keyboard and pointer are on, little enough that the window still reads as there.
SETTING_ROW_GAP
The gap between setting rows: the mockup’s 2px, which with the alternating fill is what makes a stack read as rows without a divider between each.

Functions§

anchored
band_rect
The rectangle between the anchor — moved by however far the content has scrolled since — and the pointer, in window coordinates.
change_row
One thing in a preview: what it is now on the left, what it would be on the right, and — when it cannot — the reason under the right-hand side in the error colour.
chip
A short fact about the row it sits in — WPA3, saved, captive portal, suite default — in the mono font, in tint.
clamp
text’s content, or the longest prefix of it that fits in lines lines with ELLIPSIS after it. Generic over the paragraph so a test can measure with a real one and no window.
clamped_text
content, at most lines lines tall, cut with “…” when it would be taller. usize::MAX lines is the whole text — the same widget for a name shown whole when selected, so selecting it does not change which widget draws it.
config_line
Text shown exactly as it is written in a config file — input:follow_mouse = 1, monitor=DP-1,2560x1440@165.
confirm_dialog
The standard “this is about to touch a file you own” confirmation dialog (vision pillar #4: nothing requires faith that a change worked — show the exact diff before writing).
countdown_ring
A ring of side side with left of total still to go, the rest drawn empty, and left written in its centre.
danger_button
A button styled for destructive/irreversible actions. Reserve for things that actually destroy data (Delete) — a plain Cancel/Close is secondary_button, not this.
divider
A thin separator between list rows inside a card — the visual grammar used everywhere Hyprforge shows a list of things (profiles, rules) so rows read as distinct items rather than one unbroken block of text.
drag_card
The card under the pointer, lift of the way picked up: 0.0 lying flat and invisible, 1.0 held. Picking up and letting go both pass through the values between, which is the whole of the animation — the caller eases lift over time and redraws.
drop_target_style
The style of a container that something can be dropped on.
dropdown_menu_style
An open dropdown’s list. The highlighted option is the selection colour, because it is the option you are about to select.
dropdown_style
A closed pick_list’s look: the inset field’s, so a dropdown beside a text field reads as the same kind of control.
edge_scroll
How far to scroll this frame for a pointer at y over a viewport spanning top..bottom: nothing in the middle, up to SPEED at and past either edge, proportionally within EDGE of it.
fact
fact_row for the common case of a plain value, wrapped by word — or by glyph, for a name with no spaces to break at.
fact_row
One fact about the thing a panel describes: a dim label on the left, at a fixed width so every value in the panel lines up, and the value beside it — Where ~/projects/hyprsuite/src.
hero_card
The card that leads a page with the one thing it is about — the network you are on, the battery’s charge.
hint_text
A dim second line under a row’s label — what the setting does, or the config line it writes (use config_line for the latter).
inset_field_style
The look every inset field shares: recessed into the bar, outlined.
inset_input_style
A free-standing text input’s look — a setting’s value, a filter — matching the inset fields and the dropdowns beside it, rather than iced’s stock input with its bright outline.
keycap
One key of a chord, as a cap: SUPER, SHIFT, ⏎.
marquee
meta_text
Dim, secondary-emphasis text — timestamps, hints, IDs. Distinct from scaled_text alone so “this is metadata, not content” is visible at a glance rather than relying on size difference only.
page_header
A page’s title, with a short mono line beside it saying what the page is talking to or what it found — NetworkManager, 2 connected · drag to arrange, 86 binds · 1 conflict.
panel_tabs
Tabs across the top of a panel: each a word, the selected one in the body colour over an accent underline, the rest dim.
pending_bar
The bar along the foot of a page that has changes nobody has applied yet: what they are, the setting they will write, and Discard/Apply.
pending_label
“N pending changes”, in words.
popover_card
The surface a popover is drawn on: a small panel that opens from a control and closes on a click anywhere else.
primary_button
The default action button — filled with the accent color. Use for the one primary action in a row or dialog (Apply, Save, Confirm).
progress_line
A thin bar across its width, filled to fraction (0 to 1).
progress_line_style
progress_line’s look, on its own so a test can hold it to the rule above.
remaining_fraction
The fraction of the ring still filled, clamped to the ring.
removable_chip
A token the user wrote and can take back — Files’ ext:rs in its search field: the label in the mono font, and a × that sends on_remove.
row_field
A label paired with its control, as a setting row.
scaled_text
text(content).size(scale.apply(base_size)) — the one place every piece of Hyprforge UI text should go through, so FontScale (vision pillar #7: accessibility built into the shared layer, not bolted on per-app) actually reaches the screen instead of being a struct nobody calls.
scrim
content, centred over a dim layer that fills whatever it is stacked over.
scrim_color
The dim layer’s colour: the window’s own root step, see-through — never an invented black, which would be a colour constant no theme can reach, and never the accent, which means selected.
search_field
A search field: a drawn magnifier ring and a transparent input inside an inset container, one field tall.
secondary_button
A quiet, outlined button for secondary actions (Rename, Cancel, Edit) — visible without competing with the primary action in the same row.
section
A titled group of content — the standard way every Hyprforge settings screen breaks itself into blocks (vision pillar #2). Sized to its content; callers that need scrolling should cap a max_height on the content they pass in rather than have the card stretch to fill whatever space happens to be available.
section_label
A group’s heading in a sidebar or above a stack of rows — PLACES, HYPRLAND, BORDERS & FOCUS.
segment_style
One segment’s look, for a button placed inside segmented.
segmented
The groove a row of segments sits in.
segmented_choice
A setting whose value is one of a few named options, shown all at once — the mockup’s Off | Always | Fullscreen.
selectable_row_style
A clickable row’s look: the accent when selected, a plain elevation step when merely hovered, nothing otherwise.
setting_list
A stack of setting_rows, SETTING_ROW_GAP apart.
setting_row
One setting: its label on the left (with an optional hint under it), its control on the right, on a card that is striped or clear by index.
setting_row_style
The fill of the row at index in a stack: every even row striped, every odd one clear.
slider_style
The track: accent up to the handle, border grey after it, and a light handle — the mockup’s rail.
spaced_caps
title in capitals with a thin space between the letters.
stacked_bar
One bar split into parts: where something went — CPU time by kind, memory by use, a disk by what fills it. Each part is a fraction of the whole and a colour from the theme’s roles (never the accent, which means selected); what the parts leave is the empty track.
status_dot
A small filled circle in tint — “connected”, “pending”, “muted”.
step_index
The list position a slider’s raw value means: the nearest one, never past either end.
stepped_slider
A slider over a list of values, where only the listed ones exist.
steps_from_pixels
Whole steps in pixels, and what is left over. Pure, so the touchpad arithmetic is tested without a window.
suggestions
The panel. heading is a dim line above the rows — Files puts the resolution there, ~/pr/hy → ~/projects/hyprsuite. empty is what it says when there are no rows; None draws nothing at all instead, which is right while the first answer is still being worked out.
toggle
An on/off switch — what every boolean setting is, rather than a checkbox.
toggle_style
The switch’s look: the accent when on, the border grey when off, a dark knob either way.
token_field
A search_field holding finished tokens ahead of the text — Files’ ext:rs and modified:<7d chips, each a super::removable_chip.
tri_state
A three-way “unset / true / false” selector, for the settings that have a real difference between “don’t care” and “explicitly false” — a window -rule matcher of floating = false selects tiled windows, which a plain checkbox can’t express separately from not matching on it at all.
value_slider
A slider with its value written beside it in the mono font.
vertical_divider
divider standing up: the same hairline in the same colour, between panes that sit side by side — Files’ column view draws one between each folder’s pane.
wheel_zoom