Skip to content

74: Layout: in-place element editing + snap-to-grid + UX polish#75

Merged
meduzapat merged 1 commit into
developmentfrom
task_74-Layout-in-place_elemen
Jun 13, 2026
Merged

74: Layout: in-place element editing + snap-to-grid + UX polish#75
meduzapat merged 1 commit into
developmentfrom
task_74-Layout-in-place_elemen

Conversation

@meduzapat

Copy link
Copy Markdown
Owner

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().
  • 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.

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.
@meduzapat meduzapat self-assigned this Jun 13, 2026
@meduzapat meduzapat merged commit a581091 into development Jun 13, 2026
1 check passed
@meduzapat meduzapat deleted the task_74-Layout-in-place_elemen branch June 22, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant