Skip to content

Commit

Permalink
Fix: Icon - Padding apply at checkbox is false #349
Browse files Browse the repository at this point in the history
Co-authored-by: BPower0036 <[email protected]>
  • Loading branch information
black7375 and Nomes77 committed Jun 4, 2022
1 parent 6fbecef commit 9645e43
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 62 deletions.
70 changes: 24 additions & 46 deletions css/leptonChrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -5972,8 +5972,8 @@
}
/** Menu - Icons Layout *******************************************************/
@supports -moz-bool-pref("userChrome.icon.menu") {
menupopup menuitem:not([type="checkbox"], [type="radio"]),
menupopup menu:not([type="checkbox"], [type="radio"]),
menupopup menuitem:not([type="checkbox"][checked="true"], [type="radio"]),
menupopup menu:not([type="checkbox"][checked="true"], [type="radio"]),
#main-menubar > menu {
-moz-appearance: none !important;
/* Linux: menulist */
Expand All @@ -5983,14 +5983,12 @@
#main-menubar > menu,
:not(menu, #ContentSelectDropdown)
> menupopup
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
:not(menu, #ContentSelectDropdown)
> menupopup
> menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
:not(menu, #ContentSelectDropdown) > menupopup > menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#organizeButtonPopup, #maintenanceButtonPopup) > menuitem,
menupopup:is(#viewMenuPopup, #maintenanceButtonPopup) > menu,
menupopup:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup) > menuitem,
Expand All @@ -6009,10 +6007,8 @@
@supports -moz-bool-pref("widget.macos.native-context-menus") or -moz-bool-pref("widget.gtk.native-context-menus") {
:not(menu, #ContentSelectDropdown)
> menupopup
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
:not(menu, #ContentSelectDropdown)
> menupopup
> menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]) {
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
:not(menu, #ContentSelectDropdown) > menupopup > menu:not(.menu-iconic, .in-menulist, [checked="true"]) {
list-style-image: var(--menuitem-image, url("../icons/blank.svg")) !important;
}
}
Expand All @@ -6026,14 +6022,14 @@
:not(menu, #ContentSelectDropdown, #context-navigation) > menupopup > menu:not(.menu-iconic),
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
> menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#organizeButtonPopup, #maintenanceButtonPopup) > menuitem,
menupopup:is(#viewMenuPopup, #maintenanceButtonPopup) > menu,
menupopup:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup) > menuitem,
Expand Down Expand Up @@ -6065,24 +6061,6 @@
}
}
/* Padding - Windows */
@media (-moz-os-version: windows-win7),
(-moz-platform: windows-win7),
(-moz-os-version: windows-win8),
(-moz-platform: windows-win8),
(-moz-os-version: windows-win10),
(-moz-platform: windows-win10) {
/* Checkbox */
:root {
--context-menu-text-padding: calc(var(--menu-padding) + var(--context-menu-background-padding-default) + 16px);
}

:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menuitem[type="checkbox"]:not([checked="true"])
> .menu-iconic-left {
padding-inline-start: var(--context-menu-text-padding);
}
}
@media (-moz-os-version: windows-win7), (-moz-platform: windows-win7) {
:root {
--context-menu-background-padding-default: 2px;
Expand All @@ -6099,14 +6077,14 @@
(-moz-platform: windows-win8) {
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
> menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#organizeButtonPopup, #maintenanceButtonPopup) > menuitem,
menupopup:is(#viewMenuPopup, #maintenanceButtonPopup) > menu,
menupopup:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup) > menuitem,
Expand All @@ -6128,14 +6106,14 @@

:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
> menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup)
menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
menu:not(.menu-iconic, .in-menulist, [checked="true"]),
menupopup:is(#organizeButtonPopup, #maintenanceButtonPopup) > menuitem,
menupopup:is(#viewMenuPopup, #maintenanceButtonPopup) > menu,
menupopup:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup) > menuitem,
Expand Down Expand Up @@ -6165,10 +6143,10 @@
/* context menu width */
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type="checkbox"], [checked="true"]),
> menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked="true"]),
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menu:not(.menu-iconic, .in-menulist, [type="checkbox"], [checked="true"]),
> menu:not(.menu-iconic, .in-menulist, [checked="true"]),
#blockedPopupDontShowMessage {
padding-inline-end: var(--context-menu-background-padding) !important;
}
Expand All @@ -6180,14 +6158,14 @@
}

/* Checkbox menuitem, None iconic menu */
:not(menu, #ContentSelectDropdown, #context-navigation) > menupopup > menuitem[type="checkbox"],
:not(menu, #ContentSelectDropdown, #context-navigation) > menupopup > menuitem[checked="true"],
:not(menu, #ContentSelectDropdown, #context-navigation) > menupopup > menu:not(.menu-iconic) {
padding-inline-start: calc(var(--context-menu-background-padding) + var(--context-menu-mac-padding)) !important;
}

/* Global Menu */
/* Disabled. some icons not appear
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup) menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [type=checkbox], [checked=true]), menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup) menu:not(.menu-iconic, .in-menulist, [type=checkbox], [checked=true]) {
menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup) menuitem:not(.menuitem-iconic, .bookmark-item, .in-menulist, [checked=true]), menupopup:is(#menu_FilePopup, #menu_EditPopup, #menu_viewPopup, #goPopup, #historyMenuPopup, #bookmarksMenuPopup, #menu_ToolsPopup, #menu_HelpPopup) menu:not(.menu-iconic, .in-menulist, [checked=true]) {
list-style-image: var(--menuitem-image, url("../icons/blank.svg"));
}
*/
Expand Down
34 changes: 18 additions & 16 deletions src/icons/_layout_menu.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//-- Mixin ---------------------------------------------------------------------
// Items
$_iconNoneCommon: ".in-menulist, [type=\"checkbox\"], [checked=\"true\"]";
$_iconNoneCommon: ".in-menulist, [checked=\"true\"]";
$_iconMenuitem: "menuitem:not(.menuitem-iconic, .bookmark-item, #{$_iconNoneCommon})";
$_iconMenu: "menu:not(.menu-iconic, #{$_iconNoneCommon})";

Expand Down Expand Up @@ -57,8 +57,10 @@ $_layoutCommonMenus: (
}

//------------------------------------------------------------------------------
menupopup menuitem:not([type="checkbox"], [type="radio"]),
menupopup menu:not([type="checkbox"], [type="radio"]),
#{selector.append(
"menupopup menuitem, menupopup menu",
":not([type=\"checkbox\"][checked=\"true\"], [type=\"radio\"])"
)},
#{$_globalMenus} {
-moz-appearance: none !important; /* Linux: menulist */
}
Expand Down Expand Up @@ -113,18 +115,18 @@ menupopup menu:not([type="checkbox"], [type="radio"]),
}

/* Padding - Windows */
@include OS($win) {
/* Checkbox */
:root {
--context-menu-text-padding: calc(var(--menu-padding) + var(--context-menu-background-padding-default) + 16px);
}
:not(menu, #ContentSelectDropdown, #context-navigation)
> menupopup
> menuitem[type="checkbox"]:not([checked="true"])
> .menu-iconic-left {
padding-inline-start: var(--context-menu-text-padding);
}
}
// @include OS($win) {
// /* Checkbox */
// :root {
// --context-menu-text-padding: calc(var(--menu-padding) + var(--context-menu-background-padding-default) + 16px);
// }
// :not(menu, #ContentSelectDropdown, #context-navigation)
// > menupopup
// > menuitem[type="checkbox"]:not([checked="true"])
// > .menu-iconic-left {
// padding-inline-start: var(--context-menu-text-padding);
// }
// }

@include OS($win7) {
:root {
Expand Down Expand Up @@ -185,7 +187,7 @@ menupopup menu:not([type="checkbox"], [type="radio"]),
}

/* Checkbox menuitem, None iconic menu */
#{selector.nest($_nestedPopupPadding, "menuitem[type=\"checkbox\"], menu:not(.menu-iconic)")} {
#{selector.nest($_nestedPopupPadding, "menuitem[checked=\"true\"], menu:not(.menu-iconic)")} {
padding-inline-start: calc(var(--context-menu-background-padding) + var(--context-menu-mac-padding)) !important;
}

Expand Down

0 comments on commit 9645e43

Please sign in to comment.