From 46e56abea0832da8cb4b7c2158a6662b26ea7303 Mon Sep 17 00:00:00 2001 From: BillK <35489013+Bill13579@users.noreply.github.com> Date: Wed, 11 Sep 2024 05:51:13 +0800 Subject: [PATCH] Fix regression where the markdown rendering parameter of various TUI calls were missing, causing broken menus (notably the save-for-later container resolution panel); fix regression where the `` host permission request panel had overlapping text blocks --- dist/popup/popup.css | 7 ++++--- src/popup/menu.js | 6 +++--- src/popup/popup.js | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dist/popup/popup.css b/dist/popup/popup.css index f59c634..d4f83f2 100644 --- a/dist/popup/popup.css +++ b/dist/popup/popup.css @@ -221,8 +221,8 @@ input[type="text"]:focus { } .-tui-menu-item { display: inline-flex; - height: calc(24px * var(--scale)); - line-height: calc(26px * var(--scale)); + min-height: calc(24px * var(--scale)); + line-height: calc(24px * var(--scale)); padding-left: 4px; padding-right: calc(2px + 4.5px); /* padding-right: calc(8px + 4.5px); */ @@ -243,7 +243,8 @@ input[type="text"]:focus { background-color: var(--bg-lite); } .-tui-menu-item .-tui-menu-item-icon { - height: 100%; + /* height: 100%; */ + align-self: stretch; /* Alternative to height: 100% in this situation */ width: calc(24px * var(--scale)); vertical-align: middle; diff --git a/src/popup/menu.js b/src/popup/menu.js index afad8b9..f9170d6 100644 --- a/src/popup/menu.js +++ b/src/popup/menu.js @@ -129,7 +129,7 @@ export class TUIMenu extends TUIMenuListLayout { } } export class TUIMenuItem { - constructor(label="Label", icon="", iconTransform="scale(80%) translateY(-2.8%)", markdown=false, data=undefined) { + constructor(label="Label", icon="", iconTransform="scale(80%) translateY(-4.5%)", markdown=false, data=undefined) { this.__labelText = label; this.__iconSrc = icon; this.iconTransform = iconTransform; @@ -242,7 +242,7 @@ export class TUIMenuItem { } } export class TUIMenuLabel extends TUIMenuItem { - constructor(label="Label", icon="", iconTransform="scale(80%) translateY(-2.8%)", markdown=false, data=undefined) { + constructor(label="Label", icon="", iconTransform="scale(80%) translateY(-4.5%)", markdown=false, data=undefined) { super(label, icon, iconTransform, markdown, data); } make(ret) { @@ -267,7 +267,7 @@ export class TUIMenuHR { } } export class TUISubMenu extends TUIMenuItem { - constructor(onMake, onSelect, options, dropdown=false, label="Label", icon="", iconTransform="scale(80%) translateY(-2.8%)", markdown=false, data=undefined) { + constructor(onMake, onSelect, options, dropdown=false, label="Label", icon="", iconTransform="scale(80%) translateY(-4.5%)", markdown=false, data=undefined) { super(label, icon, iconTransform, markdown, data); this.__onMake = onMake; this.__onSelect = onSelect; diff --git a/src/popup/popup.js b/src/popup/popup.js index 7fdab8e..0411890 100644 --- a/src/popup/popup.js +++ b/src/popup/popup.js @@ -2188,7 +2188,7 @@ class TUITabsList extends TUIListDataInterpret { let generateDropdownOptions = function () { let options = []; for (let ci of currentCI) { - options.push(new TUIMenuItem(ci.name, ci.iconUrl, undefined, { + options.push(new TUIMenuItem(ci.name, ci.iconUrl, undefined, undefined, { colorCode: ci.colorCode, cookieStoreId: ci.cookieStoreId })); @@ -2209,7 +2209,7 @@ class TUITabsList extends TUIListDataInterpret { new TUIMenuListLayout( ...Object.entries(map).filter(([key, value]) => value === undefined).map(([key, value]) => new TUIMenuFlexLayout( - new TUIMenuLabel(savedCIIdMap[key].name, savedCIIdMap[key].iconUrl, undefined, { + new TUIMenuLabel(savedCIIdMap[key].name, savedCIIdMap[key].iconUrl, undefined, undefined, { colorCode: savedCIIdMap[key].colorCode }).pushInto(labels), new TUISubMenu((_, options) => { @@ -2222,7 +2222,7 @@ class TUITabsList extends TUIListDataInterpret { if (Object.values(map).every(value => value !== undefined)) { ok.enabled = true; } - }, generateDropdownOptions(), true, "Select...", "", undefined, { initialSelection: value ? ciIndex(value) : -1 }).pushInto(dropdowns) + }, generateDropdownOptions(), true, "Select...", "", undefined, undefined, { initialSelection: value ? ciIndex(value) : -1 }).pushInto(dropdowns) ).pushInto(rows)) ), actions = new TUIMenuFlexLayout(