typerig.proxy.gs3.gui.config
config
TypeRig Panel — UI configuration.
Single source of truth for every visual / layout / sizing parameter
in the GS3 plugin. There is exactly ONE place in the codebase where
a pixel value, a font point size, a gap, a padding, or a default
window dimension may be declared: this file, on the UI namespace.
WHY THIS FILE EXISTS
vanilla has no layout engine. Every widget is positioned by an
absolute (x, y, w, h) tuple, so size / gap / padding constants leak
into every panel module. Without discipline they drift: BTN = 28
in one file, BTN_W = 28 in another, an inline 4 somewhere else.
Bumping a button by one pixel then becomes a six-file grep. Vanilla
is a boilerplate nightmare compared to PyQt — the only way to keep
it under control is to centralise every magic number.
This module is that one place. Bump UI.BTN.SIZE here and every
panel, the masthead, and the configurator move in lockstep.
ORGANISATION
Fields are grouped under sub-namespaces by concern:
UI.BTN — buttons (size, icon point size)
UI.LAYOUT — universal spacing (gap, pad, margin, section title)
UI.ENTRY — Panel entry fields, one preset per kind (STYLE / W / H)
UI.SPN — numeric EditText dimensions (legacy: dialogs, IconAssist)
UI.LBL — single-char label column, label-to-field gap
UI.FORM — label + field grids, check boxes, text buttons
UI.LIST — table (vanilla.List) dimensions
UI.TINTLIST — colour-coded list: dots + row tint (gui/tint_list.py)
UI.TREE — foldable report tree (gui/tree_view.py)
UI.THUMB — outline thumbnails and the thumbnail grid (gui/thumbnail.py)
UI.STATUS — status / warning text block
UI.WIN — main window dimensions and minimums
UI.MASTHEAD — masthead band geometry
UI.ASSETS — asset filenames
All field names are ALL CAPS to mark them as compile-time constants.
THE RULES (these are not suggestions)
-
NO layout literal may appear in any
gui/,Panel/,main_panel.py, orconfigurator.pyfile. Sizes, gaps, paddings, row heights, font sizes, window dimensions — all live here as fields onUI.<GROUP>. -
If you need a new metric, add a field here FIRST, then import it. Never inline a number "just for now". Pick the right sub-namespace or add a new one — do not flatten into the wrong group.
-
New widgets register their tuning parameters here. A new slider widget adds
UI.SLIDER.H,UI.SLIDER.TRACK, etc. The widget reads fromUIinternally; callers never pass raw pixel sizes through the widget's API. -
New panels follow the same pattern: alias the fields you use at the top of the file, then use the short names in body code:
from gui.config import UI BTN = UI.BTN.SIZE GAP = UI.LAYOUT.GAP PAD = UI.LAYOUT.PAD TIT = UI.LAYOUT.TIT ... btn = IconButton((x, y, BTN, BTN), 'token', ...)
The aliases are local readability sugar; the values still live
in exactly one place. Do NOT redeclare BTN = 28 — that creates
the second source of truth this file exists to prevent.
- Sub-namespaces keep things browsable. If a group grows past ~8 fields, split it. If a field doesn't clearly belong to one of the existing groups, add a new group rather than dumping it on the top level.
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 |
|---|---|---|---|
ASSETS |
attribute | ||
BTN |
attribute | ||
DIALOG |
attribute | ||
ENTRY |
attribute | ||
FORM |
attribute | ||
HOST_MAJOR |
attribute | ||
LAYOUT |
attribute | ||
LBL |
attribute | ||
LIST |
attribute | ||
MASTHEAD |
attribute | ||
PICKER |
attribute | ||
SPN |
attribute | ||
STATUS |
attribute | ||
THUMB |
attribute | ||
TINTLIST |
attribute | ||
TREE |
attribute | ||
UI |
attribute | ||
WIN |
attribute |