- ide/ui/js/form-designer.js: palette, canvas drawn like JumPHP\Gui (rows, columns, 12-column grid with spans per screen width, stack, panels, spacers), desktop / laptop / tablet / iPhone / Android sizes, a resizable desktop window, layers, inspector (widget, children, size and place, columns per breakpoint, hidden on, events), undo / redo, drag and drop; a double click wires the widget's first event: the method is added to the form's class and opened; @property lines kept in step with the ids. *.form.yaml open in Design view (Code / Split too) - the form travels as a JSON string (Tauri's bridge sorts objects' keys) - engine: a row too wide gives the room back from its supple children; touch: false honoured by phones and the web page; view: window in the browser (the canvas is the page, no start overlay, no double click fullscreen) - docs/gui.md, AGENTS.md section 17 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X3cUrsDZg7JngzTEgWW6Nj
52 lines
2.3 KiB
YAML
52 lines
2.3 KiB
YAML
# The main window, made with the IDE's visual editor (open this file there: Design). The code behind it is
|
|
# src/Form/MainForm.php: `events` name its methods (a double click on a widget in the editor writes them).
|
|
form:
|
|
title: Contacts
|
|
theme: light
|
|
layout: column
|
|
padding: 20
|
|
gap: 16
|
|
children:
|
|
- type: row
|
|
gap: 12
|
|
children:
|
|
- {type: image, id: logo, src: assets/images/logo.png, width: 40, height: 40}
|
|
- type: column
|
|
gap: 0
|
|
children:
|
|
- {type: label, id: heading, text: Contacts, style: title}
|
|
- {type: label, id: subtitle, text: 'A graphic app in PHP: no HTML, the same on a PC, a Mac, a phone and the web.', style: muted, hide: [xs]}
|
|
- {type: spacer}
|
|
- {type: checkbox, id: dark, text: Dark, events: {change: onDarkChange}}
|
|
- type: grid
|
|
gap: 16
|
|
height: fill
|
|
children:
|
|
- type: panel
|
|
id: editor
|
|
title: 'New contact'
|
|
span: {xs: 12, md: 5}
|
|
gap: 12
|
|
children:
|
|
- {type: label, text: Name}
|
|
- {type: textbox, id: name, placeholder: 'Ada Lovelace', events: {submit: onNameSubmit}}
|
|
- {type: label, text: E-mail}
|
|
- {type: textbox, id: email, placeholder: [email protected]}
|
|
- {type: label, text: Country}
|
|
- {type: combobox, id: country, items: [France, Belgium, Switzerland, Canada, Other], selected: 0}
|
|
- {type: checkbox, id: newsletter, text: 'Send the newsletter', checked: true}
|
|
- type: row
|
|
children:
|
|
- {type: button, id: add, text: Add, style: primary, default: true, events: {click: onAddClick}}
|
|
- {type: button, id: clear, text: Clear, style: flat, events: {click: onClearClick}}
|
|
- type: panel
|
|
id: people
|
|
title: Contacts
|
|
span: {xs: 12, md: 7}
|
|
height: fill
|
|
children:
|
|
- {type: listbox, id: list, height: fill, minHeight: 160, events: {change: onListChange, activate: onListActivate}}
|
|
- type: row
|
|
children:
|
|
- {type: label, id: status, text: 'No contact yet', style: muted, grow: 1}
|
|
- {type: button, id: remove, text: Remove, style: danger, enabled: false, events: {click: onRemoveClick}}
|