120 lines
5.1 KiB
CSS
120 lines
5.1 KiB
CSS
/* Gerber Viewer specific chrome: the layer manager dock, the top-toolbar
|
|
selectors, the message panel and DCode table. Uses the shared shell theme
|
|
variables so it matches the other editors' dark chrome. */
|
|
|
|
.ze-gbr-dock {
|
|
/* Width is state, not CSS: the pane is sash-resizable and opens at
|
|
GERBER_LAYER_WIDGET's best size (see LAYERS_PANE_BEST_WIDTH). Leaving a
|
|
literal here as well would be a second source for the same number.
|
|
|
|
No canvas-facing border either. The pane is `.PaneBorder( false )`
|
|
(gerbview_frame.cpp:170) and what wxAUI puts between it and the toolbar
|
|
is the 5px sash this dock already renders; see `.ze-leftdock`. */
|
|
background: var(--panel-bg);
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ze-gbr-layers {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* The wxScrolledWindow the rows are sized into, added to the page with
|
|
`layerPanelSizer->Add( m_LayerScrolledWindow, 1, wxBOTTOM | wxEXPAND | wxLEFT
|
|
| wxTOP, 2 )` (`gerbview/widgets/layer_widget.cpp:532`) - 2 px of border on
|
|
three sides and none on the right, which is [data]: upstream's own literal.
|
|
`row-gap` is the flexgrid's vgap, kept here rather than on the row so that a
|
|
row carries no vertical space of its own; upstream's vgap falls BETWEEN rows
|
|
and not above the first one. */
|
|
.ze-gbr-layer-list {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
min-height: 60px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
row-gap: 3px; /* [data] vgap, layer_widget.cpp:522 */
|
|
padding: 2px 0 2px 2px; /* [data] wxTOP | wxLEFT | wxBOTTOM, 2 */
|
|
}
|
|
|
|
/* wxFlexGridSizer( 0, LYR_COLUMN_COUNT, 3, 4 ) with AddGrowableCol( 3, 1 )
|
|
(`gerbview/widgets/layer_widget.cpp:522-527`): five columns, the NAME column
|
|
the only one that grows, 3 px between rows and 4 px between columns. Those
|
|
two gaps are [data] - upstream's own literals in that constructor. */
|
|
.ze-gbr-layer-row {
|
|
display: grid;
|
|
grid-template-columns: auto auto auto 1fr auto;
|
|
align-items: center; /* wxALIGN_CENTER_VERTICAL on every column */
|
|
column-gap: 4px; /* [data] hgap, layer_widget.cpp:522 */
|
|
/* [px] 20. A flexgrid row is as tall as its tallest child and every child is
|
|
centred in it, so the height is not ours to choose - it is read back off a
|
|
live pane. Two features of the same capture give it: the rows repeat every
|
|
23 px and the vgap between them is 3 (`layer_widget.cpp:522`), so the row
|
|
is 20; and the scrolled window's content starts 2 px below the list top
|
|
(the wxTOP border above) with the 16 px checkbox centred 2 px lower again,
|
|
which is (20 - 16) / 2. Ours was 3 px of padding around a 19 px line box,
|
|
i.e. 25. */
|
|
height: 20px;
|
|
cursor: default;
|
|
}
|
|
/* No row background, selected or hovered.
|
|
A LAYER_WIDGET row is not a list item — it is five loose child windows
|
|
inserted straight into a wxFlexGridSizer on the scrolled window
|
|
(`insertLayerRow`, `gerbview/widgets/layer_widget.cpp:320-372`). There is no
|
|
wxEVT_ENTER_WINDOW / wxEVT_LEAVE_WINDOW binding anywhere in that file and
|
|
not one SetBackgroundColour call in it, so nothing can paint a row.
|
|
Selecting a layer changes exactly one thing:
|
|
|
|
void LAYER_WIDGET::SelectLayerRow( int aRow ) // :664
|
|
{
|
|
oldIndicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::OFF );
|
|
newIndicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::ON );
|
|
m_CurrentRow = aRow;
|
|
}
|
|
|
|
the INDICATOR_ICON in column 0. Ours painted the active row in
|
|
--chrome-active, a full-width orange band that is the loudest thing on the
|
|
pane and appears nowhere in a real GerbView. */
|
|
/* `m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags | wxRIGHT, 2 )`
|
|
(`gerbview/widgets/layer_widget.cpp:344`) - the swatch is the one column with
|
|
a border of its own, so the gap between it and the checkbox is the 4 px hgap
|
|
plus 2. [data]: upstream's literal. */
|
|
.ze-gbr-layer-row .ze-layer-swatch {
|
|
margin-right: 2px;
|
|
}
|
|
/* WX_ELLIPSIZED_STATIC_TEXT with wxST_ELLIPSIZE_MIDDLE (`layer_widget.cpp:355-360`).
|
|
The ellipsis itself is `.ze-ellipsis`, shared; only the nowrap is local. */
|
|
.ze-gbr-name {
|
|
white-space: nowrap;
|
|
min-width: 0;
|
|
}
|
|
|
|
/* The Items page: wxFlexGridSizer( 0, RND_COLUMN_COUNT, 3, 4 ) - two columns,
|
|
swatch then labelled checkbox (`layer_widget.cpp:547`). It is a notebook PAGE
|
|
now, so it no longer needs a rule dividing it from the list above it. */
|
|
.ze-gbr-render-list {
|
|
padding: 6px 8px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow-y: auto;
|
|
}
|
|
.ze-gbr-render-row {
|
|
display: grid;
|
|
grid-template-columns: auto auto 1fr;
|
|
align-items: center;
|
|
column-gap: 4px; /* [data] hgap, layer_widget.cpp:547 */
|
|
cursor: default;
|
|
}
|
|
/* `RR()`, the default-constructed spacer row (`gerbview_layer_widget.cpp:130`).
|
|
It keeps the grid full and shows nothing; its height is one row's. */
|
|
.ze-gbr-render-row.spacer {
|
|
height: var(--check-row);
|
|
}
|
|
|
|
/* The item inspector is the shared EDA_MSG_PANEL (.ze-msgpanel in
|
|
ui/shell.css) - GerbView instantiates the same widget as every other draw
|
|
frame, so it has no message panel of its own to style. */
|