Skip to content

Commit

Permalink
add icons for some sync sharing buttons
Browse files Browse the repository at this point in the history
that are in the "send x to device" menus.
also fix an issue with the margins/placement of some popup notifications
anchored to the identity or tracking protection icons.
  • Loading branch information
aminomancer committed Aug 7, 2022
1 parent 098424d commit 0637caf
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 18 deletions.
16 changes: 7 additions & 9 deletions JS/verticalTabsPane.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Vertical Tabs Pane
// @version 1.6.4
// @version 1.6.5
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Create a vertical pane across from the sidebar that functions
Expand Down Expand Up @@ -152,13 +152,9 @@
this._registerSheet();
// ensure E10SUtils are available. required for showing tab's process ID
// in its tooltip, if the pref for that is enabled.
if (window.E10SUtils) {
this.E10SUtils = window.E10SUtils;
} else {
XPCOMUtils.defineLazyModuleGetters(this, {
E10SUtils: "resource://gre/modules/E10SUtils.jsm",
});
}
XPCOMUtils.defineLazyModuleGetters(this, {
E10SUtils: "resource://gre/modules/E10SUtils.jsm",
});
// get some localized strings for the tooltip
XPCOMUtils.defineLazyGetter(this, "_l10n", function () {
return new Localization(["browser/browser.ftl"], true);
Expand Down Expand Up @@ -524,6 +520,8 @@
title = config.l10n.prompt["Hover out delay title"];
text = config.l10n.prompt["Hover out delay description"];
break;
default:
return;
}
let input = { value: val };
let win = Services.wm.getMostRecentWindow(null);
Expand Down Expand Up @@ -1530,7 +1528,7 @@
gBrowser.warmupTab(tab);
}
// invoked when mousing out of an element.
_onMouseOut (e) {
_onMouseOut(e) {
let row = e.target.closest(".all-tabs-item");
if (e.target.classList.contains("all-tabs-secondary-button")) {
row.mOverSecondaryButton = false;
Expand Down
41 changes: 39 additions & 2 deletions uc-app-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -670,16 +670,24 @@ toolbarseparator.proton-zap {
margin-block: 0 !important;
}

.subviewbutton .syncnow-label {
text-align: start;
display: -moz-box;
margin: 0;
}

#PanelUI-fxa-menu-syncnow-button label,
#PanelUI-fxa-menu-setup-sync-button .toolbarbutton-text,
#PanelUI-fxa-menu-connect-device-button .toolbarbutton-text,
#PanelUI-fxa-menu-sendtab-button .toolbarbutton-text,
#PanelUI-fxa-menu-sync-prefs-button .toolbarbutton-text,
#PanelUI-fxa-menu-account-signout-button .toolbarbutton-text {
#PanelUI-fxa-menu-account-signout-button .toolbarbutton-text,
#PanelUI-remotetabs-syncnow .syncnow-label {
padding-inline-start: var(--arrowpanel-subviewbutton-iconic-gap, 8px) !important;
}

#PanelUI-fxa-menu-syncnow-button image {
#PanelUI-fxa-menu-syncnow-button image,
#PanelUI-remotetabs-syncnow image {
list-style-image: url(chrome://userchrome/content/skin/sync.svg) !important;
-moz-box-ordinal-group: unset !important;
visibility: unset !important;
Expand Down Expand Up @@ -713,6 +721,35 @@ toolbarseparator.proton-zap {
list-style-image: url(chrome://userchrome/content/fxa/sign-out.svg);
}

#PanelUI-remotetabs-view-managedevices {
padding-inline-start: calc(
var(--arrowpanel-menuitem-padding-inline) + 16px +
var(--arrowpanel-subviewbutton-iconic-gap, 8px)
) !important;
background-image: url(chrome://userchrome/content/fxa/avatar-big.svg);
background-repeat: no-repeat;
background-size: 16px;
background-position: var(--arrowpanel-menuitem-padding-inline) center;
fill: currentColor;
-moz-context-properties: fill, fill-opacity;
}

toolbarbutton.subviewbutton.sendToDevice-device[clientType=""][clientId=""] {
list-style-image: url(chrome://userchrome/content/chevron.svg);
}

toolbarbutton.subviewbutton.sendToDevice-device[clientType=""][clientId=""]
+ toolbarbutton.subviewbutton.sendToDevice-device:not([clientType], [clientId]) {
list-style-image: url(chrome://userchrome/content/fxa/add-device.svg);
}

toolbarbutton.subviewbutton.sendToDevice-device[clientType=""][clientId=""] .toolbarbutton-text,
toolbarbutton.subviewbutton.sendToDevice-device[clientType=""][clientId=""]
+ toolbarbutton.subviewbutton.sendToDevice-device:not([clientType], [clientId])
.toolbarbutton-text {
padding-inline-start: var(--arrowpanel-subviewbutton-iconic-gap, 8px);
}

.PanelUI-remotetabs-clientcontainer > label[itemtype="client"] {
padding: 4px;
font-size: 11px;
Expand Down
37 changes: 35 additions & 2 deletions uc-context-menu-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,17 @@ menuitem#enableDeveloperTools .menu-text,
#recently-closed-remove-from-history > .menu-text,
#recently-closed-bookmark > .menu-text,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType]
.sendtab-target[clientType]:not([clientType=""])
.menu-text,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target.signintosync
.menu-text,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType=""][clientId=""]
.menu-text,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType=""][clientId=""]
+ .sendtab-target:not([clientType], [clientId])
.menu-text,
#userScriptsMenu > .menu-text,
#toggle_PersonalToolbar > .menu-text,
Expand Down Expand Up @@ -570,7 +580,14 @@ menuitem#enableDeveloperTools::before,
#recently-closed-remove-from-history::before,
#recently-closed-bookmark::before,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType]::before,
.sendtab-target[clientType]:not([clientType=""])::before,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target.signintosync::before,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType=""][clientId=""]::before,
:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType=""][clientId=""]
+ .sendtab-target:not([clientType], [clientId])::before,
:is(#spell-add-to-dictionary, #spell-add-dictionaries, #spell-add-dictionaries-main, #spell-dictionaries)::before,
#context-showonlythisframe::before,
#contentAreaContextMenu #frame::before,
Expand Down Expand Up @@ -1403,6 +1420,22 @@ menuitem#enableDeveloperTools::before {
background-image: url(chrome://userchrome/content/skin/device-vr.svg);
}

:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target.signintosync::before {
background-image: url(chrome://userchrome/content/skin/sync.svg);
}

:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType=""][clientId=""]::before {
background-image: url(chrome://userchrome/content/chevron.svg);
}

:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice)
.sendtab-target[clientType=""][clientId=""]
+ .sendtab-target:not([clientType], [clientId])::before {
background-image: url(chrome://userchrome/content/fxa/add-device.svg);
}

:is(#contentAreaContextMenu, #toolbar-context-menu)
menu[label="Bitwarden"]
:is(menu, menuitem)[id$="-menuitem-_autofill"]::before {
Expand Down
2 changes: 1 addition & 1 deletion uc-context-menus.css
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ panel > richlistbox > richlistitem {
}

menuitem[default="true"] {
font-weight: normal !important;
font-weight: normal !important;
}

/* a way to reduce the number of menuseparators in the context menu, if they feel excessive */
Expand Down
2 changes: 1 addition & 1 deletion uc-panels.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ this connects with .panel-subview-body rules in userChrome.au.css */
#identity-popup,
#protections-popup,
#permission-popup {
margin-top: -9px !important;
margin-top: -1px !important;
}

#customizationui-widget-panel.bookmarks-toolbar {
Expand Down
3 changes: 1 addition & 2 deletions uc-urlbar-results.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ by underlining them (requires urlbarMods.uc.js) */
color: var(--panel-description-color) !important;
}

.urlbarView-row[dynamicType="quickactions"]
.urlbarView-quickaction-row:hover {
.urlbarView-row[dynamicType="quickactions"] .urlbarView-quickaction-row:hover {
background: var(--uc-arrowpanel-dimmed) !important;
color: var(--panel-shortcut-focus) !important;
fill-opacity: 1 !important;
Expand Down
1 change: 0 additions & 1 deletion uc-urlbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ the NTP/home page hasn't opened yet. */
#tracking-protection-icon-container {
color: var(--lwt-toolbarbutton-icon-fill) !important;
fill-opacity: var(--urlbar-icon-fill-opacity) !important;
height: var(--urlbar-height) !important;
}

#identity-box {
Expand Down

0 comments on commit 0637caf

Please sign in to comment.