mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 19:01:02 +00:00
Fixed centering of icons. Disabled zooming in/out on Windows. Added default icons
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14.5,1.5v12a1,1,0,0,1-1,1H1.5a1,1,0,0,1-1-1V1.5a1,1,0,0,1,1-1h12a1,1,0,0,1,1,1Z" style="fill:none;stroke:#949494;stroke-linecap:round;stroke-linejoin:round"/><polyline points="4,5 6.5,7.5 4,10" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/><line x1="8" y1="10" x2="11" y2="10" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/></svg>
|
||||
|
After Width: | Height: | Size: 524 B |
@@ -294,13 +294,21 @@ function actionIcon(a) {
|
||||
return (a && a.icon) ? a.icon : "";
|
||||
}
|
||||
|
||||
// Put a pictogram into a tile (search row, favourites tile, or tab row). No icon leaves the tile
|
||||
// blank. `mono` marks the white tab-strip glyphs, which the CSS recolors to the shared gray.
|
||||
// Pictogram shown when an action carries none (plugins, icon-less commands/settings). A dedicated
|
||||
// theme-neutral glyph (resources/images/action_default.svg: frame + ">_" prompt), so no tile is
|
||||
// blank and no existing action's icon is borrowed.
|
||||
var DEFAULT_ICON = "action_default";
|
||||
|
||||
// SVG base name a tile actually renders: the action's own icon, else the placeholder. Pure.
|
||||
function tileIcon(a) {
|
||||
return actionIcon(a) || DEFAULT_ICON;
|
||||
}
|
||||
|
||||
// Put a pictogram into a tile (search row, favourites tile, or tab row). `mono` marks the white
|
||||
// tab-strip glyphs, which the CSS recolors to the shared gray.
|
||||
function fillTile(tile, a, mono) {
|
||||
tile.textContent = "";
|
||||
var icon = actionIcon(a);
|
||||
if (!icon)
|
||||
return;
|
||||
var icon = tileIcon(a);
|
||||
var img = document.createElement("img");
|
||||
img.className = mono ? "tile-icon tab-mono" : "tile-icon";
|
||||
img.src = ICON_BASE + icon + ".svg";
|
||||
|
||||
@@ -281,6 +281,17 @@ assert.equal(ctx.actionIcon({ id: "x", title: "Plugin action" }), "",
|
||||
assert.equal(ctx.actionIcon(null), "",
|
||||
"a null action (tab row) renders a blank tile");
|
||||
|
||||
// tileIcon: the base name a tile renders - the action's own icon when present, else the placeholder.
|
||||
assert.equal(ctx.tileIcon({ id: "x", title: "Slice", icon: "media_play" }), "media_play",
|
||||
"an action with an icon keeps it");
|
||||
assert.equal(ctx.tileIcon({ id: "x", title: "Go to tab...", icon: "" }), "action_default",
|
||||
"an empty icon falls back to the placeholder");
|
||||
assert.equal(ctx.tileIcon({ id: "x", title: "Plugin action" }), "action_default",
|
||||
"a missing icon falls back to the placeholder");
|
||||
assert.equal(ctx.DEFAULT_ICON, "action_default", "the placeholder is the dedicated default glyph");
|
||||
assert.ok(fs.existsSync(__dirname + "/../../../images/action_default.svg"),
|
||||
"the placeholder SVG ships alongside the page's other icons");
|
||||
|
||||
// needsModeSwitch: a setting is gated only when its required mode outranks the user's current mode.
|
||||
assert.equal(ctx.needsModeSwitch({ mode: "advanced" }, "simple"), true, "Advanced is gated in Simple mode");
|
||||
assert.equal(ctx.needsModeSwitch({ mode: "expert" }, "simple"), true, "Expert is gated in Simple mode");
|
||||
|
||||
@@ -331,12 +331,15 @@ body {
|
||||
border: 1px solid var(--speed-tile-border, #d8d8d8);
|
||||
}
|
||||
|
||||
/* Native SVG pictogram in a tile; blank tiles (no icon) have no child. */
|
||||
/* Native SVG pictogram in a tile. The Orca icon grid draws 1px strokes from 0.5..14.5 of the 16
|
||||
viewBox, so the visible glyph is 0..15 and, centered as-is, leaves one extra pixel on the right/
|
||||
bottom (the "Save Project leans left" look). Shift by half a pixel to center the visible artwork. */
|
||||
.tile-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
pointer-events: none;
|
||||
transform: translate(.5px, .5px);
|
||||
}
|
||||
|
||||
/* Tab-strip glyphs are drawn white for the dark tab bar; recolor to the shared #949494 gray so
|
||||
|
||||
Reference in New Issue
Block a user