feat(image-annotate): v1.20.1 吸管+色值整组右对齐(不再随 tab 数量浮动),色值框 124→96

This commit is contained in:
qiqi committed 2026-11-10 08:48:25 +08:00
1 parent d16e68bfa9
commit a8512ba777
6 files changed
+63 -30

No files matched your search

+7 -7
View File
@@ -1803,8 +1803,9 @@
.iwb-color-pop-head { display: flex; align-items: center; gap: 6px; }
/* 竖线:分隔「调哪个槽 / 取色工具 / 去色·钉住」三组,比空白更清楚,又不加边框重量 */
.iwb-color-pop-bar { width: 1px; height: 16px; background: #313244; flex: 0 0 auto; }
/* 「去色 | 图钉」整组贴最右(margin-left:auto)。这样色值框不用拉成一条长条去填空,
头部是「左边调色槽与工具 / 右边一个开关」两段式,扫视时不会把 HEX 当成主角。 */
/* 「吸管 + 色值 + 图钉」整组贴最右(margin-left:auto,v1.20.1)。
v1.20 只推图钉、吸管与色值紧跟 tab —— tab 从 2 个变 3 个(文字工具加「底色」),
这组就整块左右浮一次。现在 tab 组独占左侧、空隙全给它吸收,右组从第一条竖线起整体钉住。 */
.iwb-color-pop-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.iwb-color-pop-tab {
@@ -1878,12 +1879,11 @@
/* display:flex 会盖掉 [hidden] 的默认 display:none,必须显式写一条 */
.iwb-color-group[hidden] { display: none; }
/* 色值输入定宽 124(v1.20 由 150 收窄、且不再可缩):#RRGGBB 七个字符 55px 出够,
v1.19 用的是 flex:0 1 150px,文字工具多出「底色」tab 时它会自己缩到 147 ——
头部宽度就跟着上下文抖,最后把「去色」整颗挤掉(用户截图里那次)。
现在头部每个元素都定宽:只有 gap 吸收亚像素误差,切工具不再重排。 */
/* 色值输入定宽 96(v1.20.1 由 124 再收窄,用户「设置框可以小一些,现在长了」)。
#RRGGBB 七个字符在 13px 等宽下约 55px,加左右 padding 10px 仍有 30px 余量;
它现在是右组里的一颗「读数」,不该比吸管/图钉重。仍然定宽不可缩。 */
.iwb-editor-color-pop .iwb-editor-color-hex-input {
flex: 0 0 124px; width: 124px; height: 26px; padding: 0 5px; text-align: center;
flex: 0 0 96px; width: 96px; height: 26px; padding: 0 4px; text-align: center;
font: 600 12px monospace; border-radius: 6px; box-sizing: border-box;
}
.iwb-editor-color-pop .iwb-editor-color-swatches {
+8 -3
View File
@@ -46,10 +46,15 @@ import { bindEvents } from './events.js'
<button type="button" class="iwb-color-pop-tab active" data-color-slot="stroke" title="正在调描边色(形状描边 / 画笔 / 文字色)"><i></i><span class="iwb-color-pop-tab-label">描边</span></button>
<button type="button" class="iwb-color-pop-tab" data-color-slot="fill" title="正在调填充色(形状内部颜色 / 文字描边色)"><i></i><span class="iwb-color-pop-tab-label">填充</span></button>
<button type="button" class="iwb-color-pop-tab" data-color-slot="bg" hidden title="正在调文本框底色(垫在文字下面)"><i></i><span class="iwb-color-pop-tab-label">底色</span></button>
<span class="iwb-color-pop-bar"></span>
<button type="button" class="iwb-editor-color-eye" data-action="palettePick" title="吸色:切到吸管工具,在画布上点一下取色"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m2 22 1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3Z"/></svg></button>
<input class="iwb-editor-color-hex-input" value="#ff4444" maxlength="7" spellcheck="false" autocomplete="off" title="十六进制颜色,回车生效">
<!-- 吸管 + 色值 + 图钉(v1.20.1,用户 2026-11-10):整组右对齐。
v1.20 只把图钉推到最右,吸管和色值还紧跟 tab —— tab 数量一变
(文字工具多出「底色」),这组就左右浮一次,用户截图里就是这个现象。
现在 tab 组独占左侧、剩余空隙由它吸收,右组整体钉在右侧,切工具纹丝不动。
右组前面那条竖线删掉了:空隙已经把「选槽」和「取色」分开,
右对齐后它只会孤零零悬在空白里。留下的那条竖线是分隔「图钉」这个常驻开关。 -->
<span class="iwb-color-pop-tools">
<button type="button" class="iwb-editor-color-eye" data-action="palettePick" title="吸色:切到吸管工具,在画布上点一下取色"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m2 22 1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3Z"/></svg></button>
<input class="iwb-editor-color-hex-input" value="#ff4444" maxlength="7" spellcheck="false" autocomplete="off" title="十六进制颜色,回车生效">
<span class="iwb-color-pop-bar"></span>
<!-- 钉住(v1.18,用户 2026-11-10):调色常常要连着改好几处,每次点开色板太碎。
钉住后点画布 / 点别处都不收起,只有再点一次图钉、按 Esc、或点吸管才收。