fix(gallery): 图标按钮去外框 + 底栏信息区防溢出,同步 1.4.2
This commit is contained in:
1 parent
1ddfa7f601
commit
f02f18863a
4 files changed
+29
-10
No files matched your search
+3
-3
@@ -19,9 +19,9 @@
|
||||
},
|
||||
{
|
||||
"id": "gallery",
|
||||
"file": "plugin-gallery.6a122aea14bf.js",
|
||||
"version": "1.4.1",
|
||||
"integrity": "sha256-ahIq6hS/Mch9XfCLQWnPJeirbsIqSbPFE+f08F4Q6PM="
|
||||
"file": "plugin-gallery.ec1dd4a6e21c.js",
|
||||
"version": "1.4.2",
|
||||
"integrity": "sha256-7B3UpuIcoi32fLiTjipMU/8Z4fjL+46PWWWM1ughTGk="
|
||||
},
|
||||
{
|
||||
"id": "image-annotate",
|
||||
|
||||
+4
-2
@@ -121,8 +121,10 @@
|
||||
setBtn.setAttribute('aria-expanded', 'false')
|
||||
var settings = el('div', { class: 'iwb-gal-settings', role: 'dialog', 'aria-label': '图库设置' })
|
||||
settings.style.display = 'none'
|
||||
// v1.4.2:刷新与设置同放右侧工具组(此前刷新在左侧信息区,空间不足时会向右溢出、压住设置图标)
|
||||
var tools = el('div', { class: 'iwb-gal-tools' }, refreshBtn, setBtn)
|
||||
var foot = el('div', { class: 'iwb-gal-foot' },
|
||||
el('div', { class: 'iwb-gal-foot-left' }, countEl, pickedEl, statusEl, refreshBtn), setBtn)
|
||||
el('div', { class: 'iwb-gal-foot-left' }, countEl, pickedEl, statusEl), tools)
|
||||
var wrap = el('div', { class: 'iwb-history-embedded' }, [head, grid, more, empty, foot, settings])
|
||||
|
||||
function setOpen (open) {
|
||||
@@ -370,7 +372,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'gallery',
|
||||
name: '图库',
|
||||
version: '1.4.1',
|
||||
version: '1.4.2',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'gallery'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
@@ -2127,11 +2127,23 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-gal-opts { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin-left: auto; }
|
||||
/* 图库设置浮层(v1.4.0):三个下拉不再占前台,点「设置」从底栏上方浮出 */
|
||||
.iwb-history-embedded { position: relative; }
|
||||
.iwb-gal-setbtn { margin-left: auto; flex: 0 0 auto; }
|
||||
/* 底栏图标按钮(v1.4.1):固定方形、不换行,窄栏也不挤成竖排文字 */
|
||||
.iwb-gal-icobtn { width: 22px; height: 22px; min-width: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 1; }
|
||||
/* 底栏右侧工具组(v1.4.2):刷新+设置并排靠右,互不挤压 */
|
||||
.iwb-gal-tools { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; margin-left: auto; }
|
||||
.iwb-gal-setbtn { flex: 0 0 auto; }
|
||||
/* 底栏图标按钮(v1.4.1/1.4.2):无外框、固定方形,窄栏不换行不重叠 */
|
||||
.iwb-gal-foot .iwb-gal-icobtn {
|
||||
width: 22px; height: 22px; min-width: 22px; padding: 0; box-sizing: border-box;
|
||||
display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 1;
|
||||
border: 0; background: transparent; border-radius: 5px; color: var(--iwb-text2);
|
||||
}
|
||||
.iwb-gal-icobtn svg { display: block; pointer-events: none; }
|
||||
.iwb-gal-icobtn:hover { color: var(--iwb-text); }
|
||||
.iwb-gal-foot .iwb-gal-icobtn:hover { background: var(--iwb-layer2); border: 0; color: var(--iwb-text); }
|
||||
.iwb-gal-foot .iwb-gal-icobtn:active { transform: none; }
|
||||
.iwb-gal-foot .iwb-gal-icobtn:focus-visible { outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px; }
|
||||
/* 左侧信息区不得溢出到工具组上 */
|
||||
.iwb-gal-foot { min-width: 0; }
|
||||
.iwb-gal-foot-left { flex: 0 1 auto; min-width: 0; overflow: hidden; }
|
||||
.iwb-gal-foot-left .iwb-gal-status { max-width: none; flex: 0 1 auto; }
|
||||
.iwb-gal-setbtn-on { background: var(--iwb-layer2); border-color: var(--iwb-border-strong, var(--iwb-border)); }
|
||||
.iwb-gal-settings {
|
||||
position: absolute; right: 12px; bottom: 44px; z-index: 30; width: 186px; max-width: calc(100% - 24px);
|
||||
|
||||
@@ -93,9 +93,14 @@ async function boot ({ items, thumb, clock }) {
|
||||
assert.strictEqual(env.calls.list, 2, '面板重新可见且间隔 >5s 应自动重拉,实际 ' + env.calls.list)
|
||||
|
||||
// 底部「刷新」按钮:随时强制重拉
|
||||
const footBtns = Array.from(env.node.querySelectorAll('.iwb-gal-foot button'))
|
||||
const tools = env.node.querySelector('.iwb-gal-tools')
|
||||
assert.ok(tools, '底栏应有右侧工具组')
|
||||
const footBtns = Array.from(tools.querySelectorAll('button'))
|
||||
assert.strictEqual(footBtns.length, 2, '工具组应为刷新+设置两个图标,实际 ' + footBtns.length)
|
||||
const btn = footBtns.find((b) => b.getAttribute('aria-label') === '刷新')
|
||||
assert.ok(btn, '底部应有刷新按钮(aria-label=刷新)')
|
||||
// 刷新不能再留在左侧信息区(否则空间不足会向右压住设置)
|
||||
assert.ok(!env.node.querySelector('.iwb-gal-foot-left button'), '左侧信息区不应有按钮')
|
||||
// 图标按钮:不显示文字,只有 svg
|
||||
assert.strictEqual(btn.textContent.trim(), '', '刷新按钮不应再显示文字(窄栏会被挤成竖排)')
|
||||
assert.ok(btn.querySelector('svg'), '刷新按钮应有 svg 图标')
|
||||
|
||||
Reference in new issue
Block a user