/* Modified by VibeMake: brand the product chrome while preserving KiCad canvas semantics. */ /* KiCad-eeschema-like application chrome. Dark theme by default, matching KiCad's dark mode. */ :root { /* VibeMake product tokens. The editor's KiCad-compatible surface tokens remain below; these values are used by the branded shell and fallback states so the product chrome has one source of truth. */ --vibemake-bg: #0b0c0e; --vibemake-bg-raised: #101215; --vibemake-bg-panel: #15181c; --vibemake-border: #242932; --vibemake-fg: #f3f4f6; --vibemake-fg-muted: #a6adb8; --vibemake-accent: #c8ff3e; --vibemake-accent-muted: #a9d936; --vibemake-hover: rgb(200 255 62 / 11%); --vibemake-mark-glow: rgb(200 255 62 / 20%); --vibemake-focus-outline-width: 2px; --vibemake-focus-outline-offset: 2px; /* Data, not chrome: ente's `colors.fixed.danger.main` (web/packages/base/components/utils/theme.ts), the one colour its account surfaces paint a destructive action in. The account UI follows ente, not KiCad, which has no account. */ --critical: #ea3f3f; /* Data likewise: ente's `avatarTextColor` (avatar.ts), the initial on an avatar disc. */ --avatar-fg: #fff; /* Ours, not ente's (it has no signed-out avatar): the ring and glyph the account button wears with no address to pick a colour from - a neutral grey, so it reads as "nobody" rather than as a person's colour. [data] */ --avatar-guest-fg: #b4b7bc; /* Data: Excalidraw's `--color-success-contrast` (packages/excalidraw/css/theme.scss). Its encrypted shield is drawn in its primary purple; ours is the same shield (ui/EncryptedIcon.tsx) in Excalidraw's own green instead, the colour that reads as "safe" on our dark chrome. */ --encrypted-icon-fg: #65bb6a; /* GTK dark chrome greys, sampled off a live KiCad 10 project-manager window on this machine (Ubuntu/Yaru dark). KiCad paints none of these itself - they come from wxSystemSettings / the GTK theme - so a screenshot of the real frame is the only ground truth there is for them. Every one is neutral (r == g == b). The values these replaced carried a blue tint (blue 4-6 above red), which is the thing that read as "not KiCad" before a single widget had been compared. */ /* [px] All four asked of wxWidgets itself, which is the palette KiCad paints with: `qa/probes/syscolour_probe.cpp` dumps every wxSYS_COLOUR_* on this machine. Reading GTK's own named colours answers a DIFFERENT question — wx maps the theme onto its enum with logic of its own, and the two disagree (GTK's theme_bg_color is #2c2c2c while wxSYS_COLOUR_3DFACE, which is what a wxAuiToolBar draws on, is #373737). KiCad asks wx, so we ask wx. */ --chrome-bg: #2c2c2c; /* [px] menu bar and status bar; a TOOLBAR is --content-bg, which is wxSYS_COLOUR_3DFACE #373737 */ --chrome-bg2: #272727; /* [px] wxSYS_COLOUR_WINDOW / _LISTBOX / _APPWORKSPACE */ /* [px] wxSYS_COLOUR_WINDOWFRAME, qa/probes/syscolour_probe. The same value as 3DFACE under this theme, but its own system colour: a modified Symbol Fields Table row. */ --sys-windowframe: #373737; --chrome-border: #1e1e1e; /* [px] wxSYS_COLOUR_BTNTEXT / _MENUTEXT / _CAPTIONTEXT, all #f7f7f7. NOT white: wx has a separate _WINDOWTEXT / _LISTBOXTEXT at #ffffff, and this token had collapsed the two. It is visible, and in the pane Akshay has been looking at all night. A histogram of the GerbView layers manager, ours beside a live one at the same size: KiCad's layer names peak at 247 with the usual antialiasing spread beneath, ours are 1,976 pixels of flat 255. Those names are WX_ELLIPSIZED_STATIC_TEXT (`gerbview/widgets/layer_widget.cpp:358`) — a widget label, which takes the widget foreground, not a listbox row. */ --chrome-fg: #f7f7f7; /* [css] Secondary/subdued text on a ZiroEDA product surface (auth, nudges): the foreground, stepped down but kept legible. Not a wx colour — KiCad has no such surfaces — so it is chosen, not measured, and exists so those rules cite one source instead of each inventing its own grey. */ --chrome-fg-muted: #c3c8d0; /* [px] wxSYS_COLOUR_HIGHLIGHTTEXT — the text ON a selection. The same #ffffff as --view-fg in this theme, and a separate token anyway: wx has three foregrounds that happen to coincide here, and naming which one a rule means is the difference between a value and a source. */ --selection-fg: #ffffff; /* Its counterpart, split for the same reason --selection-fg is: a SELECTION block and an ACTIVE control accent are two roles that happen to share wxSYS_COLOUR_HIGHLIGHT's value here. [px] a selected row in a live pl_editor Design Inspector measures rgb(233,84,32) = #e95420, which is what the syscolour probe reports for HIGHLIGHT. */ --selection-bg: #e95420; /* [px] wxSYS_COLOUR_WINDOWTEXT / _LISTBOXTEXT, the text INSIDE a view rather than on a widget: an entry, a listbox, a grid cell. GTK agrees — its `entry` and `treeview` report rgb(255,255,255) where every button, label, menu item and toolbar reports rgb(247,247,247). */ --view-fg: #ffffff; /* Hover, and it is an OVERLAY rather than a colour. [px] `wxSYS_COLOUR_MENUHILIGHT` is rgb(247, 247, 247) at alpha **38/255** (`qa/probes/syscolour_probe.cpp`), and a Gtk.OffscreenWindow rendering a real menu item prelit confirms what that composites to: rgb(74, 74, 74) on the rgb(44, 44, 44) menu bar, which is 44 + (247-44) * 38/255 = 74.2. That is why a flat value cannot be right. This token is used on 31 hover surfaces whose backgrounds are #2c2c2c, #373737 and #272727, and an overlay lands on each of them the way GTK's does while one grey can only match one of the three. Ours was #3a3a3a = 58 everywhere: sixteen units too dark on the menu bar, and further out on the lighter toolbars. Toolbar BUTTONS are not this. `BITMAP_BUTTON::OnPaint` tints them with `wxSYS_COLOUR_HIGHLIGHT.ChangeLightness( n )` — the accent, not a grey — and they have their own --accent-fill-* tokens below. */ --chrome-hover: rgb(247 247 247 / 14.9%); --chrome-active: #e95420; --chrome-active-border: #e95420; /* `BITMAP_BUTTON::OnPaint` (bitmap_button.cpp:270-310) paints every tool state as `wxSYS_COLOUR_HIGHLIGHT.ChangeLightness( n )` — the accent with every channel scaled to n% — outlined 1px in the highlight itself. In dark mode: pressed 20 hover 40 hover + checked 50 checked 40 So hover and checked share a fill, and a checked tool goes LIGHTER under the pointer rather than darker. [px] a checked tool samples rgb(93,33,12), which is the 40 level. The launcher hover is the same wx rule and the same token. */ /* `appearance.toolbar_icon_size`, common_settings.cpp:115-116 — default 24, range 16..64. THE setting: KiCad stores this one number and derives every toolbar metric from it, which is why changing it in Preferences resizes the whole application coherently. We had six literals instead (22px icons in 26px buttons here, 28px there), so nothing moved together and none of them were KiCad's numbers. `ACTION_TOOLBAR::AddAction` (action_toolbar.cpp:141): paddingDip = ( ToDIP( m_buttonSize.GetWidth() ) - iconSize ) / 2 so the padding is not a value at all — it is the half-difference between the button and the icon. [px] measured on a hovered "Switch to PCB Editor": KiCad 30px button around a 24px icon = 3px each side; ours was a 24px button around a 22px icon = 1px. */ --toolbar-icon-size: 24px; --toolbar-button-pad: 3px; --toolbar-button-size: calc(var(--toolbar-icon-size) + 2 * var(--toolbar-button-pad)); /* [px] the wxAuiToolBar separator, from the same capture: #5f5f5f, and it is LIGHTER than the toolbar face rather than darker. */ --toolbar-separator: #5f5f5f; /* [px] see .ze-tb-textinfo — wx's default for an empty read-only wxTextCtrl, from qa/probes/gerbview_toolbar_probe.cpp. */ --gbr-textinfo-width: 98px; --accent-fill-pressed: #2f1106; --accent-fill-checked: #5d220d; --accent-fill-hover-checked: #742a10; --panel-bg: #272727; /* docked pane body (project tree, properties...) */ --panel-header: #2e2e2e; /* wxAUI pane caption bar */ /* wxAUI's dock sash, the bar between a docked pane and the canvas. KiCad never states either value: it adds the pane with EDA_PANE().Palette() and wxAUI draws the sash from wxAuiDefaultDockArt. Measured by asking that dock art on this machine (qa/probes/aui_sash_probe.cpp): GetMetric( wxAUI_DOCKART_SASH_SIZE ) -> 5 GetColour( wxAUI_DOCKART_SASH_COLOUR ) -> rgb(55, 55, 55) The colour is wxSYS_COLOUR_3DFACE, which is why it equals --content-bg; they are the same system colour reached for two different reasons, not one value with two names. Not to be confused with --splitter-sash below: that is a wxSplitterWindow sash inside a dialog, a different widget that GTK draws differently. */ --aui-sash: #373737; --aui-sash-size: 5px; /* The other half of the same dock art: the border wxAUI draws around a pane that asked for one. `EDA_PANE().Canvas()` is the one that always does (`PaneBorder( true )`, eda_base_frame.h:975-981), which is why every editor's canvas is fenced off from the toolbars and panes around it while two docked toolbars butt together with no line at all. Same probe, same dock art (qa/probes/aui_sash_probe.cpp): GetMetric( wxAUI_DOCKART_PANE_BORDER_SIZE ) -> 1 GetColour( wxAUI_DOCKART_BORDER_COLOUR ) -> rgb(41, 41, 41) This was `--toolbar-dock-edge`, named for the one place we had noticed it: the line under the top toolbar block. It is not a property of toolbars — it is the canvas pane's own border, and the toolbars merely happen to be what sits against three of its four sides. [px] pcbnew 1920x1200: #292929 down x=405 and x=1631 beside the two vertical toolbars, and ALSO along y=1140 under the canvas — where there is no toolbar at all, and where we had a full-width --chrome-border rule instead. */ --aui-pane-border: #292929; --aui-pane-border-size: 1px; /* That other sash. PANEL_SYMBOL_CHOOSER builds its panes with a wxSplitterWindow pair (eeschema/widgets/panel_symbol_chooser.cpp:193-210, wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH) and names neither number. [px] `qa/probes/chooser_shell_probe.cpp` builds that splitter with those styles and asks it: `GetSashSize()` is 5, and the mapped window read back off the display server paints the strip #181818. Not --aui-sash (#373737), and not --chrome-border (#1e1e1e), which is what .ze-sash used to say. */ --splitter-sash: #181818; --splitter-sash-size: 5px; /* A wxDataViewCtrl's column header. GTK draws it as a button inside the treeview, and Yaru's rule for it is treeview.view header button { color: #8f8f8f; background-color: #272727; font-weight: bold; padding: 0 6px; border-style: none solid solid none; border-color: #2c2c2c } so only the foreground is a value we do not already hold: the face is --chrome-bg2 (wxSYS_COLOUR_LISTBOX) and the 1 px rule under and beside it is --chrome-bg, the window background showing through. [px] the rendered header measures #8f8f8f on #272727 and is 24 px tall over a 1 px #2c2c2c rule (`qa/probes/chooser_shell_probe.cpp`). It is NOT wxSYS_COLOUR_GRAYTEXT (#929292); those two are close and different. */ --libtree-header-fg: #8f8f8f; --libtree-header-height: 24px; /* The colour GTK recolours a symbolic icon to inside a text entry - the magnifier and the clear button a wxSearchCtrl gets from the icon theme. Yaru: `entry image { color: #cdcdcd }`, `:hover { color: #F7F7F7 }`, `:active { color: #E95420 }`, so hover is --chrome-fg and pressed is the accent and only the resting colour is new. [px] the rendered icons measure #cdcdcd (`qa/probes/chooser_shell_probe.cpp`), which is exactly mix(#f7f7f7, #272727, 80%). */ --entry-icon-fg: #cdcdcd; /* A GtkSeparator - what a wxStaticLine is. Yaru draws it as an overlay, not a grey: `separator { background: rgba(0, 0, 0, 0.1); min-width: 1px }`. wx agrees: a real wxStaticLine reports its background as #0000001A, and 26/255 is that same 10.2%. So it darkens whatever it is drawn on, and a flat grey could only ever be right on one surface. */ --gtk-separator: rgb(0 0 0 / 10%); /* How far a wxRESIZE_BORDER grip reaches across a dialog's edge. The bands are invisible (GTK draws no grip) and this is a hit-area reach chosen for the pointer, not a measured GTK metric; one token so no grip rule states a number of its own. */ --resize-grip: 6px; /* wxSYS_COLOUR_HOTLIGHT — a link, wherever KiCad draws one. `HTML_WINDOW::SetPage` (common/widgets/html_window.cpp:56-66) wraps every page it is handed in ``, so the details pane's text, face and links are three system colours rather than a stylesheet. [px] qa/probes/chooser_shell_probe.cpp. A `wxHyperlinkCtrl` is the same colour and not a second one: wxGTK backs it with a real GtkLinkButton, and asking that widget for its link-state foreground under this theme gives rgb(240,135,98) — the same value, which is why this is one token and not two. It is Yaru's warm accent, NOT blue; the `#4a9eff` a couple of panels invented is a colour no GTK theme on this desktop produces. */ --link-fg: #f08762; /* The same widget's `Gtk.StateFlags.VISITED` foreground, rgb(236,109,64). */ --link-visited-fg: #ec6d40; /* EDA_MSG_PANEL's background, wxSYS_COLOUR_BTNFACE, measured by qa/probes/aui_sash_probe.cpp. See .ze-msgpanel. */ --msgpanel-bg: #373737; /* wxGrid paints three surfaces from three different system colours, and the difference between them is the whole reason a grid reads as a grid: SetLabelBackgroundColour -> wxSYS_COLOUR_BTNFACE the row and column labels, LIGHTER cell default background -> wxSYS_COLOUR_WINDOW the data cells SetGridLineColour -> wxSYS_COLOUR_BTNSHADOW the rules between [px] measured off a live pl_editor Design Inspector beside ours: labels rgb(55,55,55), cells rgb(39,39,39), lines rgb(24,24,24) — which are exactly the BTNFACE / WINDOW / BTNSHADOW our syscolour probe reports. Ours had the header DARKER than its cells (39 against 44) and both wrong, which is what Akshay saw as "the boxes are more whiter" in KiCad. */ --grid-label-bg: #373737; --grid-cell-bg: #272727; /* A covered table cell (DIALOG_TABLE_PROPERTIES::TransferDataToWindow): wxSYS_COLOUR_BTNFACE, .ChangeLightness( 140 ) on a dark theme. [data] wx's ChangeLightness blends toward white with alpha 1 - 0.4: 255 + 0.6 * (55 - 255) = 135 per channel, on the measured BTNFACE #373737 (--grid-label-bg). */ --grid-covered-bg: #878787; /* The OTHER selection fill. `wxGridCellRenderer::Draw` chooses between two: `GetSelectionBackground()` when `grid.HasFocus()`, and `wxSYS_COLOUR_BTNSHADOW` when it does not — and a grid does not have focus for the whole time one of its cells is being EDITED, because the editor control holds it and `wxWindow::HasFocus()` on the grid is then false. [px] `qa/probes/grid_edit_fill_probe.cpp` runs that renderer into a bitmap and reads the pixel back: #e95420 focused, #181818 with the editor open, #272727 unselected. A live footprint editor agrees — the row being edited on Preferences > Footprint Editor > User Layer Names measures rgb(24,24,24) in its untouched column. Not `--ctl-border`, which happens to hold the same #181818: that one is Yaru's $borders_color, and the two are only equal by coincidence. */ --grid-selection-idle-bg: #181818; /* wxGrid's OWN line colour, which is not the control border. `wxGrid` defaults `SetGridLineColour` to the same BTNFACE the labels take, so the lines read as part of the header band rather than as dark rules -- the same reason a wxPropertyGrid category reads as an unbroken band (see widgets/properties_panel.css). This said #181818, which is --ctl-border's value: copied from the control border rather than asked of wx, and never pinned by anything. `qa/probes/eseries_grid_probe.cpp` builds a real wxGrid and asks it -- `wxGrid default line colour rgb(55, 55, 55)`, the same call KiCad makes, on this machine, with this theme. */ --grid-line: #373737; /* EDA_MSG_PANEL lays itself out in units of one 'W': m_fontSize = GetTextExtent( "W" ) msgpanel.cpp:72 if( m_last_x == 0 ) m_last_x = m_fontSize.x; :143 (first item) text.Append( ' ', item.GetPadding() ); :140 (the PAD) m_last_x += GetTextExtent( text ).x; :151 m_last_x += m_fontSize.x; :154 (gap) The left inset really is one 'W'. The GAP is not: the padding spaces are appended to the text BEFORE it is measured, so what separates two cells is `item.GetPadding()` spaces plus one 'W', not one 'W' alone. We had read :151 as measuring the bare text and dropped :140 entirely, which drew every message panel in the app about 18px per cell tighter than KiCad's. [px] wx measures, in Ubuntu Sans 11 on this desktop (qa/probes/msgpanel_probe.cpp): "W" 14 x 18, a space 3, six spaces 18. The 18 of the height is already --ui-line-height. Corroborated against a real GerbView capture: the probe puts the seven GERBER_FILE_IMAGE:: DisplayImageInfo cells at x = 14, 96, 216, 304, 389, 477, 564 and the capture has them at 80, 163, 283, 371, 455, 543, 630 - a constant 66/67px client origin across all seven. */ --msgpanel-gutter: 14px; /* GetTextExtent( " " ).x, the unit MSG_PANEL_ITEM::m_Padding counts in (msgpanel.cpp:140). Separate from the gutter because the padding is PER-ITEM - MSG_PANEL_DEFAULT_PAD is 6 (msgpanel.h:41) but the symbol editor passes 8 (symbol_editor.cpp:1749-1767) - so it multiplies. */ --msgpanel-space: 3px; /* The frame background a docked canvas or notebook sits on. *Lighter* than the panes - which is the relationship KiCad has, and which we had inverted: our tree pane was lighter than the launcher beside it. */ --content-bg: #373737; /* wxSYS_DEFAULT_GUI_FONT, the size every KiCad frame draws its menus, trees, labels and status text at. 11pt on a stock GTK desktop; CSS pt is defined against 96 dpi, so this is exactly the 14.67 px the real app uses. Applied per-widget as we port each one rather than to the whole shell, which still runs at the 13 px base it was built around. [gtk] `Gtk.Settings.get_default().get_property('gtk-font-name')` on this machine = "Ubuntu Sans 11", and a GtkLabel built with it reports `get_preferred_width() == 142` for "Black & White Picture" - the exact width this file already recorded for the real KiCad frame. Note that `gsettings get org.gnome.desktop.interface font-name` answers "Cantarell 11" and is MISLEADING: Ubuntu ships /usr/share/glib-2.0/schemas/10_ubuntu-settings.gschema.override:62,100, which overrides the family to Ubuntu Sans in the `ubuntu` profile, and Cantarell is not installed here at all (`fc-list | grep -c -i cantarell` = 0), so anything that really asks for it falls back to Noto Sans, a visibly wider face. Earlier comments in this file named Cantarell; the SIZE they recorded (11) was right, and it is the size these tokens key on. */ --ui-font-size: 11pt; /* The line box of --ui-font-size, which is `GetTextExtent( "pdI" ).y` in wx: the string is chosen for its ascender, descender and cap height, so the extent is the whole line rather than a glyph. MEASURED on this machine by `qa/probes/libtree_rowheight_probe.cpp`, which asks a wxPanel carrying the default GUI font: Ubuntu Sans 11pt gives 18 px, and wx's GetCharHeight agrees. It is a token rather than a literal because it is the second half of LIB_TREE's row-height formula below, and a tree that restated it would drift from the font the moment the theme changed. */ --ui-text-height: 18px; /* LIB_TREE's tree rows, which do NOT take GTK's own row height: it overrides them (common/widgets/lib_tree.cpp:177-180) with `FromDIP( 6 ) + GetTextExtent( "pdI" ).y`, because "the GTK renderer seems to calculate row height incorrectly sometimes". 6 + 18 = 24 px here, and the 6 is split evenly as the row's vertical padding. */ --libtree-row-pad: 3px; /* But 24 is what wx ASKS FOR, not what gets drawn. GtkTreeView adds its "vertical-separator" style property BETWEEN rows, so the pitch on screen is 24 + 2 = 26. Measured by `qa/probes/libtree_rowheight_probe.cpp`, which builds a real wxDataViewCtrl, calls SetRowHeight(24) on it and then asks GTK for the separator it will insert. Corroborated independently against a live chooser: 17 rows spanning 416 px is 26.0 per row. It is INSIDE the highlighted band, not between two of them. [px] `qa/probes/libtree_selection_probe.cpp` asks the realized GtkTreeView for both rectangles - `background_area = 26` around `cell_area = 24`, offset by 1 - and reads a selected row back off the rendered window as 26 px of solid highlight. So the separator is 1 px of the row's own padding at each end, and this token is halved into `.ze-libtree-row`'s padding rather than being the list's `row-gap`. The earlier reading of it as a gap was taken from `gtk_widget_style_get( "vertical-separator" )` alone, which says how big it is and not which box owns it. */ --libtree-row-sep: 2px; /* The details pane is an HTML_WINDOW, and wxHtml adds its own leading between
lines: NOT the font's 18 px line box but 21. Measured by `qa/probes/libtree_details_probe.cpp`, which renders the real template from generate_alias_info.cpp:28-46 and reads back where each line box lands (tops at 10, 31, 52, 73 - four lines, three 21 px steps). A browser's default `normal` line-height gives about 17.6 px for this font, which is what made the description read tighter than KiCad's. */ --libtree-details-line: 21px; /* The only two OTHER chrome text sizes KiCad has - and it derives both from the one above rather than declaring either. `getGUIFont( win, aRelativeSize )` (common/widgets/ui_common.cpp:109-129) adds a signed point delta to the window's own font, and exactly five accessors call it: KIUI::GetControlFont ( 0) ui_common.cpp:168-171 11pt KIUI::GetStatusFont ( 0 off macOS) ui_common.cpp:132-141 11pt KIUI::GetDockedPaneFont ( 0 off macOS) ui_common.cpp:144-153 11pt KIUI::GetInfoFont (-1) ui_common.cpp:156-159 10pt KIUI::GetSmallInfoFont (-2) ui_common.cpp:162-165 9pt So the whole application has THREE chrome text sizes on Linux, not eight, and the smaller two are a fixed relative step off the first. That is the parity rule: a hint under a control is 10pt because GetInfoFont says -1, never because 12.5px looked about right. A fourth value is invented. GetInfoFont's callers are the italic help labels beside a control (dialog_junction_props.cpp:43-44, panel_setup_mask_and_paste.cpp:43, properties_frame.cpp:97), the Appearance controls (appearance_controls.cpp:446,623) and the selection filters (panel_selection_filter.cpp:36, panel_sch_selection_filter.cpp:37). GetSmallInfoFont's are the second-tier hints (panel_edit_options.cpp:47-48, dialog_sheet_properties.cpp:103-104, dialog_symbol_properties.cpp:381). Declared here and consumed as each launcher's parity work reaches it - nothing reads them yet, so adding them moves no pixel. */ --ui-font-size-info: 10pt; --ui-font-size-small: 9pt; /* KiCad's Appearance list background, and it is DERIVED, not chosen: m_layerPanelColour = m_panelLayers->GetBackgroundColour().ChangeLightness( 110 ) (pcbnew/widgets/appearance_controls.cpp:433, :1240) -- the panel's own background, lightened, so the layer/object rows read as a list against the chrome. `qa/probes/layer_panel_colour_probe.cpp` builds that panel and asks wx: background #373737, ChangeLightness( 110 ) -> #4b4b4b. This said #3a3d42, which cannot be right by construction: ChangeLightness on a NEUTRAL grey stays neutral, and #3a3d42 is blue-tinted (58, 61, 66). It was our own chrome tint, not KiCad's derivation. */ --panel-list-bg: #4b4b4b; /* The ACTIVE layer's row. `APPEARANCE_CONTROLS::OnLayerChanged` repaints every row `m_layerPanelColour` and then lightens the current one by adding 15 to each channel below 240 (appearance_controls.cpp:1273-1288) — so from --panel-list-bg's 75 it is exactly 90, #5a5a5a. It is NOT the selection accent: KiCad marks the active layer with a slightly lighter grey plus an INDICATOR_ICON, and ours painted the row Yaru orange, which is the one colour on that panel that means "selected item" everywhere else. */ --panel-list-row-active: #5a5a5a; /* Filled portion of an opacity slider, left of the thumb. */ --slider-fill: #e8912b; /* Height of one menu row, and the size everything inside it is derived from. One number so the whole app's menus stay one density — change it here and the icons, the checkmark column and the flyout marker follow. 26px is measured: the highlight rectangle GTK paints under the hovered row of a real KiCad menu is 26 pixels tall, screenshotted beside ours. It was 22, which is why our menus read as a size smaller than the desktop app's. */ --menu-row: 26px; /* Status-bar height. A property of the FRAME, because KiCad has two kinds of status bar and they do not measure the same: 23px KISTATUSBAR (common/widgets/kistatusbar.cpp). Every EDA_DRAW_FRAME gets one (eda_draw_frame.cpp:136) and so does KICAD_MANAGER_FRAME (kicad_manager_frame.cpp:176). MEASURED on the project manager at 1920x1200, column x=900: content (55,55,55) to y=1175, a (41,41,41) rule at y=1176, bar (44,44,44) y=1177..1199 -> 23px. 33px a plain wxStatusBar. Only two frames in the whole of KiCad get one, because only EDA_DRAW_FRAME and KICAD_MANAGER_FRAME override OnCreateStatusBar: BITMAP2CMP_FRAME (bitmap2cmp_frame.cpp:181) and EDA_3D_VIEWER_FRAME (eda_3d_viewer_frame.cpp:118). MEASURED on bitmap2component at 1920x1200, column x=600: content (39,39,39) to y=1165, a (24,24,24) rule at y=1166, bar (44,44,44) y=1167..1199 -> 33px. Do NOT "unify" these. The obvious explanations are all disproved: a probe built against this machine's own wx 3.2.4/GTK3 (see the PR) gives an IDENTICAL height for wxSTB_SIZEGRIP vs none, 1 field vs 8, wxSB_FLAT vs wxSB_NORMAL, and SetFont vs not - and KIUI::GetStatusFont is a no-op off macOS anyway (getGUIFont( win, 0 ) returns the window's own font, and apply_icon_scale_to_fonts is off here). The one difference that survives is the widget class itself, so that is what this token keys on. */ --statusbar-height: 23px; /* --------------------------------------------------------------------- GTK control theme. KiCad declares none of its control metrics. wxWidgets asks GTK, GTK answers out of the active desktop theme, and that single answer is why every KiCad launcher looks exactly like every other one. We had been re-inventing a number per editor instead — ~193 hardcoded font sizes across eight distinct values, against 15 uses of --ui-font-size — so this block is our equivalent of the theme: one value per property, consumed by name, never copied. Two ground truths, marked per value: [css] the theme stylesheet itself. Yaru-dark ships it inside a gresource bundle; extract with gresource extract \ /usr/share/themes/Yaru-dark/gtk-3.0/gtk.gresource \ /com/ubuntu/themes/Yaru-dark/3.0/gtk-dark.css [px] a pixel sampled off a live, focused bitmap2component window (1920x1200, unscaled, Xft.dpi 96, gtk-font-name Ubuntu Sans 11 - see --ui-font-size above for why it is not Cantarell). Where the two agree the value is certain; where they differ the sampled one wins, because it is what the user sees, and the comment says so. --------------------------------------------------------------------- */ /* Chrome's system-ui on Linux resolves to GTK's gtk-font-name, which is the same family wxSYS_DEFAULT_GUI_FONT hands KiCad. That used to rest on a ratio argument; it is now measured directly. Rendering "Black & White Picture" at 11pt in a HEADED Chrome on this desktop: system-ui 140.78 px "Ubuntu Sans" 140.78 px "Noto Sans" 146.64 px Cantarell 133.64 px (not installed) i.e. system-ui IS Ubuntu Sans, byte for byte, and Ubuntu Sans is what gtk-font-name names. GTK's own Pango layout of the same string is 142 px, 0.9 % apart - hinting, not a different face. Do not check this in headless Chrome: with no GTK to ask, `--headless=new` resolves system-ui to Noto Sans (146.64 px) and the comparison inverts. */ --ui-font-family: system-ui, sans-serif; /* The natural height of one GtkLabel at --ui-font-size, i.e. Pango's logical extent = ascent + descent. [gtk] Pango's metrics for Ubuntu Sans 11 at 96 dpi are ascent 14 + descent 4 = 18, and a live GtkLabel agrees exactly: `get_preferred_height()` returns (18, 18). [px] the Image Information grid's rows repeat every 23 px and wxFormBuilder gives each a 5 px bottom border (bitmap2cmp_panel_base.cpp:47-88), so the label itself is 18. */ --ui-line-height: 18px; /* The window-manager title bar. KiCad's client area draws no title at all — `SetTitle()` (bitmap2cmp_frame.cpp:352-365) hands the string to the WM, which paints it above the menu bar in its own font. A browser tab has no WM title bar, so we carry it in-page; carrying it in the MENU BAR row was the part that was wrong, because that row has no title in KiCad and the string had to shrink to 8pt to fit (measured 91 px wide against KiCad's 130 px). [px] measured on a real frame at 1920x1200, column x=700: title strip y=32..67 = 36 px of rgb(34,34,34), a 1 px rgb(0,0,0) rule at y=68, then the 25 px rgb(44,44,44) menu bar. Title ink sampled rgb(247,247,247). [css] the effective WM title font is "Ubuntu Sans Bold 11" - 11pt at 96 dpi = 14.667 px, weight 700. `gsettings get org.gnome.desktop.wm.preferences titlebar-font` answers "Cantarell Bold 11", which is the upstream GNOME default and NOT what runs here: /usr/share/glib-2.0/schemas/10_ubuntu-settings.gschema.override:135 sets it to Ubuntu Sans Bold 11 in the `ubuntu` profile. Same size, same weight, different family - the numbers below are unaffected. */ /* DELIBERATE DIVERGENCE, Akshay's call 2026-08-19: the real strip is 36 px, but that is a window-manager decoration and the browser already spends ~140 px on its own chrome before our frame starts. Ours is sized to the text plus a little breathing room: 18 px of label (the natural ascent+descent for this font, the same as --ui-line-height at the same 11pt) with 3 px above and below, so 24 px — saving 12 px per frame. Sized to the text alone at 18 px it read as cramped. The font, colours and the rule below are still KiCad's; only the strip's height is ours. Do not "restore" 36 px as a parity fix. */ --titlebar-height: 24px; --titlebar-bg: #222222; --titlebar-fg: #f7f7f7; --titlebar-font-size: 14.667px; --titlebar-font-weight: 700; --titlebar-rule: #000000; /* [css] `decoration { border-radius: 12px 12px 0 0 }` (Yaru-dark gtk.css:4504). A GNOME window is rounded on its TOP two corners only; the bottom two are square. This is the window frame, so it is NOT --ctl-radius (6px), which is a button/entry value — ours used that on all four corners. */ --window-radius: 12px; /* The drop shadow every popup casts -- a menu, a flyout, the share panel. GTK draws one shadow for popup windows, from the theme, so this is one value in one place rather than a number each popup happens to carry. It was written out three times, and the share panel was about to be a fourth. */ --popup-shadow: 0 6px 18px rgb(0 0 0 / 45%); /* The ink KiCad writes for a line a user has to notice. `WX_HTML_REPORT_PANEL::generateHtml` emits an RPT_SEVERITY_ERROR line's tag in it, and it is the one colour upstream STATES for a message rather than leaving to the dialog's foreground. It was written out twice and the theme folder's "could not write" line was about to be a third. */ --error-ink: #f04040; /* [css] `decoration { box-shadow: 0 3px 9px 1px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.75) }` (:4507) — a tight drop shadow plus a 1px hairline ring, not the deep soft shadow we had invented. */ --window-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.75); /* The border colour of every framed thing: static box, button, text field, checkbox, radio. [css] `frame > border`, `button`, `entry`, `check`, `radio` all resolve to Yaru's $borders_color. [px] agrees exactly. NOTE this is NOT the same value as --chrome-border (#1e1e1e) above, which was sampled off the project manager; in the GTK theme there is only one border colour and it is this one. Flagged rather than unified, because changing --chrome-border moves every launcher at once. */ --ctl-border: #181818; /* [px] wxGauge, measured off a GtkProgressBar GTK rendered itself (qa/probes/progress_bar_probe.py). Yaru's gtk.css said a #222222 trough in a #181818 border; GTK draws #4B4B4B and no border, and the fill takes all 4 rows. The fill is the accent every other control already holds as --chrome-active. */ --gauge-trough: #4b4b4b; --gauge-fill: #e95420; --gauge-fill-edge: #eb6637; /* [css] button, entry: border-radius: 6px. Our controls used 2-3px. */ --ctl-radius: 6px; /* Outer height of a button, a text field and a combo — all three are the same, which is why a KiCad row of mixed controls lines up. [css] button { min-height: 24px; padding: 4px 9px; border: 1px } = 34 entry { min-height: 32px; border: 1px } = 34 [px] 34 for the Load Source Image button and for the Size fields. */ --ctl-height: 34px; /* Natural width of a wxTextCtrl nobody has sized — GTK's own `width-chars` default through wx, so it is theme and font derived exactly like the height above, and it is why a dialog full of unsized entries has every field the same width. A wxFormBuilder file that wants something else says `SetMinSize`; where it says nothing, this is the answer. [px] `wxTextCtrl( panel, wxID_ANY ).GetBestSize().x` reports 98 on this machine with this theme (`qa/probes/constraints_layout_probe.cpp`). */ --ctl-entry-width: 98px; /* The same for a wxComboBox, its drop-down button included: the entry part of GTK's combobox entry is narrower than a bare entry's. [px] `wxComboBox( panel, wxID_ANY, "0" )` with Footprint Properties' four orientations appended: GetBestSize().x 77 (`qa/probes/combo_best_size_probe.cpp`). */ --ctl-textcombo-width: 77px; --ctl-pad-x: 9px; /* [css] button { padding: 4px 9px } */ /* A GTK button carrying only a LABEL gets the `text-button` style class, which overrides that padding: [css] button.text-button { padding-left: 16px; padding-right: 16px } [px] measured on pcb_calculator's own buttons: "Reset to Defaults" ink runs 16 px from the left face edge and 15 from the right, "Browse" 18/18. A button with an icon keeps --ctl-pad-x (image-button is 5px). */ --ctl-pad-x-text: 16px; --ctl-face: #373737; /* [css] button { background-image: image(#373737) } [px] agrees */ --ctl-face-disabled: #2a2a2a; /* [css] button:disabled [px] agrees */ /* [css] label:disabled, entry:disabled and button:disabled all take this. GTK dims by colour, never by opacity: an opacity fade also washes out the control's background and border, which ours did. */ --ctl-fg-disabled: #929292; /* A disabled bitmap: BITMAP_STORE::GetDisabledBitmapBundle draws the icon through wxImage::ConvertToDisabled( 70 ) on a dark theme, each channel 0.4 c + 0.6 * 70/255 with alpha kept (qa/probes/convert_disabled_probe.cpp). brightness( m ) then contrast( k ) is k m c + (1 - k) / 2: k = 171/255, m = 102/171. Not an opacity - that fades the icon into what is behind it. */ --bitmap-disabled-filter: brightness(0.596491) contrast(0.670588); /* [css] `treeview.view header button { color: #8f8f8f; font-weight: bold }` in the Yaru dark stylesheet. A column header is DIMMER than the rows under it and heavier — it is a button, not a row — and neither is a shade anyone here picked. */ --tree-header-fg: #8f8f8f; /* [px] the interior of a wxTextCtrl, asked of wx itself rather than sampled: a program compiled against the installed libwxgtk3.2 creates the control and reports #272727 three ways over — GetBackgroundColour(), the style context of the GtkEntry wx makes, and a rendered pixel of the drawn widget. This said #282828 until 2026-08-21, on the stated grounds that "wx renders one level lighter" than a bare GtkEntry. That is measured false: wx paints exactly what the toolkit declares. The same run confirms --ctl-face-disabled (#2a2a2a for a disabled entry) and --ctl-height (34). (--chrome-bg2 #262626 is documented as the "inset surface" colour and is one level off this one — flagged, not changed.) */ --field-bg: #272727; --field-pad-x: 8px; /* [css] entry { padding-left/right: 8px } */ /* [css] entry:focus { border-color: rgba(239, 134, 97, 0.7) }. Note the alpha: the flat #e95420 we used before reads as a much louder orange than KiCad's, which composites to about rgb(174,101,75) over a field. */ --field-focus-border: rgb(239 134 97 / 70%); /* [css] check, radio { min-height: 14px; min-width: 14px; border: 1px } [px] the Negative box and the Symbol dot both measure 16 across. */ --check-size: 16px; /* [css] check, radio { background-image: image(#393939) } [px] agrees, and so does qa/probes/checkbox_probe.cpp, which renders the control through wxRendererNative::DrawCheckBox - the same GTK draw LAYER_WIDGET's wxCheckBox gets - and reads the unchecked face back as rgb(57,57,57). Three sources, one value. */ --check-face: #393939; /* [px] the ring around an unchecked radio on a live pcb_calculator measures rgb(25,25,25) - a shade off --ctl-border's #181818. */ --check-border: #191919; /* [px] a CHECKED radio is a solid rgb(233,84,32) disc with a 6 px white centre dot, 16 px across. Chrome's accent-color paints a ring plus a dot instead, which is why ours never matched. */ --radio-dot: 5.5px; --check-margin: 4px; /* [css] check, radio { margin: 0 4px } */ /* The tick's own ink, on the accent square. NOT --chrome-fg, which happens to be the same white: this one is Yaru's $selected_fg_color and would move with the accent if the desktop's did. [css] check:checked, radio:checked { color: #FFFFFF }. GTK draws it as check-symbolic.svg recoloured to that; we draw the equivalent glyph, so only the colour is shared. */ --check-mark: #ffffff; /* [css] check { border-radius: 3px } — a checkbox is the ONE control that is not --ctl-radius 6px. (radio { border-radius: 100% } needs no token.) */ --check-radius: 3px; /* The row a checkbox or radio occupies, indicator centred in it. [px] the Output Format radios repeat every 34 px and wxFormBuilder gives them 5 top + 5 bottom + a 2 px flexgrid vgap (bitmap2cmp_panel_base.cpp:161-193), so the control itself is 22. */ --check-row: 22px; /* The same row, for a checkbox carrying KIUI::GetInfoFont rather than the GUI font. That is `getGUIFont( win, -1 )` (common/widgets/ui_common.cpp:156) — one point down — and a point of font is a pixel of row here. [px] asked of the widget two ways, which agree: wxCheckBox::GetBestSize (qa/probes/selfilter_grid_probe.cpp) and Gtk.CheckButton's own natural height both return 21 at 10pt and 22 at 11pt, and a checkbox and a radio return the same number, so --check-row above is not wrong — it is the 11pt answer, and this is the 10pt one. PANEL_SCH_SELECTION_FILTER puts the info font on every one of its checkboxes (panel_sch_selection_filter.cpp:36-47), so its rows are 21. */ --check-row-info: 21px; /* The air GTK puts around a checkbox's parts, which is ONE number appearing three times, not three numbers. [px] asked of Gtk.CheckButton's style properties: focus-padding 1 + focus-line-width 1 + indicator-spacing 2 = 4, applied before the indicator, again between indicator and label, and again after the label. The widget's own allocation agrees on both ends: it puts its label child at x=24 from the button's left edge (4 + 16 + 4), and wxCheckBox::GetBestSize is text + 28 (4 + 16 + 4 + text + 4) for every one of the ten Selection Filter labels — the same constant ten times, which is what makes it a metric rather than a coincidence. A running eeschema confirms both ends independently: its pane edge is at x=66, its indicator's left edge at 75 (5 of wxLEFT border + this 4) and its first label pixel at 95 (a further 16 + this 4). Ours draws the indicator with `appearance: none` at exactly --check-size and gets none of that for free, so wherever we lay a checkbox beside a label, this is the padding and the gap. */ --check-inset: 4px; /* [px] the wxSlider track is 4 px of flat #4b4b4b with the filled part in the desktop accent; the thumb is a 20 px circle. [css] agrees on the thumb — scale slider { min-height: 18px; border: 1px } — and on its colours, but declares #222222 for the trough, which is not what the live window draws. */ --slider-track-height: 4px; /* [px] A GTK menu separator, asked of the `separator` node inside a realized Gtk.Menu on this theme: background #4b4b4b. It coincides with --slider-track-bg and has nothing to do with it, which is why it is its own token — a scan for literals restating a token flagged the two together and substituting would have tied the menus to the slider. Note what the same probe says about the popup itself: a `menu` node reports background #1d1d1d (= wxSYS_COLOUR_MENU), radius 6 and a border width of ZERO. The 1 px #4b4b4b edges on .ze-dropdown, .ze-tooltip and .ze-combo-popup were measured off a capture, so they may be reproducing Yaru's box-shadow as a border. Left alone rather than changed on a hunch; it wants a rendered menu sampled edge-on. */ --menu-separator: #4b4b4b; /* [data] `wxColour FOOTPRINT_CHOICE::m_grey( 0x808080 )` (common/widgets/footprint_choice.cpp:25). KiCad's own literal, NOT a theme colour - wxSYS_COLOUR_GRAYTEXT is #929292 on this machine, which is what --ctl-fg-disabled carries, and using that here would be a fifth of a channel out. A token rather than two literals because upstream has one static: the same m_grey paints the dim library prefix of a row (:111) and the rule across a separator row (:64). [px] both confirmed at exactly #808080, with no lighter antialiased pixel above them, by reading the popup window back off the display server (~/kicad-probes/fp_choice_pixels.cpp). */ --odcombo-grey: #808080; --slider-track-bg: #4b4b4b; /* [css] scale { padding: 12px } insets the trough from the widget's own box. [px] the real trough runs 1671..1893 inside a slider box of 1659..1903, i.e. 12 px in at each end. */ --slider-track-inset: 12px; --slider-thumb-size: 20px; --slider-thumb-bg: #fcfcfc; /* [css] scale slider { background-image: image(#fcfcfc) } */ --slider-thumb-border: #101010; /* [css] scale slider { border: 1px solid #101010 } */ /* A wxNotebook's tab strip. [px] 36 px tall over a 1 px bottom border, the selected tab marked by a 3 px accent bar that replaces that border; [css] notebook > header.top > tabs > tab:checked { box-shadow: inset 0 -3px } confirms the 3. [px] 12 px of padding either side of the tab label. */ --tab-strip-height: 36px; --tab-underline: 3px; --tab-pad-x: 12px; /* INDICATOR_ICON's box: KIUI::c_IndicatorSizeDIP (`include/widgets/ui_common.h:52`), the size every LAYER_WIDGET row marker and turndown is built at. [data]: KiCad's own constant, in DIP, which is px at this display's scale factor of 1. */ --indicator-size: 10px; /* COLOR_SWATCH, whose size is dialog units rather than pixels: SWATCH_SIZE_SMALL_DU(8,6) and SWATCH_SIZE_MEDIUM_DU(24,10) (include/widgets/color_swatch.h:46-47) through ConvertDialogToPixels, which is wxMulDivInt32( n, base, 4 or 8 ) and ROUNDS: (n*base + div/2) / div. [px] asked of wx itself — qa/probes builds a real wxPanel and reports GetCharWidth() 8, GetCharHeight() 18 at Ubuntu Sans 11, so small = 8*8/4 x (6*18+4)/8 = 16 x 14 medium = 24*8/4 x (10*18+4)/8 = 48 x 23 Truncating instead of rounding gives 22 for the medium height, which is the number two separate derivations here got wrong before the probe existed. Small was written as 14 x 13, which is neither: 8*8/4 is 16, not 14. A capture of a live GerbView layers pane agrees with the formula and not with the old token — the swatch there is exactly 16 x 14, hard-cornered and unbordered (`RenderToDC` sets *wxTRANSPARENT_PEN*, color_swatch.cpp:72). The -2 border adjustment in color_swatch.cpp:200-205 is inside #ifdef __WXMAC__ and does not apply. */ --swatch-small-w: 16px; --swatch-small-h: 14px; --swatch-medium-w: 48px; --swatch-medium-h: 23px; /* SWATCH_SIZE_LARGE_DU(24, 16) (color_swatch.h:48) through the same conversion: 24*8/4 x (16*18+4)/8 = 48 x 36. The colour picker's Defined Colors page is the only thing built at this size (dialog_color_picker.cpp:181). [px] a capture of that page in the real pl_editor reads a black swatch spanning exactly 48 x 36, with the parent's rgb(39,39,39) touching it on every side - a bare wxStaticBitmap, no wxBORDER_SIMPLE panel around it as a COLOR_SWATCH has. */ --swatch-large-w: 48px; --swatch-large-h: 36px; /* --- The GTK file chooser, which is the window every wxFileDialog puts up. [px] throughout, and every one is a run boundary in a capture of the real dialog — KiCad 10.0.5's Open Existing Project on Yaru-dark, profiled pixel by pixel. A live Gtk.FileChooserDialog under python-gi was asked the same questions and agrees; the two are not independent (one machine, one theme), so that corroborates the reading, not the theme. Full capture in ~/chooser-image-measurements.md and docs/proposals/file-dialog.md. Tokens rather than per-dialog values for the usual reason — upstream has one chooser and every launcher opens it. --- */ /* [px] the list row. 29, NOT 24: the selection band in the capture is 29 px tall and the Modified column's text pitches at 28.8 over ten rows, and a browse-mode probe returns get_background_area h=29 for every row. The 24 this shipped as was measured with the chooser in Recent mode, whose tree view is a different instance with a different column set - which is also why the 130 px Type width below appears nowhere in the capture. */ --chooser-row: 29px; /* [px] the column header button allocates 25 px high; its font is the list's own size in bold, and its background is the list's, so there is no separate header colour. */ --chooser-header-row: 25px; /* [px] the file list's cell renderers, read off the dialog wxFileDialog itself builds with the chooser pointed at a DIRECTORY - browse mode, not Recent. qa/probes/chooser_cells_probe.cpp; gtk-font-name was Ubuntu Sans 11 for the reading, and python-gi returns the same properties. The Name column carries TWO renderers. A GtkCellRendererPixbuf 28 px wide with xpad 6, drawing a 16 px icon at xalign 0.5 - so the icon sits 6 px into a 28 px cell - and then a GtkCellRendererText at x_offset 28 with xpad 2. That is the whole of --chooser-text-pad's reach: it is the NAME column's text renderer and nothing else. Every other column's text renderer pads 6, which is --chooser-cell-pad below. This is what reconciles the capture with the widget: the capture puts the name icon 8 px from the list's left edge while the renderer's xpad is 6, and the missing 2 is --chooser-row-inset. 647 + 2 + 6 = 655, and the capture's icon runs 655..670. */ --chooser-icon-size: 16px; --chooser-icon-pad: 6px; --chooser-text-pad: 2px; /* [px] every text renderer that is not the Name column's, and also the padding of the column header button - two separate GTK values that agree. The header's is the theme's button padding (label starts 6 px into the button, every column), not a cell renderer's xpad, which is why the header text lines up with Size/Type/Modified but not with a file name: the name starts past the 28 px icon cell. */ --chooser-cell-pad: 6px; /* [px] GtkTreeView insets a row's cell area from its background by the horizontal-separator: measured background x=0 w=578 against cell x=2 w=574. Only the cells are inset - the header buttons start at the column's own x. */ --chooser-row-inset: 2px; /* [px] the path bar band is 46 + its 1 px rule, and it sits inside the right pane - it starts at the list's left edge, not the dialog's, because the sidebar runs the full height between the header bar and the footer. */ --chooser-pathbar-height: 47px; --chooser-nav-button: 26px; /* [px] the dialog's GtkHeaderBar band is 46 + its 1 px rule. */ --chooser-headerbar-height: 47px; /* Every button in the header bar and the path bar, and the filter combo in the footer, is an ordinary GTK button: --ctl-height (34) tall, and --ctl-pad-x-text (16) either side of a label. There is no chooser-specific height, which is what a `--chooser-btn-height: 32px` here used to say - 32 is the *face* between the two 1 px borders, and setting it as the border-box height drew every one of them 2 px short. Asked of GTK rather than read off the capture (qa/probes; the same numbers the capture shows): a GtkFileChooserDialog's header bar reports its Cancel button as 78x46 with margin 6 top and bottom - so 34 drawn, centred in the 46 px band - and padding 4/16 over a min-height of 24, which is 34 again. --chooser-band-pad is that 6. [px] the header bar's *image* buttons - the search toggle - are 36 wide: GTK reports padding 5 either side of a 24 px min-width, plus the borders. They are 34 tall like the rest. */ --chooser-image-btn-width: 36px; --chooser-band-pad: 6px; /* [px] GtkDialog puts its header-bar action widgets in one horizontal size group, so the accept button is as wide as Cancel rather than as wide as its own label: GTK gives a standalone "Open" 70 and a standalone "Save" 65, but inside the dialog both come back 78 - Cancel's width. CSS has no "as wide as that sibling", so both carry Cancel's width as a floor. */ --chooser-headerbar-btn-min: 78px; /* The header bar is darker than the rest of the chrome: #222222 against the #2c2c2c the sidebar and the footer share with --chrome-bg. */ --chooser-headerbar-bg: #222222; /* GTK's `suggested-action`, which the accept button carries. Green, not the Yaru accent - the accent is the selection, and they are different colours in the same window. */ --chooser-suggested-bg: #0d761d; /* A GtkPathBar's current element is a *checked* button, which Yaru paints darker than the bar rather than filling with the accent. */ --chooser-crumb-current: #151515; /* [px] the dialog's own top corners. The bottom two are square in the capture. Fitted from the header background's leftmost-x curve: at dy=0 x=404, dy=3 x=396, dy=8 x=392 - a circle of r=12. */ --chooser-radius: 12px; /* [px] the places sidebar: 254 wide, 36 px rows on a 38 px pitch, the first 4 px down, the icon 15 px in and the label 39. */ --chooser-sidebar-width: 254px; --chooser-sidebar-row: 36px; --chooser-sidebar-gap: 2px; --chooser-sidebar-pad: 4px; --chooser-sidebar-indent: 15px; --chooser-sidebar-icon-gap: 8px; /* [px] the fixed columns, read off the capture's own header positions: Size starts at x=1330, Type at 1402, Modified at 1510, and the list ends at 1589 - so 72 / 108 / 82, with Name taking what is left as the only expanding one. GTK sizes these to their widest cell, so they are this instance's rather than a constant of the widget; the 130 they shipped as was read off the Recent-mode tree view, which is a different widget with a different column set and never appears in the browse-mode dialog at all. */ --chooser-col-size: 72px; --chooser-col-type: 108px; --chooser-col-modified: 82px; /* The border wxFormBuilder puts around a sizer item — `wxALL, 5` — which is the spacing unit of every KiCad dialog and panel, not a per-editor choice. Two stacked items are therefore 10 px apart, one against the frame edge is 5 px in. */ --wx-border: 5px; /* HOTKEY_CYCLE_POPUP's own two numbers. KiCad hardcodes them per platform — #ifdef __WXGTK__ #define LIST_BOX_H_PADDING 20 #define LIST_BOX_V_PADDING 8 common/dialogs/hotkey_cycle_popup.cpp:29-38 — so they are [data], not chrome: nothing in the theme decides them and the GTK row is the one this build takes. The H figure is the total across both edges of the list (`width + LIST_BOX_H_PADDING`, `:93`); the V figure is per edge (`height + LIST_BOX_V_PADDING * 2`, `:94`) and is ALSO the leading added to each row (`:90`). */ --hkcycle-list-h-padding: 20px; /* [data] */ --hkcycle-list-v-padding: 8px; /* [data] */ /* The shell is dark-only, and this is what tells the engine so: it paints every *native* control, scrollbar and popup from its dark palette — including the list a list, which CSS cannot reach. The rest matches those controls to KiCad's own greys rather than the browser's idea of dark. All of it is element-level under `.ze-app`, so the specific rules further down still win wherever a widget wants something different. ------------------------------------------------------------------------- */ /* WebKit engines that predate `scrollbar-width` need the pseudo-element form of the same instruction; both have to be present, because Chromium ignores ::-webkit-scrollbar rules the moment scrollbar-width is set and Safari does the opposite. Zero width is what removes the gutter; `display: none` alone leaves WebKit reserving it. */ ::-webkit-scrollbar { width: 0; height: 0; display: none; } ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-corner, ::-webkit-scrollbar-button { display: none; } /* --------------------------------------------------------------------------- The overlay indicator itself — GTK's, ported. One fixed layer over the whole document rather than a child of each pane: a child of a scroll container scrolls with the content, and wrapping ~40 panes to give each a positioned parent would change their layout. Geometry is set inline by ui/overlay_scrollbars.ts; everything that is a *value* is here. ------------------------------------------------------------------------- */ .ze-osb-layer { position: fixed; inset: 0; pointer-events: none; /* Above every dialog and popup, because the pane under a dialog is a pane. */ z-index: 2147483000; } .ze-osb { position: fixed; opacity: 0; /* Rule 1, restated: the layer is fixed and the bars are in it, so nothing here can take space from a pane. */ pointer-events: none; /* Fading OUT is the slow half; the class flip to is-visible overrides it with --osb-transition so appearing stays at GTK's 300 ms. */ transition: opacity var(--osb-fade-duration) ease-out; } .ze-osb-v { width: var(--osb-band); } .ze-osb-h { height: var(--osb-band); } .ze-osb.is-visible { opacity: var(--osb-indicator-opacity); transition: opacity var(--osb-transition); } .ze-osb.is-over { opacity: var(--osb-over-opacity); /* Only the thickened state draws the trough edge; the indicator is bare. */ box-shadow: inset 1px 0 0 var(--osb-band-edge); pointer-events: auto; } .ze-osb-h.is-over { box-shadow: inset 0 1px 0 var(--osb-band-edge); } .ze-osb-thumb { position: absolute; display: block; box-sizing: border-box; background: var(--osb-indicator-fill); border: 1px solid var(--osb-indicator-edge); transition: width var(--osb-transition), height var(--osb-transition), inset-block-end var(--osb-transition), inset-inline-end var(--osb-transition), background-color var(--osb-transition), border-color var(--osb-transition), border-radius var(--osb-transition); } .ze-osb-v .ze-osb-thumb { right: 0; width: var(--osb-indicator-size); } .ze-osb-h .ze-osb-thumb { bottom: 0; height: var(--osb-indicator-size); } /* The "over" state: the flat 3 px hairline becomes GTK's rounded grey slider, inset from the edge by the band's own padding. */ .ze-osb.is-over .ze-osb-thumb { background: var(--osb-slider-fill); border-color: transparent; border-radius: var(--osb-radius); } .ze-osb-v.is-over .ze-osb-thumb { right: var(--osb-slider-inset); width: var(--osb-slider-size); } .ze-osb-h.is-over .ze-osb-thumb { bottom: var(--osb-slider-inset); height: var(--osb-slider-size); } .ze-osb.is-over:hover .ze-osb-thumb { background: var(--osb-slider-hover); } .ze-osb.is-over:active .ze-osb-thumb { background: var(--osb-slider-active); } /* Text fields and comboboxes. The `:not(…)` list keeps the controls that are *drawn* rather than filled — a checkbox, a radio, a colour well, a slider — out of it; giving those a background and a border destroys them. `.ze-bare` is the explicit opt-out, for an entry that sits *inside* a frame its wrapper draws — a search box with a magnifier beside it, a filename with a fixed extension after it. Those need no background, border or padding of their own, and every `:not()` here counts toward specificity, which puts this rule at (0,5,1) and out of reach of any sensible stack of classes. Opting out by name beats each such entry having to find an id to win with. */ .ze-app input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not( .ze-bare ), .ze-app select, .ze-app textarea { /* A GTK `entry`, and every one of these four is the entry's own value: --field-bg #272727, --ctl-border #181818, --ctl-radius 6px and --field-pad-x 8px, all already measured and sitting in the token block. This rule wrote --chrome-bg2 / --chrome-border / 3px / 5px instead - panel chrome, not entry chrome - and being (0,1,1) it quietly beat every rule that DID name the right tokens. GerbView's `fmt:` box is where it showed: .ze-tb-textinfo at (0,1,0) states --field-bg, --ctl-border, --ctl-radius and --field-pad-x and got none of them, so the box rendered #262626 inside #1e1e1e at radius 3 with 5 px of padding against a real GerbView's #272727 inside #181818 at radius 6 with 8. That is the specificity trap in CLAUDE.md with the values the right way round: the SHARED rule was the drifted one, so restating them locally would have fixed one box and left the app wrong. Vertical padding is left alone: an entry's height is set per control (--ctl-height where it is a full-size field), not by this rule. */ background: var(--field-bg); color: var(--view-fg); /* an entry is a view: wxSYS_COLOUR_WINDOWTEXT */ border: 1px solid var(--ctl-border); border-radius: var(--ctl-radius); padding: 2px var(--field-pad-x); font: inherit; outline: none; } /* Yaru gives the ORANGE focus border to `entry` and `spinbutton` only, and at 70% alpha over the field, not the flat accent: spinbutton:focus:not(.vertical), entry:focus { box-shadow: inset 0 0 0 1px rgba(239, 134, 97, 0.7); border-color: rgba(239, 134, 97, 0.7); } A `button` — and a combo box is a button, `combobox > box > button.combo` — has no :focus rule whatsoever; all it declares is `outline-color`, which in GTK3 is the dashed keyboard-navigation rectangle, not a border. So clicking a drop-down in KiCad shows no orange at all, and that is handled on `.ze-combo` below. `select` is dropped from this rule for the same reason. */ .ze-app input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not( .ze-bare ):focus, .ze-app textarea:focus { border-color: var(--field-focus-border); box-shadow: inset 0 0 0 1px var(--field-focus-border); } /* `.ze-bare` is an entry that sits INSIDE a frame its wrapper draws, and GTK draws the focus ring on the frame — a GtkSearchEntry's ring goes round the whole box, magnifier and all, not round the text area inside it. Without the `:not()` above, a bare entry drew a second ring inset within the wrapper's, which is the doubled box on Preferences > Hotkeys' filter. */ .ze-tplsel-searchwrap:focus-within { border-color: var(--field-focus-border); box-shadow: inset 0 0 0 1px var(--field-focus-border); } .ze-app input:disabled, .ze-app select:disabled, .ze-app textarea:disabled { opacity: 0.55; cursor: default; } /* [px] wxSYS_COLOUR_GRAYTEXT, #929292. This was #8b9098 — blue 152 against red 139, the blue tint CLAUDE.md names as "the thing that read as not KiCad before a single widget had been compared". --ctl-fg-disabled already carries the measured value. */ .ze-app input::placeholder, .ze-app textarea::placeholder { color: var(--ctl-fg-disabled); } /* The accent the browser paints inside a checkbox, and the size GTK gives it. Both come from the theme, so neither is ours to pick: --chrome-active is the desktop accent and --check-size is the measured indicator. The accent used to be #e07b1a, a shade that appears nowhere in Yaru, and the Schematic Editor's dock then restated the right value locally as "the precise shade sampled off real eeschema" — which is the specificity trap: one app looked correct while every other one drifted. A live GerbView layers pane confirms it from a second app: its visibility checkboxes fill with exactly rgb(233, 84, 32), and they measure 16 across, not the 13 a bare takes from the user agent. */ /* Drawn rather than accented. `accent-color` gets the FILL right - a live GerbView's boxes are rgb(233,84,32) and so are ours - but the tick is not ours to ask for: the browser picks its own contrast colour for the mark and for this accent Chrome chooses BLACK, where GTK strokes it white. That is what Akshay saw beside a real GerbView, and no amount of accent-color can move it, so the box is drawn here instead. Every value below is measured off the real widget rather than chosen - `wxRendererNative::DrawCheckBox` renders through GTK, so it IS the widget LAYER_WIDGET puts in its visibility column (`layer_widget.cpp:347`). See qa/probes/checkbox_probe.cpp. */ .ze-app input[type="checkbox"] { appearance: none; width: var(--check-size); height: var(--check-size); border: 1px solid var(--check-border); border-radius: var(--check-radius); background: var(--check-face); } .ze-app input[type="checkbox"]:checked { border-color: var(--chrome-active); background-color: var(--chrome-active); /* The check stroke. --check-mark already holds this: Yaru's $selected_fg_color, the ink GTK recolours check-symbolic.svg to. CSS cannot interpolate a custom property into a url(), so the colour is spelled out here and `checkbox_and_swatch.test.ts` asserts it still equals the token. [px] the probe reads the stroke at rgb(255,252,252), white within antialiasing, and so does Akshay's capture of a real GerbView. */ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12 5 L6.5 11.5 L4 9' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; } /* wxCHK_UNDETERMINED: GTK's inconsistent check - Yaru's check:indeterminate is the checked face with a dash (check-mixed-symbolic) for the mark, in the same ink. */ .ze-app input[type="checkbox"]:indeterminate { border-color: var(--chrome-active); background-color: var(--chrome-active); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8 L11.5 8' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; } .ze-app input[type="checkbox"]:indeterminate:disabled { border-color: var(--ctl-border); background-color: var(--ctl-face-disabled); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8 L11.5 8' fill='none' stroke='%23929292' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); } /* A DISABLED tick is not an orange one. Yaru states this outright, for the checkbox and the radio in one rule: check:checked:disabled, radio:checked:disabled { box-shadow: none; color: #929292; <- the mark border-color: #181818; <- --ctl-border background-image: image(#2a2a2a); } <- --ctl-face-disabled so every value here is a token we already hold, and none is chosen. Ours had no `:disabled` override at all, so `updateShapeAndPins` and `updateKeywordsAndFootprintFilters` — the two DIALOG_CHANGE_SYMBOLS ticks that are SetValue(true) then Enable(false) — stayed full accent orange while KiCad greys them. Akshay's capture of the real dialog reads rgb(42,42,42) there against rgb(233,84,32) on an enabled one. The mark colour is spelled out rather than interpolated for the same reason the enabled one is — CSS cannot put a custom property inside a url() — and `checkbox_and_swatch.test.ts` asserts it still equals --ctl-fg-disabled. */ .ze-app input[type="checkbox"]:checked:disabled { border-color: var(--ctl-border); background-color: var(--ctl-face-disabled); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12 5 L6.5 11.5 L4 9' fill='none' stroke='%23929292' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } /* A wxSlider, drawn rather than accented: GTK's thumb is a WHITE disc, not a coloured one, and its trough is a flat grey with no filled portion. [px] measured on pcb_calculator's current-density slider: trough 4 px tall, rgb(75,75,75); thumb 20 px across, rgb(252,252,252) with a 1 px grey edge. */ .ze-app input[type="range"] { appearance: none; height: var(--slider-thumb-size); background: transparent; } .ze-app input[type="range"]::-webkit-slider-runnable-track { height: var(--slider-track-height); border-radius: calc(var(--slider-track-height) / 2); background: var(--slider-track-bg); } .ze-app input[type="range"]::-webkit-slider-thumb { appearance: none; width: var(--slider-thumb-size); height: var(--slider-thumb-size); margin-top: calc((var(--slider-track-height) - var(--slider-thumb-size)) / 2); border-radius: 50%; background: var(--slider-thumb-bg); border: 1px solid var(--slider-thumb-border); } .ze-app input[type="range"]::-moz-range-track { height: var(--slider-track-height); border-radius: calc(var(--slider-track-height) / 2); background: var(--slider-track-bg); } .ze-app input[type="range"]::-moz-range-thumb { width: var(--slider-thumb-size); height: var(--slider-thumb-size); border: 1px solid var(--slider-thumb-border); border-radius: 50%; background: var(--slider-thumb-bg); } /* ---- wxSlider with wxSL_LABELS / wxSL_VERTICAL (see ui/Slider.tsx) ---- GTK draws the current value beside the thumb and the two range ends at the ends of the track, each on its own label line. These rules were scoped to `.imgc-frame` in imageConverter.css and so were reachable from one launcher; the colour picker asked for the same control and got a bare range input. `--slider-frac` is where the thumb really stands, 0..1. A range input's thumb centre travels only between half a thumb in from each end, which is what the second term of each calc() corrects for — so the accent fill and the value label follow the thumb rather than the value. */ .ze-slider { position: relative; /* [data] the wxFormBuilder border around a slider at its call sites: `wxBOTTOM|wxLEFT|wxRIGHT, 5` in bitmap2cmp_panel_base.cpp:150. */ padding: 0 var(--wx-border); } /* wxSL_LABELS makes room for a label line above the track and one below. */ .ze-slider.labelled { padding-block: var(--ui-line-height); } /* GTK insets the trough 12 px from each end of the scale's own box and lets the thumb hang half over it. A range input confines its thumb inside the track instead, so the two cannot both be exact: this matches the TROUGH, which is on screen at every value. */ .ze-app .ze-slider > input[type="range"] { display: block; width: calc(100% - 2 * var(--slider-track-inset)); margin: 0 var(--slider-track-inset); /* NOT PROVEN. The +7 is a fudge that makes the label lines above and below the track clear the thumb; no GTK metric and no measurement says 7. It is the one number in this rule that is neither a token nor a citation. */ height: calc(var(--slider-thumb-size) + 7px); padding: 0; appearance: none; background: transparent; } /* scale highlight is the accent, scale trough the flat grey behind it. */ .ze-app .ze-slider > input[type="range"]::-webkit-slider-runnable-track { --slider-thumb-x: calc( var(--slider-thumb-size) / 2 + var(--slider-frac) * (100% - var(--slider-thumb-size)) ); height: var(--slider-track-height); border-radius: calc(var(--slider-track-height) / 2); background: linear-gradient( to right, var(--chrome-active) 0 var(--slider-thumb-x), var(--slider-track-bg) var(--slider-thumb-x) 100% ); } .ze-app .ze-slider > input[type="range"]::-webkit-slider-thumb { appearance: none; width: var(--slider-thumb-size); height: var(--slider-thumb-size); border-radius: 50%; background: var(--slider-thumb-bg); border: 1px solid var(--slider-thumb-border); box-sizing: border-box; margin-top: calc((var(--slider-track-height) - var(--slider-thumb-size)) / 2); } /* Centred on the thumb, wherever the thumb actually is. */ .ze-slider-val { position: absolute; top: 0; left: calc( var(--wx-border) + var(--slider-track-inset) + var(--slider-thumb-size) / 2 + var(--slider-frac) * (100% - 2 * var(--wx-border) - 2 * var(--slider-track-inset) - var(--slider-thumb-size)) ); transform: translateX(-50%); font-variant-numeric: tabular-nums; } .ze-slider-ends { position: absolute; bottom: 0; left: var(--wx-border); right: var(--wx-border); display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; } /* wxSL_VERTICAL. The control is the same one turned a quarter; `direction: rtl` with the writing mode is what carries wxSL_INVERSE - the MAXIMUM at the top, where a person expects "more" to be. Both of the colour picker's sliders have that bit (dialog_color_picker_base.cpp:124, 173). [px] the whole layout below was asked of a real wxSlider built with those very bits - qa/probes/slider_probe.cpp, on this machine with this theme. It reports a horizontal GtkBox holding GtkScale x=159 w=52 the trough, then the value text GtkBox x=211 w=24 the two range labels, one above the other so 76 across for a 0..255 range. Inside the scale: `padding: 12px` on all four sides, the 4 px trough painted at local x=12, and `value-pos=RIGHT` putting the value text at local x=28 - i.e. one more scale-padding past the trough. The range labels then start at local 52, max at the top because the scale is inverted. Every one of those numbers is a token or a sum of tokens here, and the whole arrangement is on the RIGHT. wxSL_LEFT names the constant, but wx hands GTK GTK_POS_RIGHT for it; reading the flag's name instead of measuring it is what put the labels on the left and the value under the thumb. */ .ze-slider.vertical { position: relative; display: flex; flex-direction: row; align-items: stretch; padding: 0; /* The scale (two paddings and the trough, then one label column) beside the range-label column: 12 + 4 + 12 + 24 + 24 = the measured 76. */ width: calc( 2 * var(--slider-track-inset) + var(--slider-track-height) + 2 * var(--slider-label-w) ); } .ze-app .ze-slider.vertical > input[type="range"] { writing-mode: vertical-lr; direction: rtl; /* The thumb is wider than the trough and straddles it, so the box the input needs is one thumb across, centred on where the trough goes. */ width: var(--slider-thumb-size); height: auto; flex: 0 0 auto; align-self: stretch; /* The scale's padding along the track, which is also the travel a range input's thumb centre is short of each end. */ margin-top: var(--slider-track-inset); margin-bottom: var(--slider-track-inset); margin-right: 0; /* Puts the trough's centre at the scale's left padding edge plus half a trough - local x=14, where the probe painted it. */ margin-left: calc( var(--slider-track-inset) + var(--slider-track-height) / 2 - var(--slider-thumb-size) / 2 ); } /* The fill runs from the BOTTOM of a vertical scale to the thumb, because wxSL_INVERSE puts the maximum at the top. A gradient is resolved in PHYSICAL directions whatever the writing mode, and the UA has already turned this track's box on its side - so the horizontal rule's `to right` painted from the top down, which is why a slider sitting at 0 showed a full orange track and one at maximum showed none. */ .ze-app .ze-slider.vertical > input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient( to top, var(--chrome-active) 0 var(--slider-thumb-x), var(--slider-track-bg) var(--slider-thumb-x) 100% ); } /* A vertical track is THIN across and long down, so its thickness is a width here where the horizontal rule sets a height. Left as a height it took the input's whole 20 px and the scale read as a grey slab. The two margins are PHYSICAL on purpose. `margin-inline: auto` centres along the inline axis, and the inline axis of a control in `writing-mode: vertical-lr` runs DOWN - so it centred the track along the track and left it flush against the left edge of the input, ten pixels off from the thumb. */ .ze-app .ze-slider.vertical > input[type="range"]::-webkit-slider-runnable-track { width: var(--slider-track-height); height: auto; margin-left: auto; margin-right: auto; } /* Same trap on the thumb: the horizontal rule centres it ACROSS its track with a margin-top, and that margin slides it ALONG the track once the control is turned a quarter. */ .ze-app .ze-slider.vertical > input[type="range"]::-webkit-slider-thumb { margin-top: 0; margin-left: calc((var(--slider-track-height) - var(--slider-thumb-size)) / 2); } .ze-slider.vertical.labelled { padding-block: 0; } /* The value text: GTK draws it inside the scale, one scale-padding to the right of the trough, and moves it with the thumb. The thumb's centre travels from one padding-plus-half-a-thumb below the top to the same above the bottom, counted from the TOP because wxSL_INVERSE puts the maximum there. */ .ze-slider.vertical .ze-slider-val { position: absolute; left: calc(2 * var(--slider-track-inset) + var(--slider-track-height)); width: var(--slider-label-w); /* `gtk_scale_draw_value` places the layout at the right edge of the trough area whatever the text is, so a one-digit value sits where a three-digit one starts rather than being centred under it. */ text-align: left; top: calc( var(--slider-track-inset) + var(--slider-thumb-size) / 2 + (1 - var(--slider-frac)) * (100% - 2 * var(--slider-track-inset) - var(--slider-thumb-size)) ); transform: translateY(-50%); pointer-events: none; } /* The two range labels: their own box, to the right of the scale, one at each end of the SLIDER's height rather than of the trough's - the probe puts them at local y=0 and y=height-18, above and below the trough's 12 px inset. `column-reverse` is wxSL_INVERSE: the minimum is first in the DOM and lands at the bottom. They are GtkLabels at their default xalign, so centred. */ .ze-slider.vertical .ze-slider-ends { position: absolute; top: 0; bottom: 0; left: calc(2 * var(--slider-track-inset) + var(--slider-track-height) + var(--slider-label-w)); /* The horizontal rule pins both edges; here the column is placed from the left and sized, so the inherited `right` has to be let go of. */ right: auto; width: var(--slider-label-w); display: flex; flex-direction: column-reverse; justify-content: space-between; align-items: center; pointer-events: none; } /* A wxRadioButton is DRAWN here rather than left to the engine. GTK paints a filled disc with a white centre; Chrome's accent-color paints an outline ring with a coloured dot inside it, so the two read differently at a glance however the accent is set. [px] measured on a live pcb_calculator: 16x16 overall; unchecked = rgb(57,57,57) inside a 1 px rgb(25,25,25) ring; checked = solid rgb(233,84,32), no ring, with a 6 px white dot centred (x 676..679 of a control at 670..685). */ .ze-app input[type="radio"] { appearance: none; width: var(--check-size); height: var(--check-size); flex: none; border: 1px solid var(--check-border); border-radius: 50%; background: var(--check-face); } .ze-app input[type="radio"]:checked { border-color: var(--chrome-active); background: radial-gradient( circle at 50% 50%, var(--check-mark) 0, var(--check-mark) calc(var(--radio-dot) / 2), transparent calc(var(--radio-dot) / 2 + 0.5px) ), var(--chrome-active); } .ze-app input[type="radio"]:disabled { background: var(--ctl-face-disabled, var(--check-face)); } /* The same Yaru rule, which names the radio alongside the check. The dot stays — it is what says "checked" — but it is --ctl-fg-disabled, not white on orange. Without this the rule above flattened a checked disabled radio to a plain grey disc and the dot vanished entirely. */ .ze-app input[type="radio"]:checked:disabled { border-color: var(--ctl-border); background: radial-gradient( circle at 50% 50%, var(--ctl-fg-disabled) 0, var(--ctl-fg-disabled) calc(var(--radio-dot) / 2), transparent calc(var(--radio-dot) / 2 + 0.5px) ), var(--ctl-face-disabled); } /* The list a (263 px here), and a dialog of entries, Fit() to them, came out ~2.7x KiCad's width (Footprint Properties' Position box set its three proportion-1 columns, and so the dialog). A sizer still widens it: along a slot it grows with the item (`.ze-szi-fill > *`); across one, wxEXPAND, `min-width: 100%` - a percentage that is 0 while the dialog is being sized and the slot once it is laid out, the best size and then the stretch. */ .ze-textctrl { width: var(--ctl-entry-width); box-sizing: border-box; } .ze-szi-across > .ze-textctrl { min-width: 100%; } /* TextCtrl minWidthText: the entry and an invisible line of the stated text share one grid cell, so the cell is the text's width and the entry fills it. */ .ze-textctrl-minw { display: inline-grid; } .ze-textctrl-minw > * { grid-area: 1 / 1; min-width: 0; } .ze-textctrl-minw > input { width: 100%; box-sizing: border-box; } .ze-textctrl-minw > span { height: 0; overflow: hidden; visibility: hidden; white-space: pre; } .ze-statictext-minw { display: block; height: 0; overflow: hidden; visibility: hidden; white-space: pre; } /* BACKGROUND_JOB_PANEL: wxBORDER_SIMPLE, SetBackgroundColour( wxSYS_COLOUR_3DLIGHT ) (:41-53). [px] 3DLIGHT measures #373737 on this machine (qa/probes/syscolour_probe.cpp) — the same value as 3DFACE, which is already --content-bg. */ .ze-bgjob-panel { border: 1px solid var(--chrome-border); background: var(--content-bg); color: var(--chrome-fg); display: flex; flex-direction: column; /* Every child is added with `wxALL | wxEXPAND, 1` (:59, :64, :69). */ padding: 1px; /* [data] the same 1, on the two facing sides of adjacent children. */ gap: 2px; flex: 0 0 auto; box-sizing: border-box; } /* wxFont( wxNORMAL_FONT->GetPointSize(), …, wxFONTWEIGHT_BOLD ) (:56-58) — bold at the SAME size as everything else, not a larger heading. */ .ze-bgjob-name { font-weight: bold; } .ze-bgjob-status { min-height: 1em; } /* Non-fatal open-error banner (dismiss on click). */ .ze-error-banner { padding: 6px 12px; background: #6e2020; color: #ffd9d9; font-size: 12px; cursor: default; border-bottom: 1px solid #8a2a2a; } /* --------------------------------------------------------------------------- Cursor. KiCad is a native GTK app and the pointer stays the plain arrow across the whole frame - the menu bar, an open menu, the launchers, the tree, dialog buttons, the status bar. It never becomes a hand over something clickable, because GTK does not do that for a button. Ours did, in about a hundred places, and it is one of the loudest "this is a web page" tells there is. So the rule is a policy rather than a selector: nothing in this app declares `cursor: pointer`. What may still declare a cursor is anything that is a real affordance rather than a hint that a thing is clickable - - col-resize / row-resize on a sash, - move on a drag handle, - progress while something is working, - text inside a text field (GTK does show an I-beam there), and the drawing canvases, which swap cursor per tool exactly as the desktop app does. Those set theirs inline from JS, so no rule here can reach them. */ /* STATUS_POPUP / STATUS_TEXT_POPUP (common/status_popup.ts), measured by qa/probes/status_popup_probe.cpp with KiCad's own construction: a wxPopupWindow with wxBORDER_NONE (outer = client = panel size, so no frame at all), the panel and window BTNFACE, the text BTNTEXT in the default GUI font at an 18 px line, added with wxALL 5 - "Click on new member..." is 163 x 28, text at (5, 5). BTNFACE is the same wx colour as 3DFACE. */ .ze-status-popup { position: fixed; /* Above the frame, like the top-level window it is; below a tooltip. */ z-index: 400; /* [css] */ pointer-events: none; background: var(--content-bg); } .ze-status-popup-panel { display: flex; background: var(--content-bg); color: var(--chrome-fg); font-family: var(--ui-font-family); font-size: var(--ui-font-size); line-height: var(--ui-line-height); } .ze-status-popup-text { /* m_topSizer->Add( m_statusLine, 1, wxALL | wxEXPAND, 5 ) */ margin: 5px; /* [px] the sizer border KiCad states */ white-space: pre; } /* --------------------------------------------------------------------------- Tooltip (see ui/Tooltip.tsx). Measured off a real GTK tooltip over a launcher: a 46px-tall box for one line of 11pt text, filled #0b0b0b and outlined 1px #4b4b4b. Chrome's native `title` box is 28px tall with a white outline, which is why this is drawn rather than delegated. */ .ze-tooltip { position: fixed; z-index: 500; pointer-events: none; background: #0b0b0b; border: 1px solid #4b4b4b; border-radius: 5px; padding: 13px 10px; font-size: var(--ui-font-size); line-height: 1.15; color: var(--chrome-fg); /* Toolbar tooltips are two lines separated by \n, with a tab before the hotkey (TOOL_ACTION::GetButtonTooltip). */ white-space: pre; tab-size: 4; max-width: 60vw; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); } /* ---- Project manager (home) ---- */ .ze-home-body { flex: 1; display: flex; min-height: 0; background: var(--content-bg); } /* Draggable sash between the project tree and the launchers (KiCad wxAUI pane). */ .ze-splitter { flex: 0 0 auto; width: 5px; cursor: col-resize; background: transparent; z-index: 2; } /* A wxAUI sash does not light up under the pointer; the resize cursor is the whole affordance. */ /* Horizontal variant: the sash between stacked panes in a dock column (Properties / Net Navigator / Schematic Hierarchy). */ .ze-splitter.horizontal { width: auto; height: 5px; margin-top: -1px; cursor: row-resize; } .ze-launchers { flex: 1; min-width: 0; min-height: 0; overflow: hidden; /* PANEL_KICAD_LAUNCHER_BASE: bSizerInner->Add( m_toolsSizer, 1, wxALL|wxEXPAND, 5 ) - 5px of border on every side of the tool grid. */ padding: 5px; display: flex; flex-direction: column; background: var(--content-bg); /* The notebook's own edge, on the far side of the sash. */ border-left: 1px solid #292929; } /* m_toolsSizer is a wxFlexGridSizer( 0, 2, 2, 10 ): 2 columns, a 2px vertical gap between rows and a 10px horizontal one between the icon and its text. */ .ze-tiles { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; } .ze-launcher { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 760px; /* The row *is* the grid row: the 4px of padding around the icon belongs to the BITMAP_BUTTON (see .ico below), not to the row, so putting it here would double-count it. 56px button + the sizer's 2px vgap = the 58px row pitch the desktop app lays these out on. */ padding: 0; margin: 0; border: none; border-radius: 4px; background: transparent; cursor: default; text-align: left; color: var(--chrome-fg); font: inherit; } /* Square: every hover and selection KiCad paints in this frame goes through dc.DrawRectangle. */ .ze-launcher, .ze-launcher .ico { border-radius: 0; } /* BITMAP_BUTTON::OnPaint draws dc.DrawRectangle( rect ) over the *button* - the 48px bitmap plus its 4px padding - and nothing over the label or help text. The fill is wxSYS_COLOUR_HIGHLIGHT.ChangeLightness( 40 ) in dark mode, which scales each channel to 40% (#e95420 -> #5d220d), outlined in the highlight colour itself. We were painting a 4px-rounded bar across the whole 760px row, which is most of what read as "rounded" next to the real thing. */ .ze-launcher:not(:disabled) .ico:hover { /* Sampled off a hovered launcher: fill rgb(93,33,12), outlined 1px in the highlight colour itself. That fill is wxSYS_COLOUR_HIGHLIGHT.ChangeLightness( 40 ) - each channel to 40%, so #e95420 -> (93,34,13) - which lands within one level of the measurement. Keyed off the icon's own :hover, not the row's. Upstream this rectangle is painted by BITMAP_BUTTON::OnPaint for the button it belongs to; the title and help text beside it are separate wxStaticTexts and moving over them does nothing to the button. */ background: var(--accent-fill-checked); box-shadow: inset 0 0 0 1px var(--chrome-active); } .ze-launcher:disabled { opacity: 0.45; cursor: default; } /* The BITMAP_BUTTON itself: a 48px bitmap inside BITMAP_BUTTON::SetPadding( 4 ), so the button - and therefore the hover rectangle it paints - is 56x56, not 48x48. Measured on a hovered launcher, the real outline is exactly 56 tall. */ .ze-launcher .ico { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; } .ze-launcher .ico img { width: 48px; height: 48px; } .ze-launcher .txt { display: flex; flex-direction: column; } /* CreateLaunchers() builds both labels from wxSYS_DEFAULT_GUI_FONT and only ever changes weight and slant: the title is that font bolded (the +2 point bump is #ifndef __WXGTK__, so it does not apply here) and the help line is the same size in italic, at the same undimmed colour. Ours had the title a size up and the help line a size down in grey. */ .ze-launcher .name { font-weight: 700; font-size: var(--ui-font-size); } .ze-launcher .desc { font-size: var(--ui-font-size); font-style: italic; } /* --------------------------------------------------------------------------- Project Template Selector (dialogs/dialog_template_selector.tsx). Geometry from dialog_template_selector_base.cpp: SetSizeHints( 500, 400 ), an m_panelMRU of min width 220, a splitter at sash gravity 0.35, and 5px of border on everything inside the right panel. Colours sampled off the real window: the dialog is #2c2c2c, the card list and the cards themselves #373737, ruled #181818, and the search field #272727. */ /* `dialog_template_selector_base.cpp:14` states a MINIMUM and nothing else — `SetSizeHints( wxSize( 500, 400 ), wxDefaultSize )` — and the dialog is then fitted to its content. The 652 x 440 that stood here was that minimum with our own border and project-name row added back by hand; the row is real, but it should push the dialog out by existing, not by being counted into a number. */ .ze-modal.ze-tplsel { /* [data] `SetSizeHints( wxSize( 500, 400 ), wxDefaultSize )`. */ min-width: 500px; /* [data] the same call. It said 439, which was 400 plus the project-name row measured once and frozen. */ min-height: 400px; max-width: 94vw; max-height: 90vh; } /* No padding of its own: bmainSizer->Add( m_mainContent, 1, wxEXPAND, 5 ) has no wxALL, so wx ignores that border. The 5px belongs to m_mainContent's children, which carry it individually. Ours had it here as well, which cost the template list 12 of its 400px. */ .ze-tplsel-body { flex-direction: row; padding: 0; gap: 0; } /* m_panelMRU: SetMinSize( 220, -1 ). */ .ze-tplsel-mru { flex: 0 0 220px; display: flex; flex-direction: column; min-width: 0; margin: 5px; } .ze-tplsel-mru-head { padding: 5px; font-size: var(--ui-font-size); /* The dialog's own label colour, measured at 243, not the shell's pure white. */ color: var(--chrome-fg); } /* m_scrolledMRU is wxVSCROLL with SetScrollRate( 0, 25 ) too. */ .ze-tplsel-mru-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 5px; /* m_sizerMRU adds each row with wxBOTTOM, 2. */ display: flex; flex-direction: column; gap: 2px; } /* TEMPLATE_MRU_WIDGET: a 16px icon and a KIUI::GetInfoFont label, 6px borders. */ .ze-tplsel-mru-row { display: flex; align-items: center; gap: 6px; padding: 6px; font-size: 10pt; flex: 0 0 auto; } /* icon->SetMinSize( FromDIP( wxSize( 16, 16 ) ) ) in TEMPLATE_MRU_WIDGET. Every row has a bitmap now: without meta/icon.png it is KiCad's own app icon, so there is no iconless case to style. */ .ze-tplsel-mru-row img { width: 16px; height: 16px; flex: 0 0 auto; } .ze-tplsel-mru-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* OnEnter paints HIGHLIGHT.ChangeLightness( 150 ), i.e. half way to white. */ .ze-tplsel-mru-row:hover:not(.active) { background: #f4a98f; color: #1a1a1a; } .ze-tplsel-mru-row.active { background: var(--chrome-active); color: #fff; } /* m_splitter, sash position 300 with the preview taking the rest. */ .ze-tplsel-splitter { flex: 1 1 auto; min-width: 0; display: flex; margin: 5px; gap: 4px; } /* The sash lands at 300, and the `width / 3` in EnsurePreviewSplit is a fallback that never runs. Reading that function alone gives the wrong answer: int sashPos = m_previewSashPos; if( sashPos <= 0 ) { ... sashPos = width / 3; } m_previewSashPos is not 0 by the time a template is first clicked. The base class splits at 300 in its constructor - SplitVertically( m_panelTemplates, m_panelPreview, 300 ) - and SetState( Initial ), which the dialog's constructor calls, reads that position back before it unsplits: m_previewSashPos = m_splitter->GetSashPosition(); // 300 m_splitter->Unsplit( m_panelPreview ); so the preview always re-splits at 300. m_splitterOnIdle sets the same 300 on the first idle event. A third of 640 is 213, which is why the list looked too narrow. 0 1 300px, not 0 0: 200 is SetMinimumPaneSize( 200 ) and the pane has to be able to give way to it once the dialog is near its 500px floor. */ .ze-tplsel-templates { flex: 0 1 300px; min-width: 200px; display: flex; flex-direction: column; } /* Unsplit, the list is the whole splitter - the preview pane starts Hidden and only SplitVertically brings it in. */ .ze-tplsel-splitter > .ze-tplsel-templates:only-child { flex-basis: 100%; } /* Both are 34px tall, measured. m_searchCtrl is a text entry so it is faced in the entry colour and added wxEXPAND - 400px, the width of the list below it. m_filterChoice is a wxChoice, faced like a button, added *without* wxEXPAND so it keeps its own 160. */ /* Prefixed with .ze-app so these outrank the shell's blanket `.ze-app input` / `.ze-app select` rules, which are (0,1,1) and were quietly winning: the filter was coming out --chrome-bg2 (#262626) instead of the button face the real wxChoice has. */ .ze-tplsel-searchwrap, .ze-app .ze-tplsel-filter { box-sizing: border-box; height: 34px; color: var(--view-fg); border: 1px solid var(--ctl-border); border-radius: 4px; font: inherit; margin: 5px; /* Never let the column's flex shrink these: they are fixed-height controls, and a shrink here is what silently turned the 34px search box into 21. */ flex: 0 0 auto; } /* m_searchCtrl is added wxEXPAND; m_filterChoice is not, so it keeps its own width instead of stretching. */ /* m_searchCtrl is a text entry: the entry face, #272727. The wrapper carries the frame because the control owns two painted buttons inside it - the magnifier from ShowSearchButton and the ✕ from ShowCancelButton. */ .ze-tplsel-searchwrap { width: calc(100% - 10px); background: var(--panel-bg); display: flex; align-items: center; padding: 0 8px; gap: 7px; } .ze-app .ze-tplsel-search { flex: 1 1 auto; min-width: 0; height: 100%; background: none; border: none; border-radius: 0; padding: 0; margin: 0; color: inherit; font: inherit; } .ze-app .ze-tplsel-search:focus { outline: none; } /* GTK renders both as symbolic icons in the entry's own text colour, dimmed. */ .ze-tplsel-searchwrap .mag, .ze-tplsel-searchwrap .cancel { flex: 0 0 auto; width: 16px; height: 16px; opacity: 0.65; background: currentColor; } /* Adwaita's system-search-symbolic and edit-clear-symbolic, the two GTK hands wxSearchCtrl, traced as paths so they tint with currentColor. */ .ze-tplsel-searchwrap .mag { -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.6' d='M7 2.2a4.8 4.8 0 1 0 0 9.6 4.8 4.8 0 0 0 0-9.6zm3.6 8.4L14 14'/%3E%3C/svg%3E") center / 16px 16px no-repeat; mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.6' d='M7 2.2a4.8 4.8 0 1 0 0 9.6 4.8 4.8 0 0 0 0-9.6zm3.6 8.4L14 14'/%3E%3C/svg%3E") center / 16px 16px no-repeat; } .ze-tplsel-searchwrap .cancel { -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 .8a7.2 7.2 0 1 0 0 14.4A7.2 7.2 0 0 0 8 .8zm3 9.1-1.1 1.1L8 9.1l-1.9 1.9L5 9.9 6.9 8 5 6.1 6.1 5 8 6.9 9.9 5 11 6.1 9.1 8z'/%3E%3C/svg%3E") center / 16px 16px no-repeat; mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 .8a7.2 7.2 0 1 0 0 14.4A7.2 7.2 0 0 0 8 .8zm3 9.1-1.1 1.1L8 9.1l-1.9 1.9L5 9.9 6.9 8 5 6.1 6.1 5 8 6.9 9.9 5 11 6.1 9.1 8z'/%3E%3C/svg%3E") center / 16px 16px no-repeat; } .ze-tplsel-searchwrap .cancel:hover { opacity: 1; } /* Carried on the input's own class rather than as `.ze-tplsel-searchwrap input`: a descendant type selector has to be qualified with .ze-app to outrank the shell's blanket `.ze-app input`, and that lands high enough to make every later plain `input` rule in this file report as descending specificity. */ /* A bare entry, drawn by whatever frames it rather than by itself; the search boxes (the template selector's and PANEL_HOTKEYS_EDITOR's filter) sit inside `.ze-tplsel-searchwrap` and wear this. `.ze-bare` on the element is what keeps the shell's blanket entry rule off it - see that rule for why a class alone could not. */ .ze-tplsel-nameinput { box-sizing: border-box; /* Fills the box it is framed by, rather than sizing to its own content. */ flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; margin: 0; font: inherit; color: var(--chrome-fg); background: none; border: none; border-radius: 0; outline: none; } /* No width or height. `dialog_hotkey_list.cpp:79` states a MINIMUM and nothing else — `main_sizer->SetMinSize( 600, 400 )` — and the dialog is then fitted to its content, whose width is the four columns the hotkey list declares. The 1000 x 560 here was derived from those column totals rather than stated by anyone, so it is the list that should set the width, not a number. */ .ze-modal.ze-hotkeys { /* [data] `main_sizer->SetMinSize( 600, 400 )`, dialog_hotkey_list.cpp:79. */ min-width: 600px; /* [data] the same call. */ min-height: 400px; resize: both; max-width: 96vw; max-height: 92vh; } .ze-hotkeys-body { flex-direction: column; /* The panel is added with KIUI::GetStdMargin(), which is 5 on GTK. */ padding: 5px; gap: 5px; } /* PANEL_HOTKEYS_EDITOR's own mainSizer, which both the Hotkey List and the Preferences page host. Its three children are the filter box, the tree, and the button row - and only the tree grows, so the buttons stay put as the window resizes. */ .ze-hotkeys-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; /* bMargins carries wxTOP|wxRIGHT 5 on both children. */ gap: 5px; } .ze-hotkeys-filter { flex: 0 0 auto; margin: 0; width: auto; } /* Scrolls BOTH ways, and its own size is neither of its content's. The columns total 1590 and the list is ~200 rows long; a wxTreeListCtrl is a scrolled control whose best size is its own, which is the whole point of giving column 3 a width of 900 and of a list this long having a scrollbar. `PAGED_DIALOG` therefore comes out ~1095 x 713 on this theme whichever page is showing, because `GetBestSize()` never sees those 1590 px or those rows. A CSS scroll container is the opposite by default: it offers its content's max-content size to its parent's intrinsic sizing in both axes, so this page pushed the dialog to BOTH of its caps — 1500 px wide from the columns, 900 px tall from the rows. `contain: size` says the size is the control's own. The two pairs beside it are what every engine acts on: a definite `width: 0` contributes nothing and `min-width: 100%` stretches the control back over the page, and a flex basis of 0 does the same job on the block axis, where `flex: 1 1 auto` had handed the whole list's height up as the item's hypothetical main size. */ .ze-hotkeys-list { flex: 1 1 0; min-height: 0; contain: size; width: 0; min-width: 100%; overflow: auto; background: var(--panel-bg); border: 1px solid var(--ctl-border); border-radius: 4px; } /* The wxTreeListCtrl's column header. */ .ze-hotkeys-head { display: flex; width: max-content; min-width: 100%; position: sticky; top: 0; z-index: 1; /* [css] `treeview.view header button`: `background-color: #272727` (the same ground as the rows — `--panel-bg`), `color: #8f8f8f`, `font-weight: bold`, `padding: 0 6px`, and `border-style: none solid solid none` in `#2c2c2c`, which is the dialog's own ground. This said `--content-bg` (#373737) and `--chrome-fg` at normal weight, so the header read lighter and flatter than the rows instead of dimmer and heavier. No font-size: a treeview takes the GUI font, and stating one is what made this list smaller than KiCad's. */ background: var(--panel-bg); border-bottom: 1px solid var(--chrome-bg); /* [css] `treeview.view header button { padding: 0 6px }`; the 2 above and below is [px] the 24 px header the capture shows, against a 20 px line. */ padding: 2px 6px; font-weight: bold; color: var(--tree-header-fg); } /* AppendColumn's widths, verbatim: 450 / 120 / 120 / 900. A wxTreeListCtrl keeps its column widths and scrolls sideways when the window is narrower than their sum (1590), which is why a real Hotkey List truncates "Show 3D Models even if..." in the Command column and carries a horizontal scrollbar. Ours shrank the columns to fit instead, so nothing ever truncated and the proportions were never upstream's. */ .ze-hotkeys-head .cmd, .ze-hotkeys-row .cmd { flex: 0 0 450px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ze-hotkeys-head .key, .ze-hotkeys-row .key, .ze-hotkeys-head .alt, .ze-hotkeys-row .alt { flex: 0 0 120px; min-width: 0; overflow: hidden; white-space: nowrap; } /* No colour of its own. Every cell of a wxTreeListCtrl is drawn in the view's foreground — `.view { color: white }` — and `WIDGET_HOTKEY_LIST` sets an attribute on exactly one thing, the bold on a rebound key. This dimmed the whole Description column to #9a9a9a, which is a shade nothing in the theme states. */ .ze-hotkeys-head .desc, .ze-hotkeys-row .desc { flex: 0 0 900px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* A section is a top-level tree row: bold, and its children indented under it. */ /* A top-level tree row: the twisty, then the section name. */ .ze-hotkeys-sectionhead { display: flex; align-items: center; gap: 6px; cursor: default; padding: 6px 8px 4px; font-size: var(--ui-font-size); font-weight: 700; color: var(--chrome-fg); } /* A row of the tree. NO font-size: `wxTreeListCtrl` calls SetFont nowhere, so it draws in the GUI font — 11 pt / 14.67 px — and this said 10 pt, which is why every row of the list read a size smaller than KiCad's. The ink is the VIEW's, `.view { color: white }` = `--view-fg`, not the dialog chrome's #F7F7F7; and [px] the 2 px above and below is GtkCellRendererText's `ypad`, which puts the rows 24 px apart as the capture shows. */ .ze-hotkeys-row { display: flex; width: max-content; min-width: 100%; /* [px] GtkCellRendererText's `ypad` of 2 above and below, which puts the rows the 24 px apart the capture measures; the 24 px indent is the expander column a child row sits after. */ padding: 2px 8px 2px 24px; color: var(--view-fg); } .ze-hotkeys-row:hover { background: var(--chrome-hover); } /* wxTL_SINGLE's selected row, painted in wxSYS_COLOUR_HIGHLIGHT - the same orange the project tree and the template cards select with. */ .ze-hotkeys-row.selected, .ze-hotkeys-row.selected:hover { /* [css] `treeview.view:selected { background-color: #E95420 }` and, in the rule under it, `color: #FFFFFF` — which is --chrome-active and --view-fg. A selected row has ONE foreground; the #ffe6d9 that was here for the Description column is not in the stylesheet at all. */ background: var(--chrome-active); color: var(--view-fg); } /* updateFromClientData paints a rebound row's key in bold: if( changed ) SetItemText( i, 1, ... ) with a bold attr so a user can see at a glance which bindings are theirs rather than KiCad's, without comparing every row against a default they cannot see. */ .ze-hotkeys-row.changed .key { font-weight: 600; } /* A combo the browser reserves - Ctrl+N, Ctrl+W - which reaches the app only in fullscreen. Struck through rather than hidden: the binding is real and is what upstream uses, and a row with an empty Hotkey cell would read as a command with no key at all. */ .ze-hotkeys-row .key.taken { text-decoration: line-through; /* The ink GTK gives text that cannot be acted on: `treeview.view:disabled { color: #929292 }`, which --ctl-fg-disabled already carries. This stated #9a9a9a and #7a7a7a, neither of them a colour the theme names. */ color: var(--ctl-fg-disabled); text-decoration-color: var(--ctl-fg-disabled); } .ze-hotkeys-row.selected .key.taken { /* [css] `treeview.view:disabled:selected { color: #f4aa90 }`. */ color: #f4aa90; text-decoration-color: #f4aa90; } /* Double-click to rebind is the editable panel's gesture, so the rows say so with the cursor; the read-only list keeps the arrow. */ .ze-hotkeys-row[title] { cursor: default; } /* BUTTON_ROW_PANEL (widgets/button_row_panel.tsx): every button bordered wxTOP|wxBOTTOM and on each side but the row's outer ends, at KIUI::GetStdMargin(); a stretch spacer between the left and right groups. */ .ze-button-row { display: flex; align-items: center; } .ze-button-row > .ze-btn { /* [data] KIUI::GetStdMargin() returns 5 (ui_common.cpp:49-53) */ margin: 5px; } .ze-button-row > .ze-btn.first-left { margin-left: 0; } .ze-button-row > .ze-btn.last-right { margin-right: 0; } .ze-button-row-spacer { flex: 1 1 0; } /* The two button groups: the panel's own row on the left, the dialog's wxStdDialogButtonSizer on the right. Qualified with .ze-modal-footer deliberately. That rule sets `justify-content: flex-end` and sits ~2400 lines further down this file; at equal specificity the later one wins, so a bare .ze-hotkeys-foot lost and both groups packed right - which is what they were still doing. */ .ze-modal-footer.ze-hotkeys-foot { justify-content: space-between; } .ze-hotkeys-foot .left, .ze-hotkeys-foot .right { display: flex; align-items: center; gap: 8px; } /* What an import did. Upstream drops an unmatched name silently, which it can afford because the file it reads was written by the same action names; a file from a real KiCad names actions we do not have, and a button that quietly changes nothing reads as a broken one. */ .ze-hotkeys-imported { color: var(--ctl-fg-disabled); } .ze-hotkeys-empty { padding: 14px; color: var(--ctl-fg-disabled); } /* A wxMenu takes the pointer grab, so a click anywhere else dismisses it. */ .ze-tplsel-ctxscrim { position: fixed; inset: 0; z-index: 999; } /* m_filterChoice is a wxChoice: the *button* face, #373737. */ .ze-app .ze-tplsel-filter { align-self: flex-start; width: 160px; background: var(--content-bg); } /* m_scrolledTemplates is created wxVSCROLL and given SetScrollRate( 0, 25 ): a zero rate on x means it never scrolls sideways. A card keeps its SetMinSize( FromDIP( wxSize( 200, -1 ) ) ) and is simply clipped when the pane is narrower - which it is once the preview takes two thirds, and again at the dialog's 500px minimum. Without this the min-width pushed a horizontal scrollbar into a list that has never had one. */ .ze-tplsel-list { flex: 1 1 auto; min-height: 200px; overflow-y: auto; overflow-x: hidden; background: var(--content-bg); margin: 5px; display: flex; flex-direction: column; gap: 8px; } /* TEMPLATE_WIDGET_BASE: wxBORDER_THEME, an icon with wxTOP|wxBOTTOM|wxLEFT 5, then the title over the description with wxALL 5. SetMinSize( 200, -1 ). */ .ze-tplsel-card { display: flex; align-items: flex-start; background: var(--content-bg); border: 1px solid var(--ctl-border); /* wxBORDER_THEME draws the GTK frame, which is rounded: tracing the border on a real card, it arcs over about 5px at every corner. */ border-radius: 5px; min-width: 200px; flex: 0 0 auto; } /* c_bitmapSizes[0] = 48, and the icon's border is wxTOP|wxBOTTOM|wxLEFT, 5. */ .ze-tplsel-card img { width: 48px; height: 48px; flex: 0 0 auto; margin: 5px 0 5px 5px; } .ze-tplsel-card .txt { display: flex; flex-direction: column; min-width: 0; margin: 5px; } /* Both labels are KIUI::GetInfoFont - one point down - the title bolded. */ .ze-tplsel-card .name { font-size: 10pt; font-weight: 700; } .ze-tplsel-card .desc { font-size: 10pt; } .ze-tplsel-card.active { background: var(--chrome-active); color: #fff; } /* m_panelPreview, split in only from the Preview states. */ .ze-tplsel-preview { /* Whatever the sash leaves; see .ze-tplsel-templates. */ flex: 1 1 auto; min-width: 200px; display: flex; overflow: auto; background: var(--panel-bg); border: 1px solid var(--ctl-border); border-radius: 4px; margin: 5px; } /* The WEBVIEW_PANEL. The page paints its own background once OnWebViewLoaded's stylesheet is in - see template_preview_styles.ts - so the frame only needs to match --bg-primary for the moment before that lands. */ .ze-tplsel-html { flex: 1 1 auto; min-width: 0; border: none; background: #1e1e1e; } .ze-tplsel-info { padding: 18px 20px; line-height: 1.55; } .ze-tplsel-info h2 { margin: 0 0 10px; font-size: 1.25em; font-weight: 600; } .ze-tplsel-info p { margin: 0 0 12px; color: #c9cbce; } .ze-tplsel-info ul { margin: 0; padding-left: 18px; color: #9a9ca0; font-size: 10pt; } .ze-tplsel-info.welcome { margin: auto; text-align: center; } .ze-home-link { padding: 0 12px; display: flex; align-items: center; /* The gap between the mark and the name. [px] the menubar's own item padding halved: 12px on the outside, 6px between two things that read as one. */ gap: 6px; cursor: default; font-weight: 700; color: #4a86c5; } .ze-home-link:hover { background: var(--chrome-hover); } /* In the project manager the mark is a label: there is nowhere to go from home, so it must not light up under the pointer like the launchers' link does. */ .ze-home-link-static:hover { background: none; } /* The project manager's own tree (PROJECT_TREE, kicad/project_tree.cpp). Scoped to this pane because its two metrics are set on the control itself and are not shared with the editors' trees: SetFont( KIUI::GetControlFont() ), which is wxSYS_DEFAULT_GUI_FONT at its default size, and LoadIcons()'s c_fileDefSize = 22 for the per-row file icons (18px here before). The 1px row padding is what keeps the pitch at the 24px the real tree lays out on once the icon is 22px tall. */ /* The wxTreeCtrl's own GTK frame, and the reason the pane looks subtly *curved* next to ours: the control is not a flush panel, it is a box filling the pane under the caption with a 1px #181818 outline and ~6px rounded corners. Traced off the real frame - the top rule stops at x=105 and the left rule starts at y=117, a 6x6 arc, mirrored at all four corners. The pane therefore carries no border of its own and the caption no rule under it; both of those lines *are* this box's top and side edges. */ .ze-panel.left.ze-projecttree { border-right: none; } .ze-projecttree .ze-panel-header { border-bottom: none; } .ze-projecttree .ze-panel-body { /* Square, not rounded. Measured across a running pane at y=300: a 1px rgb(24,24,24) rule at x=100 and x=494 with rgb(39,39,39) between, running straight into the corners — the tree control's own frame, edge to edge under the caption. The 6px radius here made the body read as a floating card and left the caption looking detached from it. */ border: 1px solid var(--ctl-border); /* Vertically the rows butt straight onto the frame - the first row starts on the pixel after the top rule. The 9px of lead-in puts the root row's twisty 15px from the frame, where the real control's root indent puts it. */ padding: 0 0 0 9px; } .ze-projecttree .ze-tree-item { /* A 24px row holding a 22px icon: the icon centres with a pixel either side, and the highlight - which is the full row height in the real tree - can stretch to all 24 rather than to the 22 a padded row would leave it. */ height: 24px; padding-top: 0; padding-bottom: 0; /* Measured: the highlight begins 4px past the icon's right edge. */ gap: 4px; border-radius: 0; background: none; } /* PROJECT_TREE is built with PLATFORM_STYLE | wxTR_HAS_BUTTONS | wxTR_MULTIPLE. wxTR_FULL_ROW_HIGHLIGHT is absent - and appears nowhere in KiCad at all - so the highlight is not the row. Measured on a real selected row: it starts 4px *after* the icon ends and runs to just past the text, square, first=171 last=425 on every one of its 24 rows. So it belongs to the label alone; the icon and the twisty stay on the tree background. */ .ze-projecttree .ze-tree-name { align-self: stretch; display: flex; align-items: center; padding: 0 3px; } .ze-projecttree .ze-tree-item.active { background: none; } .ze-projecttree .ze-tree-item.active .ze-tree-name { background: var(--chrome-active); /* Not bold, and nothing here has to say so any more: `.ze-tree-item.active` used to carry a `font-weight: 700` this rule existed to escape. The measurement that disproved it stands - "…kicad_sym" selected is 246px against "…kicad_sch" unselected at 242px, and that 4px is 'm' against 'h'; bold would have cost about ten. (Trees elsewhere really do bold a row, but via SetItemBold on the *active* item, which is a different thing to selection.) */ font-weight: 400; /* 2px of highlight.ChangeLightness( 120 ) - each channel to 80% toward white, so #e95420 -> #ed764d - inset so the box stays exactly one row. */ box-shadow: inset 0 0 0 2px #ed764d; color: #fff; } /* wxTreeCtrl marks selection and nothing else - moving the pointer over a row leaves it exactly as it was. Both the row and the label are pinned to no background here so the shared .ze-tree-item:hover rule cannot reach them. */ .ze-projecttree .ze-tree-item:hover:not(.active), .ze-projecttree .ze-tree-item:hover:not(.active) .ze-tree-name { background: none; } .ze-projecttree .ze-tree-item img { width: 22px; height: 22px; } /* Project-manager left toolbar (narrow vertical strip) */ /* An EDA_PANE().VToolbar() docked on the frame, so it sits on the frame background rather than the menu/status bar grey. */ .ze-mgrbar { display: flex; flex-direction: column; align-items: center; /* Measured off the real pane: 34px wide, 32px button pitch (so no gap between them), 4px of lead-in at the top. */ width: 34px; padding: 4px 0; gap: 0; background: var(--content-bg); border-right: 1px solid var(--chrome-border); } .ze-mgrbar button { width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 0; background: transparent; cursor: default; display: flex; align-items: center; justify-content: center; } .ze-mgrbar button:hover { background: var(--accent-fill-checked); border-color: var(--chrome-active); } /* common_settings.cpp: appearance.toolbar_icon_size defaults to 24. */ .ze-mgrbar img { width: 24px; height: 24px; } /* wxAuiToolBar draws its separators a good deal lighter than a window border - #5f5f5f on the #373737 bar. Ours used --chrome-border, which read as a black gouge across the strip rather than a hairline. */ .ze-mgrbar .sep { width: 22px; height: 1px; background: var(--toolbar-separator); margin: 3px 0; } /* Editor left dock: stacked Properties / Hierarchy / Selection Filter */ .ze-leftdock { display: flex; flex-direction: column; width: 240px; } /* What separates a dock from the toolbar beside it is wxAUI's SASH, not a rule. Every pane docked here is added with `PaneBorder( false )` — pcbnew's Properties and Appearance (pcb_edit_frame.cpp:345,382), GerbView's Layers Manager (gerbview_frame.cpp:170), the project tree (kicad_manager_frame.cpp:236) — so wxAUI draws no border at all and the only thing between the pane and its neighbour is `wxAUI_DOCKART_SASH_SIZE` of `wxAUI_DOCKART_SASH_COLOUR`: 5px of #373737, the same face as the toolbar, which is why the two read as one strip. [px] pcbnew 1920x1200, scanned at y=1000: the Properties pane ends at x=365, then #373737 through x=370, then the 34px left toolbar at 371..404. Ours drew 1px of --chrome-border there and rendered the sash into a column, where a `width`-only rule collapses it to nothing — so our strip measured 35px against KiCad's 40 and had a black rule down its outer edge. The rule survives only for a dock that has NOT been given its sash yet (SymbolEditor, SchematicEditor, FootprintEditor, the project manager); without it those butt straight into the canvas. Scoped rather than restated so that giving one of them a `` is the whole change. */ .ze-leftdock:not(:has(+ .ze-dock-sash)) { border-right: 1px solid var(--chrome-border); } /* The same dock column on the other side, for pl_editor's Props pane — `.Right().Layer( 3 )`, outside the RightToolbar's `.Layer( 2 )` (pl_editor_frame.cpp:197-204). Only the edge that carries the separator differs, because that edge is the one facing the canvas. Deliberately NOT `.ze-rightdock`: that is pcbnew's Appearance + Selection Filter stack, which stacks two panes in one dock and clips them so only the notebook scrolls. `min-width` is the pane's `.MinSize( m_propertiesPagelayout->GetMinSize() )` (pl_editor_frame.cpp:203) — the panel's own content minimum, which wxAUI takes over BestSize whenever it is larger. The width is content, the way `.ze-modal` is `Fit()`. This one keeps its border where the docks above lose theirs, because this pane is the one that asked for it: `EDA_PANE().Palette()` sets `PaneBorder( true )` (eda_base_frame.h:965-970) and pl_editor never turns it back off, unlike pcbnew and GerbView. So the colour is wxAUI's border, not --chrome-border, and it sits INSIDE the sash: canvas, toolbar, 5px sash, 1px #292929, pane. */ .ze-leftdock.on-right { border-right: none; border-left: var(--aui-pane-border-size) solid var(--aui-pane-border); min-width: min-content; } /* The centre pane and whatever wxAUI puts in LAYER 0 around it. A `.Bottom()` pane with no `.Layer()` call takes the default layer 0, and wxAUI nests docks outward by layer, so it is the innermost ring: it spans only the width of the canvas, and the left/right docks (layer 3) and the toolbars (layer 2) run their full height alongside it. That is why this is a column of its own rather than a rule on `.ze-canvas-wrap` — the wrap is the centre pane, and the layer-0 docks are its siblings, not its children. `.ze-canvas-wrap` keeps its `flex: 1` here and grows down the column instead of across the row; `min-height: 0` is what lets it shrink when the dock below it is dragged taller. */ .ze-canvas-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; } /* A pane docked at the bottom of that column — eeschema's and pcbnew's Search panes (`sch_edit_frame.cpp:290-300`). Height comes from the pane's own `BestSize`/`MinSize` and is set on the element, the way the left dock's width is. No edge of its own: the Search pane is `.PaneBorder( false )` (pcb_edit_frame.cpp:403-405), so the only line between it and the canvas is the canvas pane's own border, which .ze-canvas-wrap draws. This carried a --chrome-border of its own, which doubled that line the moment the pane was opened. */ .ze-bottomdock { flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; } /* ---- The eeschema left dock and HIERARCHY_PANE ------------------------------ Three of the four panes in this column are `EDA_PANE().Palette()` — `PaneBorder( true )` (eda_base_frame.h:965-970): the hierarchy (sch_edit_frame.cpp:260), Properties and the Net Navigator (eeschema_settings.cpp:74, :96). wxAUI draws that border as 1px of wxAUI_DOCKART_BORDER_COLOUR round caption and content together, and puts wxAUI_DOCKART_SASH_SIZE of wxAUI_DOCKART_SASH_COLOUR between neighbouring panes. The Selection Filter alone is `PaneBorder( false )` (eeschema_settings.cpp:118), so its caption sits straight on the sash. [px] eeschema 10.0.5, 1920x1200, one column at x=200 top to bottom: Properties' grid ends, #181818 (the grid's own frame), #292929 (pane border), 5px #373737 (sash), #292929 (pane border), 17px #2E2E2E (caption), #181818 (the tree's own frame), tree #272727 … #181818, #292929, 5px #373737, then 17px #2E2E2E (the Selection Filter's caption) straight into #373737, the panel face, with no #292929 either side of it. Across at y=900: #292929 at the dock's left edge, the tree frame, the tree, the frame, #292929, then the 5px sash and the 34px left toolbar. Ours drew every pane in --panel-bg with a #1e1e1e rule under it, a transparent 5px sash and no pane border, and the Selection Filter's body in --panel-header, so it read as a box of its own instead of running into the frame below. */ .sch-leftdock { background: var(--aui-sash); } .sch-leftdock > .ze-panel.grow { border: var(--aui-pane-border-size) solid var(--aui-pane-border); } .sch-leftdock > .ze-splitter.horizontal { margin-top: 0; background: var(--aui-sash); } /* The caption is the 17px strip `.ze-panel-header` already states. This carried `padding: 3px`, which stacked 6px on the 8pt line and made every caption in the column 20px — the shared rule is right, so nothing is said here. */ /* HIERARCHY_TREE (eeschema/widgets/hierarchy_pane.h:13-21): wxTreeCtrl( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS | wxTR_HIDE_ROOT, ... ) On GTK that is wxGenericTreeCtrl, which paints every row itself (src/generic/treectlg.cpp, PaintLevel :2765 / PaintItem :2556), so the layout below is its arithmetic, not a flex approximation of it — every number is either wx's own or read off the realised widget by `qa/probes/hierarchy_tree_probe.cpp`: m_indent 15, m_spacing 18 (Init, :984-985) row height 24: char height 18 + 4, + 2 (CalculateLineHeight, :2427-2472) first row at y = 2 (OnPaint, :3052) level L x = 15L; item X = x + 18; icon 16px at X, y + 4; text at X + 16 + MARGIN_BETWEEN_IMAGE_AND_TEXT(4) (:2801, :2716) lead-in y_mid, from x - m_indent (x itself at level 1) to X (:2864-2870) trunk at x, from y_mid + 5 ("if (HasButtons) y_mid += 5") to the last child's y_mid (:2928-2952) button a 9x9 DrawTreeItemButton centred on (x, y_mid) (:2895-2913) selection from X + 17 to the text's end + 3, the full row height, and nothing under the icon (:2632-2648) current SetItemBold + SetFocusedItem (hierarchy_pane.cpp:145-190), and SetFocusedItem is SelectItem in this control (:2020), so the current sheet is the selected row and shows its selected image, tree_sel, where the rest show tree_nosel The control's origin is the frame line itself — [px] the trunk is at x=15 and the first row at y=2 counted from the #181818 pixel — so the content box, which starts one pixel in, sees every wx x as x - 1. That is the "- 1px" in --x, and the 1px of padding-top is wx's y = 2 less the same. The dotted pen is `wxPen( wxSYS_COLOUR_GRAYTEXT, 1, wxPENSTYLE_DOT )` (:1084). What lands on screen is not GRAYTEXT's #929292 nor a 1-on-1-off dot: [px] two pixels of #858585 then two of the tree's #272727, in phase with the line's start, on both the lead-ins and the trunk. So the guides are drawn as that pattern rather than with `border-style: dotted`, whose round 1px dots are a different mark. */ .ze-hiertree { /* [data] wx paints from y = 2 (treectlg.cpp:3052) inside the frame's own pixel; see above. */ padding: 1px 0 0; border: 1px solid var(--ctl-border); background: var(--chrome-bg2); overflow: auto; position: relative; /* [px] the on-pixels of the dotted guides, measured on the tree. */ --hier-guide: #858585; } .ze-hier-node { position: relative; /* wx's x for this level, in the content box's coordinates. `--lvl` is set inline per node; 1 is the top-level sheet, the hidden root being level 0. */ --x: calc(var(--lvl) * 15px - 1px); --X: calc(var(--x) + 18px); } .ze-hier-row { position: relative; /* [px] GetLineHeight(): 18 + 4 + 2 with this machine's 11pt font, read back by qa/probes/hierarchy_tree_probe.cpp (every row h=24). */ height: 24px; white-space: nowrap; cursor: default; } /* The lead-in: from the parent's trunk to the icon, at y_mid. A top-level sheet has no parent trunk; its line starts at its own x, under the button. */ .ze-hier-guide { position: absolute; top: 12px; height: 1px; left: calc(var(--x) - 15px); width: 34px; background: repeating-linear-gradient(to right, var(--hier-guide) 0 2px, transparent 2px 4px); } .ze-hiertree > .ze-hier-node > .ze-hier-row > .ze-hier-guide { left: var(--x); width: 19px; } /* The trunk, one segment per child so it also runs past an expanded child's own subtree: the full node for a middle child, down to y_mid for the last. The first child's segment reaches 7px above its row — the parent's y_mid + 5 — and the dash phase is counted from there, which is what the two background-position values keep in step across 24px rows. */ .ze-hier-children > .ze-hier-node::before { content: ""; position: absolute; left: calc(var(--x) - 15px); top: 0; bottom: 0; width: 1px; background: linear-gradient(var(--hier-guide) 0 2px, transparent 2px 4px) 0 1px / 1px 4px repeat-y; } .ze-hier-children > .ze-hier-node.first::before { top: -7px; background-position: 0 0; } .ze-hier-children > .ze-hier-node.last::before { bottom: auto; /* [data] to y_mid, half the row (treectlg.cpp:2803, 2931). */ height: 12px; } .ze-hier-children > .ze-hier-node.first.last::before { /* [data] the same 12, plus the 7 above the row. */ height: 19px; } /* DrawTreeItemButton's 9x9 rect. GTK renders its expander arrow into it: [px] a 9px-wide chevron, peak #B4B4B4 on the tree's ground, 4 rows deep with its point one row below y_mid. Collapsed, the same arrow points right. */ .ze-hier-button, .ze-gentree-button { position: absolute; left: calc(var(--x) - 4px); top: 8px; width: 9px; /* [data] FromDIP(9) (treectlg.cpp:2895-2896). */ height: 9px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpolyline points='0.5,2.5 4.5,6.5 8.5,2.5' fill='none' stroke='%23c0c0c0' stroke-width='1.5' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") center / 9px 9px no-repeat; } .ze-hier-button:not(.open), .ze-gentree-button:not(.open) { transform: rotate(-90deg); } /* [data] BITMAPS::tree_nosel / tree_sel, the dark set (resources/bitmaps_png/ sources/dark/tree_nosel.svg, tree_sel.svg): a circle r=10 in a 24-unit box, #8f8f8f and #42B8EB, rasterised at 16px as the 16px PNGs are. */ .ze-hier-icon { position: absolute; left: var(--X); top: 4px; width: 16px; /* [art] tree_nosel_dark_16.png / tree_sel_dark_16.png, the 16px raster. */ height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%238f8f8f'/%3E%3C/svg%3E") center / 16px 16px no-repeat; } .ze-hier-icon.sel { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2342B8EB'/%3E%3C/svg%3E"); } /* In flow rather than absolute so a long name still widens the row and the tree scrolls. The 3px each side is the selection band's reach past the text (rect.x -= 1, width += 2 on top of the -2/+2 at :2632-2640), which also puts the text at X + 20. */ .ze-hier-label { display: inline-block; /* [data] the band starts at X + 17 (treectlg.cpp:2632-2640). */ margin-left: calc(var(--X) + 17px); /* [px] the row, as above. */ height: 24px; /* [px] the row again: DrawText centres text_h in total_h (:2722-2725). */ line-height: 24px; /* [data] rect.x -= 1, width += 2 over the -2/+2 (treectlg.cpp:2632-2640). */ padding: 0 3px; color: var(--view-fg); vertical-align: top; } /* DrawItemSelectionRect: GTK's selected-row fill — flat, square-cornered, [px] #E95420 whether or not the tree has focus — under HIGHLIGHTTEXT, and the row is the bold one. */ .ze-hier-label.sel { background: var(--chrome-active); color: #fff; font-weight: 700; } /* The same wxGenericTreeCtrl with the Net Navigator's style word (createHighlightedNetNavigator, sch_edit_frame.cpp:2540): `wxTR_DEFAULT_STYLE | wxNO_BORDER` - buttons, no lines, the root SHOWN, no frame - and no image list. The arithmetic is HIERARCHY_TREE's above; only the flags move it. `qa/probes/net_navigator_probe.cpp` reads it back: row height 22: char height 18 + 4, nothing taller than the text first row at y = 2 level L (the root is level 0, and shown, so it costs an indent) x = 15(L + 1); item X = x + 18; the text at X - no image (root 33, level 1 48, level 2 63) button the 9x9 DrawTreeItemButton centred on (x, y_mid) selection the text's start - 3 to its end + 3, the full row lines none (wxTR_NO_LINES), and no frame (wxNO_BORDER), so the content box is the control's own origin */ .ze-gentree { /* [data] wx paints from y = 2 (treectlg.cpp:3052). */ padding-top: 2px; background: var(--chrome-bg2); overflow: auto; position: relative; } .ze-gentree-node { /* `--lvl` is set inline per node: 0 for the root. */ --x: calc((var(--lvl) + 1) * 15px); --X: calc(var(--x) + 18px); } .ze-gentree-row { position: relative; /* [px] GetLineHeight(): 18 + 4, every row h=22 in qa/probes/net_navigator_probe.cpp. */ height: 22px; white-space: nowrap; cursor: default; } .ze-gentree-button { /* [data] y_mid - 4 for the 9px button in a 22px row. */ top: 7px; } .ze-gentree-label { display: inline-block; /* [data] the band starts 3 before the text, which starts at X (treectlg.cpp:2632-2640). */ margin-left: calc(var(--X) - 3px); /* [px] the row, as above. */ height: 22px; /* [px] DrawText centres the text in the row. */ line-height: 22px; /* [data] rect.x -= 1, width += 2 over the -2/+2 (treectlg.cpp:2632-2640). */ padding: 0 3px; color: var(--view-fg); vertical-align: top; } /* DrawItemSelectionRect: GTK's selected-row fill under HIGHLIGHTTEXT. */ .ze-gentree-label.sel { background: var(--selection-bg); color: var(--selection-fg); } /* Right dock (LayersManager + SelectionFilter panes): at the window edge, outside the right toolbar, like pcbnew's AUI Right().Layer(4). It fills the body height; the Appearance pane grows and scrolls internally while the Selection Filter stays pinned at the bottom (fixed height), matching KiCad's AUI layout where only the notebook scrolls. */ .ze-rightdock { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; } /* The mirror of `.ze-leftdock:not(:has(+ .ze-dock-sash))`, and for the same reason: where the sash is there, it is the separation. The sash precedes this dock rather than following it, because it is the pane's canvas-facing edge that carries it. */ :not(.ze-dock-sash) + .ze-rightdock { border-left: 1px solid var(--chrome-border); } /* In the dock the panes stack vertically, so drop the fixed 220px width. The pane is a plain wxPanel and takes wxSYS_COLOUR_3DFACE like any other. `m_layerPanelColour` is NOT the pane: it is `m_panelLayers->GetBackgroundColour().ChangeLightness( 110 )` and APPEARANCE_CONTROLS sets it on `m_windowLayers` and on each row's panel (appearance_controls.cpp:1240-1269), i.e. on the LIST inside the notebook. Painting the whole pane with it made the tab strip, the Presets/Viewports block and the Selection Filter read as one flat sheet of #4b4b4b where KiCad has #373737 around a #4b4b4b list — [px] pcbnew down x=1915: pane face 188..192, tab strip 194..229, list 250..808, then #373737 again from 835 through the Selection Filter. No border between the two panes either. They share a dock row, so what wxAUI puts between them is a sash, and a sash is the same #373737 as the panes — invisible, where our rule drew a black rule above the Selection Filter caption. */ .ze-rightdock .ze-panel { width: auto; background: var(--content-bg); } /* Appearance pane: grows to fill and clips, so its notebook body scrolls. */ .ze-rightdock .ze-panel.grow { flex: 1 1 auto; min-height: 0; overflow: hidden; } /* Selection Filter pane: fixed at the bottom, sized to its content — `m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0` (pcbnew/pcb_edit_frame.cpp:422). Same class as the left dock's, because it is the same statement upstream; see the note there for why it is opt-in. */ .ze-rightdock .ze-panel.fixed { flex: 0 0 auto; border-bottom: none; } /* Layer Display Options / Presets / Viewports sit below the scroll, fixed. */ .ze-rightdock .ze-collapsepane, .ze-rightdock .ze-appearance-bottom { flex: 0 0 auto; } /* APPEARANCE_CONTROLS layer row: [indicator][swatch][eye][name] */ /* KIUI::GetInfoFont — getGUIFont( win, -1 ), the GUI font less one point, so 10 pt (ui_common.cpp:155). APPEARANCE_CONTROLS sets it on the layers panel, the objects panel, both Nets labels and the presets/viewports labels (appearance_controls.cpp:444-453), and PANEL_SELECTION_FILTER sets it on every checkbox (panel_selection_filter.cpp:36-49). One font upstream, so one token here — these rules used to write 12px and 13px between them. */ .ze-layer-row { display: flex; align-items: center; gap: 5px; padding: 1px 5px 1px 2px; font-size: var(--ui-font-size-info); line-height: 1.35; cursor: default; white-space: nowrap; } .ze-layer-row:hover { background: var(--chrome-hover); } .ze-layer-row.active { background: var(--panel-list-row-active); } .ze-ellipsis { overflow: hidden; text-overflow: ellipsis; } /* INDICATOR_ICON, the marker on the active layer row - the ONE thing LAYER_WIDGET::SelectLayerRow changes, so it is all that says which layer is active. The box is KIUI::c_IndicatorSizeDIP, 10 (`include/widgets/ui_common.h:52`). The arrow inside it is not the whole box: `createArrow( size, scale, 1, ... )` (`common/widgets/indicator_icon.cpp:93-121`) plots an UP triangle one pixel wider each row from `startX = ( size - 1 ) / 2`, `startY = aDirection % 2`, for `size / 2` rows - x=4..4, 3..5, 2..6, 1..7, 0..8 over y=1..5 - and then `image.Rotate90()` turns it right, mapping (x,y) to (H-1-y, x). That lands a triangle with its flat edge at x=4 spanning y=0..8 and its apex at (8,4): 5 across, 9 down, inside a 10 px box. A live GerbView pane measures exactly that, at exactly those offsets from the list edge. [data] rgb(64, 72, 255) is KiCad's own literal at `indicator_icon.cpp:216` - a colour it picks itself rather than asking the theme for, which is why it is this saturated blue and not a chrome tone. Ours was #4d7fc4. */ .ze-layer-indicator { width: var(--indicator-size); height: var(--indicator-size); flex: 0 0 auto; } .ze-layer-indicator.on { background: rgb(64 72 255); /* [data] indicator_icon.cpp:216 */ clip-path: polygon(4px 0, 4px 9px, 9px 4.5px); } /* COLOR_SWATCH (SWATCH_SMALL) */ /* COLOR_SWATCH::RenderToDC fills the rect with DrawRectangle under `aDC->SetPen( *wxTRANSPARENT_PEN )` (`common/widgets/color_swatch.cpp:72`): no outline and no rounding anywhere in that function. The 1 px #444 border and the 2 px radius here were ours, and they ate two of the swatch's fourteen rows. */ /* `COLOR_SWATCH::RenderToDC` opens with `aDC->SetPen( *wxTRANSPARENT_PEN )` (`common/widgets/color_swatch.cpp:72`) and paints nothing but the colour: no outline, and the white margin rectangles at :136-148 only appear when a caller passes aMargins, which LAYER_WIDGET does not. Ours is a