jdxi_editor.ui.style.editor_style ================================= .. py:module:: jdxi_editor.ui.style.editor_style .. autoapi-nested-parse:: Shared restrained editor chrome (UI_CRITIQUE). Grey idle borders and soft sliders; accent only for focus / active states. Used app-wide via Theme.apply_editor_style; MidiPlayer/Pattern subclass this. Attributes ---------- .. autoapisummary:: jdxi_editor.ui.style.editor_style.BODY_COLOR jdxi_editor.ui.style.editor_style.BODY_GRAIN jdxi_editor.ui.style.editor_style.BODY_PROPERTY jdxi_editor.ui.style.editor_style.FLAT_PROPERTY jdxi_editor.ui.style.editor_style.SHEEN_PROPERTY jdxi_editor.ui.style.editor_style.SHEEN_SLICE jdxi_editor.ui.style.editor_style.SHEEN_SLICE_BOTTOM jdxi_editor.ui.style.editor_style.SHEEN_SLICE_TOP jdxi_editor.ui.style.editor_style.CHASSIS_MARKER jdxi_editor.ui.style.editor_style.PANEL_MARKER jdxi_editor.ui.style.editor_style.PANEL_BASE jdxi_editor.ui.style.editor_style.PANEL_HEADING_BASE jdxi_editor.ui.style.editor_style.PANEL_HEADING_ALT jdxi_editor.ui.style.editor_style.HEADING_PADDING jdxi_editor.ui.style.editor_style.GLOSS_GRADIENT jdxi_editor.ui.style.editor_style._gloss_panel_file jdxi_editor.ui.style.editor_style.EditorStyle Classes ------- .. autoapisummary:: jdxi_editor.ui.style.editor_style.AppEditorStyle Functions --------- .. autoapisummary:: jdxi_editor.ui.style.editor_style._icon_file jdxi_editor.ui.style.editor_style.in_panel_heading_background_ink jdxi_editor.ui.style.editor_style.panel_heading_background_ink jdxi_editor.ui.style.editor_style.in_panel_ink jdxi_editor.ui.style.editor_style.panel_ink jdxi_editor.ui.style.editor_style.panel_rules jdxi_editor.ui.style.editor_style.body_texture jdxi_editor.ui.style.editor_style._body_grain_file jdxi_editor.ui.style.editor_style.mark_editor_body jdxi_editor.ui.style.editor_style.gloss_panel_file jdxi_editor.ui.style.editor_style.chassis_rules jdxi_editor.ui.style.editor_style.mark_sheen_panels jdxi_editor.ui.style.editor_style.mark_sheen jdxi_editor.ui.style.editor_style.mark_flat jdxi_editor.ui.style.editor_style._jdxi_slider_rules Module Contents --------------- .. py:function:: _icon_file(name: str, color: str, size: int = 12) -> str A qtawesome icon saved as PNG, for stylesheet ``image: url(...)``. Style sheets can only use image files; this draws the icon once per run (needs a QApplication) into the temp folder. .. py:data:: BODY_COLOR :value: '#2C2C2C' .. py:data:: BODY_GRAIN :value: 7 .. py:data:: BODY_PROPERTY :value: 'jdxiBody' .. py:data:: FLAT_PROPERTY :value: 'jdxiFlat' .. py:data:: SHEEN_PROPERTY :value: 'jdxiSheen' .. py:data:: SHEEN_SLICE :value: 3 .. py:data:: SHEEN_SLICE_BOTTOM :value: 6 .. py:data:: SHEEN_SLICE_TOP :value: 5 .. py:data:: CHASSIS_MARKER :value: '/* chassis lettering */' .. py:data:: PANEL_MARKER :value: '/* panel lettering */' .. py:data:: PANEL_BASE :value: 'jdxiPanelBase' .. py:data:: PANEL_HEADING_BASE :value: 'jdxiPanelHeadingBase' .. py:data:: PANEL_HEADING_ALT :value: 'jdxiPanelHeadingAlt' .. py:data:: HEADING_PADDING :value: '1px 6px' .. py:function:: in_panel_heading_background_ink(base: str, alt: bool = False) -> str *base*, as a section heading in the active skin's colours. The Juno-106 names each section in white reversed out of a coloured bar; the JD-Xi prints its headings straight on the panel. A skin that gives no heading background is therefore left exactly as it was, and the headings stay whatever their own style says. Both colours are appended rather than substituted: these styles are plain declaration blocks, so the last declaration wins, whichever the style named. :param base: str the style as written :param alt: bool the skin's second bar rather than its first :return: str .. py:function:: panel_heading_background_ink(widget: QWidget, base: str, alt: bool = False) -> None Make *widget* a section heading in the active skin's colours. :param widget: QWidget a heading on the faceplate :param base: str the style it would otherwise have been given :param alt: bool the skin's second bar rather than its first :return: None .. py:function:: in_panel_ink(base: str) -> str *base*, lettered in the active skin's panel ink. The colour is appended rather than replaced: these styles are plain declaration blocks, so the last ``color`` wins, whichever the style named. :param base: str the style as written :return: str .. py:function:: panel_ink(widget: QWidget, base: str) -> None Letter *widget* with *base* in the active skin's ink, and remember how. :param widget: QWidget a label on the faceplate :param base: str the style it would otherwise have been given :return: None .. py:function:: panel_rules() -> str The faceplate's chrome: transparent, and lettered in the active skin's ink. The legends on the instrument panel used to be the JD-Xi's red whatever skin was chosen, because the colour was written into the stylesheet rather than taken from the skin. Red lettering is the JD-Xi's own mark; on the Juno's slate panel the legends are white, and its red belongs to the bar behind a section name. Only the lettering follows the skin here. The buttons' border and hover keep the accent they had, which each skin already sets as its chassis accent. :return: str stylesheet rules, led by :data:`PANEL_MARKER` .. py:data:: GLOSS_GRADIENT :value: 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161618, stop:0.5 #0A0A0B, stop:1 #050506)' .. py:function:: body_texture(width: int, height: int, seed: int = 7, color: Optional[str] = None) QImage of the matte body: *color* (the active skin's) with fine grain. :param width: int image width :param height: int image height :param seed: int grain seed, so the body is the same every run :param color: Optional[str] body colour; the active skin's when omitted .. py:function:: _body_grain_file(size: int = 128, color: Optional[str] = None) -> str A tile of the body texture as PNG, for stylesheet background-image. :param size: int tile size in px :param color: Optional[str] body colour; the active skin's when omitted .. py:function:: mark_editor_body(widget) -> None Paint *widget* (an editor's root) with the matte body finish. .. py:function:: gloss_panel_file(width: int = 1000, height: int = 420) -> str The active skin's faceplate as PNG, for stylesheet border-image on editor panels. The default skin is the Instrument window's glossy panel (gradient, diagonal sheen, rim and top highlight), so this is unchanged until another skin is chosen; see :mod:`jdxi_editor.ui.style.rack_skin`. .. py:data:: _gloss_panel_file .. py:function:: chassis_rules() -> str Everything in the chrome that belongs to the active skin: the body the editors are mounted on, the tabs standing on it, and the lettering printed on the faceplate. These are gathered in one trailing block, after the rules they override, for two reasons. Changing skin can then rewrite the block wholesale instead of trying to substitute colours in place, which would also catch the controls; and it keeps the skin's reach in one readable place. Only labels and group text take the faceplate's lettering: tabs, fields and lists are control surfaces standing on the panel, and keep dark backgrounds with light text whatever the chassis is made of. A pale skin therefore needs this rather than an inverted palette. A skin that prints ink legends (the brushed plate) also overrides the section rule and title here, which are otherwise the accent. One that mounts its controls shades idle buttons as caps and combo boxes as wells. Checked and focused states are left alone, so a lamp stays red. :return: str stylesheet rules, led by :data:`CHASSIS_MARKER` .. py:function:: mark_sheen_panels(editor) -> None Give *editor*'s outermost panels (tab panes and groups not inside another one) the Instrument window's glossy sheen. Panels inside them keep the plain gradient, so the reflection is not repeated. .. py:function:: mark_sheen(widget) -> None Give *widget* (a QGroupBox or QTabWidget panel) the Instrument window's glossy sheen. .. py:function:: mark_flat(widget) -> None Draw the groups inside *widget* (nested in a glossy panel) flat on that panel, as sections; a tab widget's pane is drawn flat too. .. py:function:: _jdxi_slider_rules(analog: bool = False) -> str The one slider look (both orientations): black handle with a neon border, dark groove, filled part in a neon gradient. Red, or the Analog neon blue. Vertical rules are the same as JDXiUIStyle.ADSR / ADSR_ANALOG, which the synth sections apply, so every slider of a kind looks alike. .. py:class:: AppEditorStyle Design tokens + chrome stylesheet for all editors. .. py:attribute:: BACKGROUND :value: '#151515' .. py:attribute:: SURFACE :value: '#202020' .. py:attribute:: SURFACE_ALT :value: '#292929' .. py:attribute:: BORDER :value: '#383838' .. py:attribute:: BORDER_HOVER :value: '#555555' .. py:attribute:: METALLIC_RED :value: '#A71920' .. py:attribute:: ACCENT :value: '#E04435' .. py:attribute:: ACCENT_HOVER :value: '#F05A5A' .. py:attribute:: BORDER_ACTIVE :value: '#E04435' .. py:attribute:: LCD_ORANGE :value: '#FF6A00' .. py:attribute:: LCD_ORANGE_DIM :value: '#CC5500' .. py:attribute:: LCD_BG_EDGE :value: '#1A0A0A' .. py:attribute:: LCD_BG_MID :value: '#331111' .. py:attribute:: LCD_BG_GLOW :value: '#551100' .. py:attribute:: TEXT :value: '#E6E6E6' .. py:attribute:: TEXT_SECONDARY :value: '#999999' .. py:attribute:: FONT_PANEL :value: '12px' .. py:attribute:: FONT_TRACK_NAME :value: '12px' .. py:attribute:: FONT_TRACK_SECONDARY :value: '10px' .. py:attribute:: FONT_CONTROL :value: '11px' .. py:attribute:: FONT_RULER :value: '10px' .. py:attribute:: FONT_STATUS :value: '11px' .. py:attribute:: MARGINS .. py:attribute:: SPACING_RELATED :value: 8 .. py:attribute:: SPACING_GROUP :value: 14 .. py:attribute:: PANEL_PADDING :value: 12 .. py:method:: editor_stylesheet(*, accent: Optional[str] = None) -> str :classmethod: Restrained editor chrome. GroupBoxes are JD-Xi sections: centred title over one rule, in the accent. ``accent`` tints focus/hover/checked only (e.g. Analog cyan). .. py:data:: EditorStyle