fontlabapp.contours.panel.model
model
Shared panel base and colour helpers of the outline writer scripts.
What: panel_type() returns OutlinePanel, the non-modal PythonQt
panel of the Contours writer scripts: script controls, the master scope, a
"Keep masters compatible" tick for scripts that change the node structure,
a consent tick for bases of automatic composites, a live preview table,
Reload selection, Close and Apply. ink, muted and
readable_palette give readable text colours in FontLab's light and dark
themes. ERROR_COLOR colours blocked rows; MAX_ROWS limits the
preview rows. The helpers are the same objects as in
fontlabapp.anchors.panel.model.
How: the panel plans with fontlabapp.contours.writer.collect on every
control change. Apply plans again from live data, scans the auto-layer
facts again and writes with outline_writer.apply_work and the script's
editor() (one Undo step). A new scan clears the consent tick, because
the consent belongs to the glyphs that the user saw. Signals connect
through scripting.connect_guarded and disconnect in closeEvent.
Why: each script then holds only its own logic, a small panel subclass and
main. OutlinePanel is its own class, not a subclass of
fontlabapp.components.panel.model's ComponentPanel: the scope, the ticks,
the per-glyph refusal, the error display of Apply and the status texts
differ, so a subclass would replace almost every method. This module
imports only stdlib-only App modules at load time; PythonQt loads inside
the functions, and panel_type() loads the class from
fontlabapp.contours.panel.ui. So FontLab's 5-second cold import stays
fast, and tests without Qt can import it. Offline tests do not prove
native panel behaviour.
How to use (a script)::
import fly.ap.contours.panel.model as outline_panel
import fly.ap.contours.writer as outline_writer
class RoundCoordinates(outline_panel.panel_type()):
TITLE, KEY, ACTION, DONE, UNIT = "Round Coordinates", "outlines_round", "Round", "Rounded", "item"
def build_controls(self): ...
def planner(self): ...
def editor(self): ...
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
HOOKS |
attribute | ||
MEMBERS |
attribute | ||
NOT_STORED |
attribute | ||
UNDO_HINT |
attribute | ||
panel_type |
function | () -> type |
Return the <code>OutlinePanel</code><code> base class (a PythonQt </code><code>QDialog</code>). |