Files
OrcaSlicer/resources/web/dialog/SpeedDial/style.css
T

439 lines
14 KiB
CSS

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
font-family: var(--orca-font, "Segoe UI", sans-serif);
font-size: 13px;
color: var(--text, var(--orca-fg, #1b1c1e));
background: var(--bg, var(--orca-bg, #fff));
overflow: hidden;
user-select: none;
}
.launcher {
display: flex;
flex-direction: column;
background: var(--panel, var(--orca-bg, #fff));
border: 1px solid var(--border, var(--orca-border, #ddd));
overflow: hidden;
/* why: no height cap here - the launcher reports its true natural height to C++, which
sizes the popup to match (HTML is source of truth). The list's own max-height is what
bounds growth; capping the launcher would make the measurement circular. */
}
.fav-bar {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 8px;
padding: 9px 10px;
border-bottom: 1px solid var(--border, var(--orca-border, #ddd));
overflow-x: auto; /* scroll horizontally once favourites overflow the row */
scrollbar-width: thin;
/* why: keep scrollIntoView (arrow-nav) from scrolling the first/last tile flush to the edge,
which would clip its selected outline. Matches the 10px horizontal padding. */
scroll-padding-inline: 10px;
}
.fav-bar[hidden] { display: none; }
/* Name of the selected favourite, above the bar; left-aligned to the tiles' 10px inset. */
.fav-eyebrow { flex: 0 0 auto; padding: 8px 10px 0; }
.fav-tile {
flex: 0 0 auto; /* keep tiles full-size; don't shrink to fit - scroll instead */
width: 30px;
height: 30px;
border: 0;
border-radius: 8px;
cursor: pointer;
color: hsl(var(--h) var(--speed-tile-text-s, 72%) var(--speed-tile-text-l, 38%));
font-weight: 700;
/* why: mirror .tile centering - tileCode can be 2-3 chars (e.g. "EA1") on collision, and a
bare <button> inherits 13px + UA padding, clipping the code (e.g. "AE1"). inline-flex + 12px + pad:0 fits it. */
font-size: 12px;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
background: var(--speed-tile-bg, #f0f0f0);
border: 1px solid var(--speed-tile-border, #d8d8d8);
}
.fav-tile.sel { outline: 2px solid var(--main-color, var(--orca-accent, #009688)); outline-offset: 2px; }
/* Hover-revealed remove button in the tile's corner; sits inside the tile bounds so overflow:hidden clips it. */
.fav-tile { position: relative; }
.fav-unpin {
position: absolute;
top: 1px;
right: 1px;
width: 13px;
height: 13px;
padding: 0;
border: 0;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--muted, var(--orca-muted, #6b7280));
background: rgba(127,127,127,.35);
cursor: pointer;
opacity: 0;
}
.fav-tile:hover .fav-unpin,
.fav-tile.sel .fav-unpin { opacity: 1; }
.fav-unpin:hover { background: rgba(127,127,127,.6); }
/* Numbered quick-launch slot (Alt/Option+digit), top-left corner of the fav tile. */
.fav-slot {
position: absolute;
top: 1px;
left: 1px;
min-width: 11px;
height: 11px;
padding: 0 2px;
border-radius: 3px;
font-size: 8px;
font-weight: 600;
line-height: 11px;
text-align: center;
color: var(--muted, var(--orca-muted, #6b7280));
background: rgba(127,127,127,.22);
}
/* Transient flash banner pinned to the top of the launcher (e.g. "favourites are full"). */
.dial-flash {
flex: 0 0 auto;
padding: 4px 10px;
font-size: 11px;
color: var(--plugin-status-warn, #b45309);
background: var(--plugin-status-warn-bg, rgba(255,193,7,.22));
animation: dial-flash-fade 2.5s ease forwards;
}
@keyframes dial-flash-fade { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.ctx-menu {
position: fixed;
z-index: 10;
min-width: 120px;
padding: 4px;
background: var(--panel, var(--orca-bg, #fff));
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 7px;
box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.ctx-menu[hidden] { display: none; }
.ctx-item {
display: block;
width: 100%;
padding: 6px 10px;
border: 0;
border-radius: 5px;
background: transparent;
color: var(--text, var(--orca-fg, #1b1c1e));
font: inherit;
text-align: left;
cursor: pointer;
}
.ctx-item:hover { background: var(--row-hover, rgba(127,127,127,.16)); }
.ctx-item:disabled { opacity: .4; cursor: default; }
.ctx-item:disabled:hover { background: transparent; }
.dial-head { flex: 0 0 auto; padding: 8px; }
.plugin-search {
display: flex;
align-items: center;
gap: 4px;
height: 30px;
padding: 0 8px;
background: var(--panel, var(--orca-bg, #fff));
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 7px;
}
.plugin-search:focus-within {
border-color: var(--main-color, var(--orca-accent, #009688));
box-shadow: 0 0 0 2px rgba(0,150,136,.25);
}
.plugin-search-icon { display: inline-flex; color: var(--muted, var(--orca-muted, #6b7280)); }
.plugin-search-input {
flex: 1;
min-width: 0;
background: transparent;
border: 0;
outline: 0;
color: var(--text, var(--orca-fg, #1b1c1e));
font: inherit;
}
.plugin-search-clear {
display: inline-flex;
align-items: center;
justify-content: center;
width: 12px;
height: 12px;
padding: 0;
border: 0;
border-radius: 50%;
color: var(--muted, var(--orca-muted, #6b7280));
cursor: pointer;
background: rgba(127,127,127,.20);
}
.plugin-search-clear[hidden] { display: none; }
.dial-count {
padding: 4px 4px 0;
text-align: left;
font-size: 11px;
color: var(--muted, var(--orca-muted, #6b7280));
}
.dial-count[hidden] { display: none; }
/* Section header inside the list (e.g. the "Recent" row above the recent entries). */
.dial-group {
padding: 8px 8px 2px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .06em;
color: var(--muted, var(--orca-muted, #6b7280));
}
.dial-list {
flex: 0 1 auto;
min-height: 0;
/* ADJUST HEIGHT HERE. The popup auto-resizes to the content (HTML is the source of truth), so
this list cap drives the whole window height: --rows full rows + a ~30% peek of the next row
as a "scroll for more" affordance. Bump --rows to show more rows; change 0.3 for a bigger/
smaller peek. --row-h MUST match .row min-height (44px). */
--row-h: 44px;
--rows: 5;
max-height: calc(var(--rows) * var(--row-h) + 0.3 * var(--row-h) + 4px);
overflow-y: auto;
padding: 4px 4px 6px;
scrollbar-width: thin;
}
.dial-list.empty { overflow-y: hidden; }
/* Bottom spacer for the windowed command list: fills the un-rendered tail so the scrollbar reflects
the full match count, while only a near-viewport window of rows exists in the DOM. */
.dial-spacer-bottom { flex: 0 0 auto; }
.row {
display: flex;
align-items: center;
gap: 10px;
min-height: 44px;
padding: 6px 8px;
border-radius: 7px;
cursor: pointer;
}
.row:hover { background: var(--row-hover, rgba(127,127,127,.16)); }
.row.sel { background: var(--row-selected, rgba(0,150,136,.18)); }
.tile {
flex: 0 0 auto;
width: 26px;
height: 26px;
border-radius: 6px;
color: hsl(var(--h) var(--speed-tile-text-s, 72%) var(--speed-tile-text-l, 38%));
font-weight: 700;
font-size: 12px;
display: inline-flex;
align-items: center;
justify-content: center;
background: var(--speed-tile-bg, #f0f0f0);
border: 1px solid var(--speed-tile-border, #d8d8d8);
}
/* A tile holding a pattern pictogram: drop the hue fill so the stroked SVG reads cleanly. */
.tile.has-icon,
.fav-tile.has-icon {
background: none;
border-color: transparent;
}
.tile-icon {
width: 18px;
height: 18px;
display: block;
}
.row-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row-eyebrow {
font-size: 10px;
line-height: 1.3;
color: var(--muted, var(--orca-muted, #6b7280));
opacity: .85;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.row-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name mark, .row-eyebrow mark { background: var(--plugin-status-warn-bg); color: var(--plugin-status-warn); border-radius: 2px; }
.row-sc { flex: 0 0 auto; display: inline-flex; gap: 3px; }
kbd {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 5px;
font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
font-size: 11px;
color: var(--muted, var(--orca-muted, #6b7280));
background: rgba(127,127,127,.12);
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 4px;
}
.star {
flex: 0 0 auto;
width: 24px;
height: 24px;
border: 0;
border-radius: 5px;
background: transparent;
color: var(--muted, var(--orca-muted, #6b7280));
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
opacity: 0;
}
.star svg { display: block; }
.row:hover .star:not(.on),
.row.sel .star:not(.on) { opacity: .5; }
.star.on { opacity: 1; color: var(--main-color, var(--orca-accent, #009688)); }
.star:hover { background: rgba(127,127,127,.18); }
.dial-empty {
min-height: 64px;
padding: 18px 10px;
display: flex;
align-items: center;
justify-content: center;
color: var(--muted, var(--orca-muted, #6b7280));
text-align: center;
}
/* ---- inline setting editor card (phase "setting") --------------------------- */
.dial-list.setting { overflow-y: auto; }
.dial-editor {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px;
}
.editor-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.editor-title-row { display: flex; align-items: center; gap: 8px; }
.editor-preview-icon {
flex: 0 0 auto;
width: 24px;
height: 24px;
}
.editor-preview-icon[hidden] { display: none; }
.editor-tooltip { font-size: 11px; line-height: 1.4; color: var(--muted, var(--orca-muted, #6b7280)); }
.editor-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.editor-label {
flex: 0 0 auto;
min-width: 64px;
font-size: 12px;
color: var(--muted, var(--orca-muted, #6b7280));
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.editor-unit { font-size: 12px; color: var(--muted, var(--orca-muted, #6b7280)); }
.editor-row input[type="number"],
.editor-row input[type="text"],
.editor-row select,
.editor-row input[type="color"] {
flex: 1 1 auto;
min-width: 0;
height: 30px;
padding: 0 8px;
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 6px;
background: var(--panel, var(--orca-bg, #fff));
color: var(--text, var(--orca-fg, #1b1c1e));
font: inherit;
}
.editor-row input[type="color"] { padding: 2px 4px; cursor: pointer; }
.editor-row input:focus { outline: none; border-color: var(--main-color, var(--orca-accent, #009688)); box-shadow: 0 0 0 2px rgba(0,150,136,.22); }
/* custom dropdown (native <select> popups are flaky in the embedded webview) */
.ed-dropdown { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ed-dropdown-toggle {
display: flex;
align-items: center;
gap: 6px;
width: 100%;
height: 30px;
padding: 0 8px;
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 6px;
background: var(--panel, var(--orca-bg, #fff));
color: var(--text, var(--orca-fg, #1b1c1e));
font: inherit;
text-align: left;
cursor: pointer;
}
.ed-dropdown-toggle.open { border-color: var(--main-color, var(--orca-accent, #009688)); }
.ed-dropdown-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-dropdown-caret { flex: 0 0 auto; font-size: 10px; color: var(--muted, var(--orca-muted, #6b7280)); transition: transform .12s; }
.ed-dropdown-toggle.open .ed-dropdown-caret { transform: rotate(180deg); }
.ed-dropdown-menu {
/* Overlay popover, not in-flow: opening it must NOT grow the editor card or the popup window.
position/left/top/width/max-height are set from JS on open (position:fixed escapes the
scrollable card and launcher overflow, so the menu clips to the popup and scrolls itself).
These are only the visual defaults. */
position: absolute;
z-index: 30;
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 6px;
background: var(--panel, var(--orca-bg, #fff));
box-shadow: 0 8px 24px rgba(0,0,0,.16);
max-height: 200px;
overflow-y: auto;
}
.ed-dropdown-option {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
padding: 6px 8px;
border: 0;
background: none;
color: var(--text, var(--orca-fg, #1b1c1e));
font: inherit;
text-align: left;
cursor: pointer;
}
.ed-dropdown-option:hover { background: var(--row-hover, rgba(127,127,127,.16)); }
.ed-dropdown-option.sel { font-weight: 600; color: var(--main-color, var(--orca-accent, #009688)); }
.ed-option-label { flex: 1 1 auto; min-width: 0; }
/* Pattern pictograms: filled with the option's icon, and (for values with none) absent. */
.ed-option-icon,
.ed-dropdown-icon {
flex: 0 0 auto;
width: 16px;
height: 16px;
}
.ed-dropdown-icon[hidden] { display: none; }
/* toggle switch */
.ed-switch { position: relative; flex: 0 0 auto; width: 36px; height: 20px; }
.ed-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ed-slider {
position: absolute;
inset: 0;
background: #c4c4c4;
border-radius: 10px;
transition: background .15s;
}
.ed-slider::before {
content: "";
position: absolute;
width: 16px;
height: 16px;
left: 2px;
top: 2px;
background: #fff;
border-radius: 50%;
transition: transform .15s;
}
.ed-switch input:checked + .ed-slider { background: var(--main-color, var(--orca-accent, #009688)); }
.ed-switch input:checked + .ed-slider::before { transform: translateX(16px); }
.editor-readonly { padding: 4px 0; font-size: 12px; color: var(--muted, var(--orca-muted, #6b7280)); }
.editor-actions { display: flex; gap: 8px; padding-top: 4px; }
.ed-btn {
padding: 6px 12px;
border: 1px solid var(--border, var(--orca-border, #ddd));
border-radius: 6px;
background: var(--panel, var(--orca-bg, #fff));
color: var(--text, var(--orca-fg, #1b1c1e));
font: inherit;
cursor: pointer;
}
.ed-btn:hover { background: var(--row-hover, rgba(127,127,127,.16)); }
.ed-btn-primary { background: var(--main-color, var(--orca-accent, #009688)); border-color: var(--main-color, var(--orca-accent, #009688)); color: #fff; }
.ed-btn-primary:hover { filter: brightness(1.05); }
.editor-hint { font-size: 10px; text-align: center; color: var(--muted, var(--orca-muted, #6b7280)); }