74: Layout: in-place element editing + snap-to-grid + UX polish#75
Merged
Conversation
Task-Url: #74 - Each tile carries a pencil button (visible while active) that opens the standard Element dialog with the device context preloaded. - `DialogDevice::editChild` runs the device dialog's population pipeline silently (no run, no save) so the child dialog inherits a fresh, fully-wired state; the device dialog itself is never shown. - Resolution of the device and element BoxButtons is a single linear scan of the navigator's devices collection — no observer changes, no back-pointers added to data. - Tile icon split into a passive `Gtk::Image` (inactive) and a `Gtk::ToggleButton` (active). The toggle is the fire button; the light timer untoggles it on expiry, so rapid clicks can't bypass `lightLocked`. - Pixbufs cached per element type — each icon is loaded from disk once. - Press on a tile is consumed locally; clicks on the empty board deselect the current tile. - DialogElement falls back to the main window as transient parent when the device dialog is hidden, keeping the dialog centered. - New "Layout" page in Settings with a single grid-step scale (0–100, snaps to multiples of 10, default 0 = disabled). - `LayoutElement::onMotion` applies a magnetic snap to the configured step; free movement when the user is more than `step/3` from a gridline, snap once inside. - New `LayoutBoard` (`Gtk::Layout` subclass) paints faint gridlines beneath the tiles and redraws live as the slider moves via a `Settings::onLayoutGridChanged` callback. - The toggle-button styling for LED colors is now scoped with `:not(.layout-element-icon)` so the icon toggle gets its colored border/background from `.layout-element-icon-fired.led-X`, which covers all seven colors (R, G, B, Y, M, C, W). Previously Y/M/C/W fell through to default GTK styling and the toggle changed size on state changes. address code review — hygiene and dead-code cleanup - LayoutElement: fix onLightExpired indentation; remove dead onLayoutIdle(); static_cast the guaranteed Gtk::Layout parent in onMotion and drop the commented-out null guard; restore the informative iconForType comment; drop stray leading blank lines added to build()/fire()/onMotion(). - StatusBar::initialize: drop stray leading blank line. - Layout::resolveButtons: document the trailing return as unreachable. - style-base.css: revert comment-style churn (boxed-asterisk header and reflowed blocks) back to the house style used in theme.css; keep the functional active-tile and :not(.layout-element-icon) changes. - Bring data/style.css in line with the house comment style used across data/ (file header, ── section dividers, em-dash minor notes); replace the boxed-asterisk Directory Navigator header. Comments only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task-Url: #74
Each tile carries a pencil button (visible while active) that opens the standard Element dialog with the device context preloaded.
DialogDevice::editChildruns the device dialog's population pipeline silently (no run, no save) so the child dialog inherits a fresh, fully-wired state; the device dialog itself is never shown.Resolution of the device and element BoxButtons is a single linear scan of the navigator's devices collection — no observer changes, no back-pointers added to data.
Tile icon split into a passive
Gtk::Image(inactive) and aGtk::ToggleButton(active). The toggle is the fire button; the light timer untoggles it on expiry, so rapid clicks can't bypasslightLocked.Pixbufs cached per element type — each icon is loaded from disk once.
Press on a tile is consumed locally; clicks on the empty board deselect the current tile.
DialogElement falls back to the main window as transient parent when the device dialog is hidden, keeping the dialog centered.
New "Layout" page in Settings with a single grid-step scale (0–100, snaps to multiples of 10, default 0 = disabled).
LayoutElement::onMotionapplies a magnetic snap to the configured step; free movement when the user is more thanstep/3from a gridline, snap once inside.New
LayoutBoard(Gtk::Layoutsubclass) paints faint gridlines beneath the tiles and redraws live as the slider moves via aSettings::onLayoutGridChangedcallback.The toggle-button styling for LED colors is now scoped with
:not(.layout-element-icon)so the icon toggle gets its colored border/background from.layout-element-icon-fired.led-X, which covers all seven colors (R, G, B, Y, M, C, W). Previously Y/M/C/W fell through to default GTK styling and the toggle changed size on state changes.address code review — hygiene and dead-code cleanup