Bug 1446975 - Replace synced Tabs sidebar device icons. r=eoger

MozReview-Commit-ID: GnawrVrfpEz


--HG--
rename : browser/themes/shared/icons/device-mobile.svg => browser/themes/shared/icons/device-phone.svg
This commit is contained in:
Amy Chan 2018-03-27 23:38:30 -07:00 коммит произвёл Edouard Oger
Родитель 5c59f7731c
Коммит 711220e6e7
16 изменённых файлов: 30 добавлений и 51 удалений

Просмотреть файл

@ -384,8 +384,7 @@ var gSync = {
const clients = this.remoteClients;
for (let client of clients) {
const type = client.formfactor && client.formfactor.includes("tablet") ?
"tablet" : client.type;
const type = Weave.Service.clientsEngine.getClientType(client.id);
addTargetDevice(client.id, client.name, type, new Date(client.serverLastModified * 1000));
}

Просмотреть файл

@ -231,14 +231,10 @@ TabListView.prototype = {
} else {
itemNode.classList.remove("selected");
}
if (item.isMobile) {
itemNode.classList.add("device-image-mobile");
} else {
itemNode.classList.add("device-image-desktop");
}
if (item.focused) {
itemNode.focus();
}
itemNode.setAttribute("clientType", item.clientType);
itemNode.dataset.id = item.id;
itemNode.querySelector(".item-title").textContent = item.name;
},

Просмотреть файл

@ -6,7 +6,7 @@ const FIXTURE = [
"type": "client",
"lastModified": 1492201200,
"name": "zcarter's Nightly on MacBook-Pro-25",
"isMobile": false,
"clientType": "desktop",
"tabs": [
{
"type": "tab",
@ -23,7 +23,7 @@ const FIXTURE = [
"type": "client",
"lastModified": 1492201200,
"name": "laptop",
"isMobile": false,
"clientType": "desktop",
"tabs": [
{
"type": "tab",
@ -57,7 +57,7 @@ const FIXTURE = [
"type": "client",
"lastModified": 1492201200,
"name": "desktop",
"isMobile": false,
"clientType": "desktop",
"tabs": []
}
];

Просмотреть файл

@ -49,8 +49,6 @@ browser.jar:
skin/classic/browser/preferences/applications.css (preferences/applications.css)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg)
skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
[extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:

Просмотреть файл

@ -58,8 +58,6 @@ browser.jar:
skin/classic/browser/preferences/applications.css (preferences/applications.css)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/tabbrowser/tabDragIndicator@2x.png (tabbrowser/tabDragIndicator@2x.png)
skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg)
skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
[extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 540 B

После

Ширина:  |  Высота:  |  Размер: 540 B

Просмотреть файл

@ -128,7 +128,7 @@
skin/classic/browser/check-animation.svg (../shared/icons/check-animation.svg)
skin/classic/browser/customize.svg (../shared/icons/customize.svg)
skin/classic/browser/developer.svg (../shared/icons/developer.svg)
skin/classic/browser/device-mobile.svg (../shared/icons/device-mobile.svg)
skin/classic/browser/device-phone.svg (../shared/icons/device-phone.svg)
skin/classic/browser/device-tablet.svg (../shared/icons/device-tablet.svg)
skin/classic/browser/device-desktop.svg (../shared/icons/device-desktop.svg)
skin/classic/browser/edit-copy.svg (../shared/icons/edit-copy.svg)

Просмотреть файл

@ -83,7 +83,7 @@
}
#PanelUI-remotetabs-view-managedevices {
list-style-image: url("chrome://browser/skin/device-mobile.svg");
list-style-image: url("chrome://browser/skin/device-phone.svg");
}
#appMenuViewHistorySidebar,

Просмотреть файл

@ -1,8 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg"
width="16" height="16" viewBox="0 0 16 16">
<path fill="context-fill" d="M15,14H1a1,1,0,0,1-1-1V12.526H16V13A1,1,0,0,1,15,14ZM1,4A1,1,0,0,1,2,3H14a1,1,0,0,1,1,1v8H1V4Zm1,7H14V4H2v7Z"/>
<rect fill="context-fill" fill-opacity="0.15" x="2" y="4" width="12" height="7"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 535 B

Просмотреть файл

@ -1,8 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg"
width="16" height="16" viewBox="0 0 16 16">
<path fill="context-fill" d="M12,16H4a1,1,0,0,1-1-1V1A1,1,0,0,1,4,0h8a1,1,0,0,1,1,1V15A1,1,0,0,1,12,16Zm-4-.684a0.785,0.785,0,1,0-.785-0.785A0.785,0.785,0,0,0,8,15.316ZM12,2H4V13h8V2Z"/>
<rect fill="context-fill" fill-opacity="0.15" x="4" y="2" width="8" height="11"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 581 B

Просмотреть файл

@ -88,24 +88,25 @@ body {
padding-inline-start: 20px;
}
.item.client.device-image-desktop > .item-title-container > .item-icon-container {
background-image: url("chrome://browser/skin/sync-desktopIcon.svg");
.item.client[clientType] > .item-title-container > .item-icon-container {
-moz-context-properties: fill;
fill: #4d4d4d;
}
.item.client.device-image-desktop.selected:focus > .item-title-container > .item-icon-container {
.item.client[clientType].selected:focus > .item-title-container > .item-icon-container {
fill: white;
}
.item.client.device-image-mobile > .item-title-container > .item-icon-container {
background-image: url("chrome://browser/skin/sync-mobileIcon.svg");
-moz-context-properties: fill;
fill: #4d4d4d;
.item.client[clientType=phone] > .item-title-container > .item-icon-container {
background-image: url("chrome://browser/skin/device-phone.svg");
}
.item.client.device-image-mobile.selected:focus > .item-title-container > .item-icon-container {
fill: white;
.item.client[clientType=tablet] > .item-title-container > .item-icon-container {
background-image: url("chrome://browser/skin/device-tablet.svg");
}
.item.client[clientType=desktop] > .item-title-container > .item-icon-container {
background-image: url("chrome://browser/skin/device-desktop.svg");
}
.item.tab > .item-title-container > .item-icon-container {

Просмотреть файл

@ -151,8 +151,8 @@
transform: scaleX(-1);
}
.pageAction-sendToDevice-device[clientType=mobile] {
list-style-image: url("chrome://browser/skin/device-mobile.svg");
.pageAction-sendToDevice-device[clientType=phone] {
list-style-image: url("chrome://browser/skin/device-phone.svg");
}
.pageAction-sendToDevice-device[clientType=tablet] {

Просмотреть файл

@ -16,8 +16,6 @@ browser.jar:
* skin/classic/browser/searchbar.css
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/slowStartup-16.png
skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg)
skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
skin/classic/browser/webRTC-indicator.css (../shared/webRTC-indicator.css)
* skin/classic/browser/controlcenter/panel.css (controlcenter/panel.css)
skin/classic/browser/customizableui/menu-arrow.svg (customizableui/menu-arrow.svg)

Просмотреть файл

@ -76,7 +76,7 @@ let SyncedTabsInternal = {
id: client.id,
type: "client",
name: Weave.Service.clientsEngine.getClientName(client.id),
isMobile: Weave.Service.clientsEngine.isMobile(client.id),
clientType: Weave.Service.clientsEngine.getClientType(client.id),
lastModified: client.lastModified * 1000, // sec to ms
tabs: []
};

Просмотреть файл

@ -232,10 +232,15 @@ ClientEngine.prototype = {
return null;
},
isMobile: function isMobile(id) {
if (this._store._remoteClients[id])
return this._store._remoteClients[id].type == DEVICE_TYPE_MOBILE;
return false;
getClientType(id) {
const client = this._store._remoteClients[id];
if (client.type == DEVICE_TYPE_DESKTOP) {
return "desktop";
}
if (client.formfactor && client.formfactor.includes("tablet")) {
return "tablet"
}
return "phone";
},
async _readCommands() {

Просмотреть файл

@ -135,7 +135,7 @@ var PlacesRemoteTabsAutocompleteProvider = {
// create the record we return for auto-complete.
let record = {
url, title, icon,
deviceClass: Weave.Service.clientsEngine.isMobile(clientId) ? "mobile" : "desktop",
deviceClass: Weave.Service.clientsEngine.getClientType(clientId),
deviceName: client.clientName,
};
matches.push(record);