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 tools/hf fails if it misses one.
Modules§
- pointer
- Where the pointer last was, for opening a menu at it: iced’s
on_right_presssays that a press happened and not where.
Structs§
- Anchored
base, withbelowhung from its bottom edge when there is one.- Clamped
Text - See
clamped_text. - Drag
Card - 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.
- Wheel
Zoom 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_rowis saying about its thing. - Drop
Look - How a drop target is drawn.
- MenuRow
- One row of a menu.
- Segment
Look - 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.
- MENU_
SEPARATOR - A separator’s whole slot, the line centred in it, at 100%.
- MENU_
WIDTH - Wide enough for Files’ longest label beside its shortcut — “Open in New Tab” and “Ctrl+Enter” — at 100%.
- 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.
- SPLIT_
HANDLE_ WIDTH - How wide the grabbable strip is. The line stays one pixel; a strip that narrow is a target nobody can hit, and one much wider eats into both panes.
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, intint. - clamp
text’s content, or the longest prefix of it that fits inlineslines withELLIPSISafter it. Generic over the paragraph so a test can measure with a real one and no window.- clamped_
text content, at mostlineslines tall, cut with “…” when it would be taller.usize::MAXlines 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).
- context_
menu - The menu itself: the floating list’s surface (
sidebar, a 1pxcard_border,inner_radius), one row per item.highlightedis the row the keyboard is on, lit the way the pointer lights one. - countdown_
ring - A ring of side
sidewithleftoftotalstill to go, the rest drawn empty, andleftwritten 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,
liftof the way picked up:0.0lying flat and invisible,1.0held. Picking up and letting go both pass through the values between, which is the whole of the animation — the caller easesliftover 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
yover a viewport spanningtop..bottom: nothing in the middle, up toSPEEDat and past either edge, proportionally withinEDGEof it. - fact
fact_rowfor 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_linefor 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
- menu_
item_ style - A menu item’s look.
- menu_
overlay - A menu over the whole window, opened at
at(window coordinates). - menu_
padding - The space inside a menu’s border.
- menu_
separator_ height - A separator’s slot at this scale.
- menu_
size - A menu’s
(width, height)before it is drawn, from what each row is. Takes only whether each row is a separator, so a caller with its own row type can ask without building the rows first. - meta_
text - Dim, secondary-emphasis text — timestamps, hints, IDs. Distinct from
scaled_textalone 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.
- place_
menu - Where a menu’s top-left corner goes, given where it was asked for, its own size and the window’s.
- 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:rsin its search field: the label in the mono font, and a × that sendson_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, soFontScale(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_heighton thecontentthey 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_GAPapart. - 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
indexin 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 titlein capitals with a thin space between the letters.- split_
handle - The divider, draggable:
on_pressstarts a drag (the host follows the pointer until the button is let go, and askssplit_ratiowhere it is),on_resetis a double click, which puts the halves back even. - split_
ratio - Where a divider dragged to
xin awidth-wide area leaves it, as the left pane’s share — never so far that either pane is narrower thanmin_side. An area too narrow for two of those splits evenly, the one answer that favours neither. - 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.
headingis a dim line above the rows — Files puts the resolution there,~/pr/hy → ~/projects/hyprsuite.emptyis what it says when there are no rows;Nonedraws 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_fieldholding finished tokens ahead of the text — Files’ext:rsandmodified:<7dchips, each asuper::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 = falseselects 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 dividerstanding 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