Skip to content

Commit

Permalink
Fix: Icons - Sidebar Menu Popop #749
Browse files Browse the repository at this point in the history
  • Loading branch information
black7375 committed Aug 4, 2023
1 parent d9a8063 commit b3edd20
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 14 deletions.
44 changes: 38 additions & 6 deletions css/leptonChrome.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 19 additions & 7 deletions src/icons/_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -469,28 +469,40 @@ panelMenuBookmarkThisPage[starred] {
}

/*= sidebarMenu-popup ========================================================*/
@mixin _subviewMenuitem($icon, $selector: null) {
&.subviewbutton#{$selector} {
list-style-image: $icon;
}
&:is(menuitem)#{$selector} {
--menuitem-image: #{$icon};
}
}

#identity-popup-more-info {
list-style-image: url("chrome://global/skin/icons/info.svg");
@include _subviewMenuitem(url("chrome://global/skin/icons/info.svg"));
}

#sidebar-switcher-bookmarks {
list-style-image: url("chrome://browser/skin/bookmark.svg");
@include _subviewMenuitem(url("chrome://browser/skin/bookmark.svg"));
}

#sidebar-switcher-history {
list-style-image: url("chrome://browser/skin/history.svg");
@include _subviewMenuitem(url("chrome://browser/skin/history.svg"));
}

#sidebar-switcher-tabs {
list-style-image: url("../icons/synced-tabs.svg");
@include _subviewMenuitem(url("../icons/synced-tabs.svg"));
}

#sidebar-reverse-position {
list-style-image: var(--uc-sidebar-icon-reverse);
@include _subviewMenuitem(var(--uc-sidebar-icon-reverse));
}

#sidebarMenu-popup > .subviewbutton[data-l10n-id="sidebar-menu-close"] {
list-style-image: url("chrome://global/skin/icons/close.svg");
#sidebarMenu-popup > * {
@include _subviewMenuitem(
url("chrome://global/skin/icons/close.svg"),
"[data-l10n-id=\"sidebar-menu-close\"]"
);
}

/*= unified-extensions-view ===================================================*/
Expand Down
6 changes: 6 additions & 0 deletions src/icons/layout/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ $_layoutCommonMenus: (
@include _layoutInitPaddingMenus {
@include _layout_init_padding;
}
#sidebarMenu-popup:has(menuitem) {
@include _layout_init_margin;
:not(menu, #ContentSelectDropdown, #context-navigation) > & > #{$_iconMenuitem} {
padding-inline-start: 28px !important;
}
}

/* Menubar */
@include Option("userChrome.icon.global_menubar") {
Expand Down
6 changes: 5 additions & 1 deletion src/icons/layout/_menu_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $_libraryMenuitem: "menupopup:is(#organizeButtonPopup, #maintenanceButtonPopup)
$_libraryMenu: "menupopup:is(#viewMenuPopup, #maintenanceButtonPopup) > #{$_iconMenu}";
$_sendTabMenuPopup: "#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice-popup";
$_otherPopupMenuitem: "menupopup:is(#{$_sendTabMenuPopup}, #frame > menupopup) > menuitem";
$_otherIconMenu: ".openintabs-menuitem, #blockedPopupDontShowMessage, #BMB_viewBookmarksToolbar";
$_otherIconMenu: ".openintabs-menuitem, #blockedPopupDontShowMessage, #BMB_viewBookmarksToolbar, #sidebarMenu-popup";

//-- Mixin ---------------------------------------------------------------------
// Init Menu
Expand Down Expand Up @@ -79,6 +79,10 @@ $_initialMenus: $_initialMenus + "," +
background-position: var(--uc-menu-background-position) var(--context-menu-background-padding) center !important;
padding-inline-start: var(--context-menu-background-padding) !important;
}
@mixin _layout_init_margin() {
// Fix sidebar position
margin-inline-start: calc((var(--context-menu-background-padding) + var(--panel-shadow-margin, 4px)) * -1) !important
}

@mixin _layout_win_native_menu_popup() {
@include NativeMenuPopup {
Expand Down

0 comments on commit b3edd20

Please sign in to comment.