From 4a0bb2df52e3ec502cf04f3183cd8f067bd756b5 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Thu, 2 May 2024 15:19:45 +0800 Subject: [PATCH] Fix menulist popup item padding and icon on MacOS and Windows A follow up fix after #4052 Default to radio style menuitem on MacOS and Windows --- scss/mac/_menupopup.scss | 1 + scss/win/_menupopup.scss | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/scss/mac/_menupopup.scss b/scss/mac/_menupopup.scss index 33749f5c32..47335bd5b9 100644 --- a/scss/mac/_menupopup.scss +++ b/scss/mac/_menupopup.scss @@ -35,6 +35,7 @@ menupopup { } } + menulist > &, &[needsgutter] { menu, menuitem { padding-left: 20px; diff --git a/scss/win/_menupopup.scss b/scss/win/_menupopup.scss index 3c0cb71452..7d02f170d4 100644 --- a/scss/win/_menupopup.scss +++ b/scss/win/_menupopup.scss @@ -41,11 +41,40 @@ menupopup { menuitem:is([checked="true"]):is([type="radio"]) > .menu-iconic-left { list-style-image: url("chrome://zotero/skin/win/menu-radio.svg"); } -} + menulist { + menupopup { + menu, menuitem { + .menu-iconic-left { + display: flex; + } + } -menulist > menupopup > menuitem > .menu-iconic-left, -menulist > menupopup > menucaption > .menu-iconic-left, -menulist > menupopup > menu > .menu-iconic-left { - display: unset; + menu:not([icon], .menu-iconic), + menuitem:not([checked="true"], [icon], .menuitem-iconic) { + padding-inline-start: 36px; + } + menuitem { + .menu-iconic-icon { + display: none; + } + } + menuitem[selected="true"] { + padding-inline-start: 12px !important; + + & > .menu-iconic-left { + -moz-context-properties: fill, fill-opacity; + fill: currentColor; + fill-opacity: var(--menu-icon-opacity); + list-style-image: url("chrome://zotero/skin/win/menu-radio.svg"); + width: 16px; + margin-inline-end: 8px; + + & > .menu-iconic-icon { + display: initial; + } + } + } + } + } }