jdxi_editor.ui.windows.skin.editor

Make a skin of your own without writing a file by hand: start from any skin, change its colours, sizes, meters and lanes, see it in a live preview, and save it as a user skin (~/.jdxi_editor/skins/<id>.toml, see jdxi_editor.ui.style.user_skins), which joins the JDXiSkin menu.

The window edits the skin file’s tables directly, the same tables a file holds. A field left alone is inherited from the skin it is based on, and is not written; a field you change is written, and its reset button (↺) takes it out again. Parts the form does not show – named colours, gradients, a decoration’s sizes – are kept as they are when an existing file is opened and saved.

The colours of the panel’s decorations (rules, step buttons, a keyboard) and of the cheeks’ and rail’s details (patch cords, grilles, cables) are offered too. A file can only replace such a list, not change one item of it, so the first colour changed writes the inherited list out whole; its ↺ takes the whole list out again.

Attributes

PALETTE_FIELDS

LANE_CHOICES

DETAIL_LISTS

DETAIL_NAMES

DETAIL_COLOR_NAMES

DetailSlot

SIZE_FIELDS

Classes

ColorButton

A swatch with its "#RRGGBB"; clicking it picks another colour.

LcdSample

A few characters on a screen in the skin's display palette.

SkinPreview

A panel wearing the skin being edited, with lettering and a display.

SkinEditorWindow

Edit a user skin's tables with a live preview, and save them to a file.

Functions

detail_slots(item) → List[Tuple[Tuple[Any, ...], str, Any]]

The colours of a decoration or detail: (path, label, rgba) each.

detail_title(item) → str

"Rule (top)": what a decoration or detail is, and where.

_hex(color) → str

"#RRGGBB" from a QColor, an RGBA tuple or text.

Module Contents

jdxi_editor.ui.windows.skin.editor.PALETTE_FIELDS: Dict[str, List[Tuple[str, str]]][source]
jdxi_editor.ui.windows.skin.editor.LANE_CHOICES: List[Tuple[str, Dict[str, Any] | None]][source]
jdxi_editor.ui.windows.skin.editor.DETAIL_LISTS = [('face', 'decorations', 'Panel decorations'), ('face', 'overlays', 'Panel overlays'), ('ear',...[source]
jdxi_editor.ui.windows.skin.editor.DETAIL_NAMES[source]
jdxi_editor.ui.windows.skin.editor.DETAIL_COLOR_NAMES[source]
jdxi_editor.ui.windows.skin.editor.DetailSlot[source]
jdxi_editor.ui.windows.skin.editor.detail_slots(item: Any) → List[Tuple[Tuple[Any, ...], str, Any]][source]

The colours of a decoration or detail: (path, label, rgba) each.

jdxi_editor.ui.windows.skin.editor.detail_title(item: Any) → str[source]

“Rule (top)”: what a decoration or detail is, and where.

jdxi_editor.ui.windows.skin.editor.SIZE_FIELDS = [('ear_width', 'Cheek width', 40), ('bezel', 'Bezel', 20), ('rail_height', 'Rail height', 30)][source]
jdxi_editor.ui.windows.skin.editor._hex(color: Any) → str[source]

“#RRGGBB” from a QColor, an RGBA tuple or text.

class jdxi_editor.ui.windows.skin.editor.ColorButton(parent: PySide6.QtWidgets.QWidget | None = None)[source]

Bases: PySide6.QtWidgets.QPushButton

A swatch with its “#RRGGBB”; clicking it picks another colour.

colorChosen[source]
_color = '#000000'[source]
color() → str[source]
set_color(color: str) → None[source]

Show color without telling anyone.

_pick() → None[source]
class jdxi_editor.ui.windows.skin.editor.LcdSample(parent: PySide6.QtWidgets.QWidget | None = None)[source]

Bases: PySide6.QtWidgets.QWidget

A few characters on a screen in the skin’s display palette.

_lcd = None[source]
set_lcd(lcd) → None[source]
paintEvent(_event) → None[source]
class jdxi_editor.ui.windows.skin.editor.SkinPreview(parent: PySide6.QtWidgets.QWidget | None = None)[source]

Bases: PySide6.QtWidgets.QWidget

A panel wearing the skin being edited, with lettering and a display.

title[source]
subtitle[source]
rule[source]
lcd[source]
panel[source]
_body[source]
set_skin(skin: picoui.skin.Skin) → None[source]
paintEvent(_event) → None[source]
class jdxi_editor.ui.windows.skin.editor.SkinEditorWindow(parent: PySide6.QtWidgets.QWidget | None = None, wear: Callable[[picoui.skin.Skin, bool], None] | None = None, saved: Callable[[picoui.skin.Skin], None] | None = None, folder: pathlib.Path | None = None)[source]

Bases: PySide6.QtWidgets.QMainWindow

Edit a user skin’s tables with a live preview, and save them to a file.

Parameters:
  • parent – the main window

  • wear – called with (skin, remember) to put a skin on the editor

  • saved – called with the skin once it is saved and offered

  • folder – where user skins are saved; USER_SKIN_DIR if None

_wear = None[source]
_saved = None[source]
_folder[source]
_worn_before = None[source]
_trying = False[source]
_path: pathlib.Path | None = None[source]
_id_follows_label = True[source]
_skin: picoui.skin.Skin | None = None[source]
_updating = False[source]
_data: Dict[str, Any][source]
_rebuild[source]
_build_ui() → None[source]
_row(key: Tuple[str, str], widget: PySide6.QtWidgets.QWidget) → PySide6.QtWidgets.QWidget[source]

A field and its reset button.

_identity_group() → PySide6.QtWidgets.QGroupBox[source]
_sizes_group() → PySide6.QtWidgets.QGroupBox[source]
_palette_group(table: str, title: str) → PySide6.QtWidgets.QGroupBox[source]
_face_group() → PySide6.QtWidgets.QGroupBox[source]
_ear_group() → PySide6.QtWidgets.QGroupBox[source]
_details_group() → PySide6.QtWidgets.QGroupBox[source]

The colours of the panel’s decorations and the cheeks’ and rail’s details; its rows are made to fit the skin (see _fill_details()).

_features_group() → PySide6.QtWidgets.QGroupBox[source]
_table(name: str) → Dict[str, Any][source]
_edited(table: str, key: str, value: Any) → None[source]
_reset(table: str, key: str) → None[source]
_changed() → None[source]
tables() → Dict[str, Any][source]

A copy of the skin file’s tables, as they would be saved.

new_skin(based_on: str) → None[source]

Start a new skin from based_on, changing nothing yet.

open_file(path: pathlib.Path) → None[source]

Edit the skin in path.

_free_id(skin_id: str) → str[source]

skin_id, numbered if a skin or file already has it.

_label_edited(text: str) → None[source]
_id_edited(text: str) → None[source]
_based_on_changed(_index: int) → None[source]
_meter_changed(_index: int) → None[source]
_lanes_changed(_index: int) → None[source]
_repaint_face_toggled(on: bool) → None[source]
_write_face_material() → None[source]
_repaint_ear_toggled(on: bool) → None[source]
_write_ear_material() → None[source]
_detail_edited(slot: DetailSlot, color: str) → None[source]

A decoration’s or detail’s colour changed. A list inherited from the skin it is based on is written out whole first, as a file can only replace a list, then the one colour is changed in it.

_detail_color(slot: DetailSlot)[source]

The colour a slot shows now, as RGBA, or None.

_build(refresh_form: bool = False) → None[source]

Make the skin from the tables; show it, or say what is wrong.

_id_problem() → str | None[source]
_say(text: str, error: bool = False) → None[source]
_refresh_form(skin: picoui.skin.Skin | None) → None[source]

Show the skin’s values: changed ones bold, inherited ones plain.

_fill_details(skin: picoui.skin.Skin) → None[source]

A row per colour of each decoration and detail the skin has, under a heading per list; remade only when the skin’s lists change shape.

_make_detail_rows(lists) → None[source]
_fill_based_on(based_on: str | None) → None[source]
static _shown_color(skin: picoui.skin.Skin, table: str, key: str) → str | None[source]
static _fill_stops(buttons: List[ColorButton], material, fallback: str, checked: bool) → None[source]

The repaint colours: the current gradient’s, else the body’s shades.

_choose_new() → None[source]
_open() → None[source]
_try_on() → None[source]
save() → pathlib.Path | None[source]

Save the skin, offer it, and wear it; returns the file, or None.

_save() → None[source]
closeEvent(event) → None[source]