Commit Graph
9 Commits
Author SHA1 Message Date
cnmcdee 5b0c6f02fd Single-placement mode + code-view sync on placement
Task 1: placing a widget now disarms placement mode — the next canvas
click places nothing until another palette widget is selected. Escape
and clicking the selected palette row again also cancel an armed
placement. Previously pending_kind persisted across placements, so
every click placed another fresh widget.

Task 2: placing a widget refreshes the Code window at once
(Lazarus-style) via a new CanvasState.on_placed hook wired to
Application.refresh_code_view(), so the generated code shows the new
widget without pressing Generate.

Tests: replaced test_pending_kind_persists_across_placements with
test_pending_kind_disarms_after_one_placement, plus
test_escape_cancels_pending_kind and
test_on_placed_fires_after_canvas_click_placement (280 tests pass).

Verified live under Xvfb (p-place-verify.sh + screenshots): place-once,
Escape-cancel, toggle-cancel, re-arm, code sync, clean app log.
2026-12-02 03:15:36 +00:00
cnmcdee 6eabe93b65 Phase 7 fix A+B: debugger labels above their panes; Inspector geometry refresh on programmatic resize
Fix A: the Breakpoints label sat below the breakpoint list, directly
above the Output label, and the two read as one cramped/overlapping
block at the bottom-left of the debugger window. It now sits above
its list (like Locals in the right pane) and the Output label has
6px top/start margins so it cannot crowd the middle pane.

Fix B: the Inspector only rebuilt on selection change, so a
programmatic resize (set_prop/resize_to/set_bounds) left the
geometry spins stale until the next selection, while canvas and
status bar already showed the new size. CanvasState now fires
on_bounds_change when the selected widget bounds move under the
same selection; the Inspector answers with refresh_geometry(),
which syncs just the four spins in place (no rebuild, no focus
loss). Handle drags fire the same hook, so drags keep working
and now track live.
2026-12-01 04:08:20 +00:00
cnmcdee b6702c381e Phase 5: pdb step debugger (session + UI) + Install Libraries
- lightgui/debugger.py: PdbSession driving python3 -m pdb in a
  subprocess (start/run/restart, break/enable/disable/clear,
  continue, step into/over/out, stack, locals, watches, stop).
  State machine idle/running/stopped/exited; stop kills the whole
  process group (SIGTERM then SIGKILL) so Stop can never hang on a
  GUI app; Run from Stopped/Exited restarts with the current target
  and re-applies breakpoints; no temp breakpoints (stop-on-entry
  uses pdb's natural first stop, break-on-main is persistent).
- lightgui/debugger_ui.py: debugger window mirroring the C layout
  (toolbar, Target row, status, breakpoints left, locals/watches/
  stack right, output console). Breakpoint pane 420px / 320px
  location column; in-place row updates + id-based selection
  restore; checkbox toggles apply to the session first; watch and
  locals trees have search disabled (no search popup on click).
- lightgui/install_libs.py: Install Libraries flow (package to
  system site-packages, launcher to /usr/local/bin, .desktop to
  /usr/local/share/applications); pkexec first, sudo -S fallback
  with an Enter-submits password dialog; dry-run plan shown in the
  dialog. pkexec is not installed on the server (same honest limit
  as the C/Rust fix).
- app.py: Debug menu (Start Debugging, Toggle Breakpoint, Step
  Into/Over/Out, Continue, Stop) + Tools > Install Libraries;
  debugger stop scrolls the Code window to the stopped line.
- tests: 38 new tests (debugger session incl. breakpoint hit,
  step over/into/out, locals, watches, continue to end, stop
  kills the debuggee, restart from Exited, enable/disable;
  install dry-run command construction/file list/paths).
  Full suite: 239 tests pass.
2026-12-01 03:25:40 +00:00
cnmcdee c22ff1059f Phase 4: app-level tests; fix tab-label GTK critical + Gdk version warning 2026-12-01 03:15:00 +00:00
cnmcdee b2ea94c30d Phase 4: menus in Code window + File/View/Help wiring, dirty tracking, Generate/Build/Run 2026-12-01 03:12:14 +00:00
cnmcdee 0cd61a3578 Phase 3: Object Inspector window + properties + font picker + bulk parameter
Inspector in its own window (LightGUI - Object Inspector, ~340px),
opened on startup beside the designer; closing hides it, palette
pane button reopens it. Scrolled grid: geometry spins, generic set,
custom props, Events group (OnClick etc. as editable text props,
stored as Event=handler in signals). Rows hexpand to fill the panel
width (b96e545/29751be fix); model-only rows flagged with *. Editors
by type: entry, spin -/+, checkbox, enum dropdown, colour entry +
Pick button, font-name entry + Pick button opening a
Gtk.FontChooserDialog (55daf32/6a7c4c7). Live-apply via set_prop.
Selection tracking via CanvasState.on_selection_change (fires only
when the selection moves, so typing never rebuilds the grid).
Bulk parameter (Set all / selected / filtered / Clear param) and
16-swatch colour palette (selected widget, or window background).
Canvas now paints project.background so a root swatch is visible.
Tests: 144 total, all pass under Xvfb.
2026-12-01 02:51:36 +00:00
cnmcdee ff1cadbd80 Phase 1 fixes: import cairo for the draw signal, Gdk version, hint wrap
- canvas.py imports cairo so the draw signal marshalling works
  (needs python3-gi-cairo on the server; installed 3.56.2-1)
- app.py: gi.require_version Gdk + hint label wraps in the palette pane
- README: python3-gi-cairo is a required package
2026-12-01 02:28:36 +00:00
cnmcdee cef7988a84 Phase 1: XFrame core + canvas + palette data + project model
- xframe/core.py: Widget base, 14 archetype draw classes (Cairo),
  registry over all 547 kinds; 13px handles, 8px grab pad, 450ms
  double-click, 8px drag threshold, 24x16 resize floor (C/Rust)
- xframe/canvas.py: CanvasState state machine (display-free, tested)
  + Gtk.DrawingArea shell; placement, selection, double-click
  handles, drag, handle resize, Delete/Escape, viewport tracking
- xframe/palette.py: generated from Rust registry_gen.rs, cross-checked
  vs C xframe_palette.h; 547 entries in 11 sections + 36 legacy
  model.h type keys as LEGACY_TYPES (583 total in the Rust data file)
- model.py: Project + .fdj save/load byte-compatible with the C writer
- app.py: main window with filterable palette list + canvas + status bar
- tests/: 62 stdlib unittest tests
2026-12-01 02:23:54 +00:00
cnmcdee e2ee6f8bc3 Phase 0 skeleton: PyGObject/GTK IDE chrome, XFrame-native canvas (Python port) 2026-12-01 02:16:44 +00:00