Bug 1697617 - Update Synced Tabs menu for Proton. r=emalysz,flod,desktop-theme-reviewers,harry

Differential Revision: https://phabricator.services.mozilla.com/D109404
This commit is contained in:
Mike Conley 2021-03-24 07:20:46 +00:00
parent 52f20669ae
commit f7505a1445
8 changed files with 51 additions and 22 deletions

View File

@ -43,7 +43,6 @@ var SidebarUI = {
url: "chrome://browser/content/syncedtabs/sidebar.xhtml",
menuId: "menu_tabsSidebar",
buttonId: "sidebar-switcher-tabs",
triggerButtonId: "PanelUI-remotetabs-view-sidebar",
},
],
]));

View File

@ -1372,18 +1372,6 @@
<!-- When Sync is ready to sync -->
<vbox id="PanelUI-remotetabs-main" hidden="true">
<vbox id="PanelUI-remotetabs-buttons">
<toolbarbutton id="PanelUI-remotetabs-view-sidebar"
class="subviewbutton subviewbutton-iconic"
label="&appMenuRemoteTabs.sidebar.label;"
label-checked="&appMenuRemoteTabs.hidesidebar.label;"
label-unchecked="&appMenuRemoteTabs.sidebar.label;"
oncommand="SidebarUI.toggle('viewTabsSidebar', this);"/>
<toolbarbutton id="PanelUI-remotetabs-view-managedevices"
class="subviewbutton subviewbutton-iconic"
label="&appMenuRemoteTabs.managedevices.label;"
oncommand="gSync.openDevicesManagementPage('syncedtabs-menupanel');">
<observes element="sidebar-box" attribute="positionend"/>
</toolbarbutton>
<toolbarbutton id="PanelUI-remotetabs-syncnow"
align="center"
class="subviewbutton subviewbutton-iconic"
@ -1393,12 +1381,18 @@
<hbox flex="1">
<image class="syncNowBtn"/>
<label class="syncnow-label"
data-l10n-id="appmenuitem-fxa-toolbar-sync-now2"
sync-now-data-l10n-id="appmenuitem-fxa-toolbar-sync-now2"
data-l10n-id="remote-tabs-sync-now"
sync-now-data-l10n-id="remote-tabs-sync-now"
syncing-data-l10n-id="fxa-toolbar-sync-syncing2"
crop="end"/>
</hbox>
</toolbarbutton>
<toolbarbutton id="PanelUI-remotetabs-view-managedevices"
class="subviewbutton subviewbutton-iconic"
data-l10n-id="remote-tabs-manage-account"
oncommand="gSync.openDevicesManagementPage('syncedtabs-menupanel');">
<observes element="sidebar-box" attribute="positionend"/>
</toolbarbutton>
<toolbarseparator id="PanelUI-remotetabs-separator"/>
</vbox>
<deck id="PanelUI-remotetabs-deck">

View File

@ -614,6 +614,18 @@ if (Services.prefs.getBoolPref("identity.fxaccounts.enabled")) {
onViewShowing(aEvent) {
let panelview = aEvent.target;
let doc = panelview.ownerDocument;
let window = doc.defaultView;
// While we support this panel for both Proton and non-Proton versions
// of the AppMenu, we only want to show icons for the non-Proton
// version. When Proton ships and we remove the non-Proton variant,
// we can remove the subviewbutton-iconic classes from the markup.
if (window.PanelUI.protonAppMenuEnabled) {
let toolbarbuttons = panelview.querySelectorAll("toolbarbutton");
for (let toolbarbutton of toolbarbuttons) {
toolbarbutton.classList.remove("subviewbutton-iconic");
}
}
let syncNowBtn = panelview.querySelector(".syncnow-label");
let l10nId = syncNowBtn.getAttribute("sync-now-data-l10n-id");

View File

@ -663,3 +663,9 @@ panel-save-update-password = Password
# $name (String): The name of the addon that will be removed.
addon-removal-title = Remove { $name }?
addon-removal-abuse-report-checkbox = Report this extension to { -vendor-short-name }
## Remote / Synced tabs
remote-tabs-manage-account =
.label = Manage Account
remote-tabs-sync-now = Sync Now

View File

@ -107,9 +107,6 @@ this container is a toolbar. This avoids double-speaking. -->
<!ENTITY appMenuRemoteTabs.unverified.label "Your account needs to be verified.">
<!ENTITY appMenuRemoteTabs.signintosync.label "Sign in to &syncBrand.shortName.label;…">
<!ENTITY appMenuRemoteTabs.turnonsync.label "Turn on &syncBrand.shortName.label;…">
<!ENTITY appMenuRemoteTabs.managedevices.label "Manage Devices…">
<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs Sidebar">
<!ENTITY appMenuRemoteTabs.hidesidebar.label "Hide Synced Tabs Sidebar">
<!ENTITY appMenuRemoteTabs.connectdevice.label "Connect Another Device">
<!ENTITY customizeMenu.addToToolbar.label "Add to Toolbar">

View File

@ -816,7 +816,8 @@ toolbarbutton[constrain-size="true"][cui-areatype="menu-panel"] > .toolbarbutton
}
#fxa-manage-account-button > vbox > label,
#PanelUI-fxa-menu-syncnow-button > hbox > label {
#PanelUI-fxa-menu-syncnow-button > hbox > label,
#PanelUI-remotetabs-syncnow > hbox > label {
margin-inline-start: 0;
}

View File

@ -120,15 +120,12 @@
}
#PanelUI-fxa-menu-view-sidebar,
#PanelUI-remotetabs-view-sidebar,
#panelMenu_viewBookmarksSidebar {
list-style-image: url("chrome://browser/skin/sidebars-right.svg");
}
#PanelUI-fxa-menu-view-sidebar:-moz-locale-dir(ltr):not([positionend]),
#PanelUI-fxa-menu-view-sidebar:-moz-locale-dir(rtl)[positionend],
#PanelUI-remotetabs-view-sidebar:-moz-locale-dir(ltr):not([positionend]),
#PanelUI-remotetabs-view-sidebar:-moz-locale-dir(rtl)[positionend],
#panelMenu_viewBookmarksSidebar:-moz-locale-dir(ltr):not([positionend]),
#panelMenu_viewBookmarksSidebar:-moz-locale-dir(rtl)[positionend] {
list-style-image: url("chrome://browser/skin/sidebars.svg");

View File

@ -0,0 +1,23 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
from fluent.migrate.helpers import transforms_from
def migrate(ctx):
"""Bug 1697617 - Fork the Manage Account string from the App Menu for Synced Tabs, part {index}"""
ctx.add_transforms(
"browser/browser/browser.ftl",
"browser/browser/browser.ftl",
transforms_from(
"""
remote-tabs-manage-account =
.label = { COPY_PATTERN(from_path, "appmenuitem-fxa-manage-account") }
remote-tabs-sync-now = { COPY_PATTERN(from_path, "appmenuitem-fxa-toolbar-sync-now2") }
""",
from_path="browser/browser/appmenu.ftl",
),
)