diff options
| author | Lootyhoof <lootyhoofer@gmail.com> | 2018-11-20 22:58:11 +0000 |
|---|---|---|
| committer | Lootyhoof <lootyhoofer@gmail.com> | 2018-11-20 22:58:11 +0000 |
| commit | e130d91e9b97fb05dcc43c015030887442a3a0e6 (patch) | |
| tree | 7e199a11cd3c04a268d7bcc8c49b6e8bfd9a89b6 | |
| parent | 2be32c6085b8303c3f8c41ba61c341c36b57802a (diff) | |
Add tab audio indicators
| -rw-r--r-- | src/chrome/browser/browser.css | 99 | ||||
| -rw-r--r-- | src/chrome/browser/filters.svg | 9 | ||||
| -rw-r--r-- | src/chrome/browser/tabbrowser/tab-audio-small.svg | 58 | ||||
| -rw-r--r-- | src/chrome/browser/tabbrowser/tab-audio.svg | 18 |
4 files changed, 184 insertions, 0 deletions
diff --git a/src/chrome/browser/browser.css b/src/chrome/browser/browser.css index 92ea050..6792839 100644 --- a/src/chrome/browser/browser.css +++ b/src/chrome/browser/browser.css | |||
| @@ -1434,6 +1434,105 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- | |||
| 1434 | outline: none !important; | 1434 | outline: none !important; |
| 1435 | } | 1435 | } |
| 1436 | 1436 | ||
| 1437 | /* Tab sound indicator */ | ||
| 1438 | .tab-icon-sound { | ||
| 1439 | -moz-margin-start: 4px; | ||
| 1440 | width: 16px; | ||
| 1441 | height: 16px; | ||
| 1442 | padding: 0; | ||
| 1443 | } | ||
| 1444 | |||
| 1445 | .allTabs-endimage[soundplaying], | ||
| 1446 | .allTabs-endimage[muted], | ||
| 1447 | .allTabs-endimage[blocked], | ||
| 1448 | .tab-icon-sound[soundplaying], | ||
| 1449 | .tab-icon-sound[muted], | ||
| 1450 | .tab-icon-sound[blocked] { | ||
| 1451 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio"); | ||
| 1452 | filter: url(chrome://browser/skin/filters.svg#fill); | ||
| 1453 | fill: currentColor; | ||
| 1454 | } | ||
| 1455 | |||
| 1456 | .allTabs-endimage[muted], | ||
| 1457 | .tab-icon-sound[muted] { | ||
| 1458 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted"); | ||
| 1459 | } | ||
| 1460 | |||
| 1461 | .allTabs-endimage[blocked], | ||
| 1462 | .tab-icon-sound[blocked] { | ||
| 1463 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-blocked"); | ||
| 1464 | } | ||
| 1465 | |||
| 1466 | .tab-icon-sound:-moz-lwtheme-darktext[soundplaying], | ||
| 1467 | .tab-icon-sound:-moz-lwtheme-darktext[muted], | ||
| 1468 | .tab-icon-sound:-moz-lwtheme-darktext[blocked] { | ||
| 1469 | filter: url(chrome://browser/skin/filters.svg#fill) drop-shadow(1px 1px 1px white); | ||
| 1470 | } | ||
| 1471 | |||
| 1472 | .tab-icon-sound:-moz-lwtheme-brighttext[soundplaying], | ||
| 1473 | .tab-icon-sound:-moz-lwtheme-brighttext[muted], | ||
| 1474 | .tab-icon-sound:-moz-lwtheme-brighttext[blocked] { | ||
| 1475 | filter: url(chrome://browser/skin/filters.svg#fill) drop-shadow(1px 1px 1px black); | ||
| 1476 | } | ||
| 1477 | |||
| 1478 | .tab-icon-sound[soundplaying]:not(:hover), | ||
| 1479 | .tab-icon-sound[muted]:not(:hover), | ||
| 1480 | .tab-icon-sound[blocked]:not(:hover) { | ||
| 1481 | opacity: .8; | ||
| 1482 | } | ||
| 1483 | |||
| 1484 | .tab-icon-sound[soundplaying-scheduledremoval]:not([muted]):not(:hover), | ||
| 1485 | .tab-icon-overlay[soundplaying-scheduledremoval]:not([muted]):not(:hover) { | ||
| 1486 | transition: opacity .3s linear var(--soundplaying-removal-delay); | ||
| 1487 | opacity: 0; | ||
| 1488 | } | ||
| 1489 | |||
| 1490 | /* Tab icon overlay */ | ||
| 1491 | .tab-icon-overlay { | ||
| 1492 | width: 16px; | ||
| 1493 | height: 16px; | ||
| 1494 | margin-top: -8px; | ||
| 1495 | margin-inline-start: -15px; | ||
| 1496 | margin-inline-end: -1px; | ||
| 1497 | position: relative; | ||
| 1498 | } | ||
| 1499 | |||
| 1500 | .tab-icon-overlay[soundplaying], | ||
| 1501 | .tab-icon-overlay[muted]:not([crashed]), | ||
| 1502 | .tab-icon-overlay[blocked]:not([crashed]) { | ||
| 1503 | border-radius: 10px; | ||
| 1504 | } | ||
| 1505 | |||
| 1506 | .tab-icon-overlay[soundplaying]:hover, | ||
| 1507 | .tab-icon-overlay[muted]:not([crashed]):hover, | ||
| 1508 | .tab-icon-overlay[blocked]:not([crashed]):hover { | ||
| 1509 | background-color: black; | ||
| 1510 | } | ||
| 1511 | |||
| 1512 | .tab-icon-overlay[soundplaying] { | ||
| 1513 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white"); | ||
| 1514 | } | ||
| 1515 | |||
| 1516 | .tab-icon-overlay[muted] { | ||
| 1517 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-muted"); | ||
| 1518 | } | ||
| 1519 | |||
| 1520 | .tab-icon-overlay[blocked] { | ||
| 1521 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-blocked"); | ||
| 1522 | } | ||
| 1523 | |||
| 1524 | .tab-icon-overlay[soundplaying]:-moz-lwtheme-darktext:not(:hover) { | ||
| 1525 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio"); | ||
| 1526 | } | ||
| 1527 | |||
| 1528 | .tab-icon-overlay[muted]:-moz-lwtheme-darktext:not(:hover) { | ||
| 1529 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-muted"); | ||
| 1530 | } | ||
| 1531 | |||
| 1532 | .tab-icon-overlay[blocked]:-moz-lwtheme-darktext:not(:hover) { | ||
| 1533 | list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-blocked"); | ||
| 1534 | } | ||
| 1535 | |||
| 1437 | /* Tab Overflow */ | 1536 | /* Tab Overflow */ |
| 1438 | .tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator:not([collapsed]), | 1537 | .tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator:not([collapsed]), |
| 1439 | .tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator:not([collapsed]) { | 1538 | .tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator:not([collapsed]) { |
diff --git a/src/chrome/browser/filters.svg b/src/chrome/browser/filters.svg new file mode 100644 index 0000000..8fccb13 --- /dev/null +++ b/src/chrome/browser/filters.svg | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <?xml version="1.0"?> | ||
| 2 | <!-- This Source Code Form is subject to the terms of the Mozilla Public | ||
| 3 | - License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| 4 | - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> | ||
| 5 | <svg xmlns="http://www.w3.org/2000/svg"> | ||
| 6 | <filter id="fill"> | ||
| 7 | <feComposite in="FillPaint" in2="SourceGraphic" operator="in"/> | ||
| 8 | </filter> | ||
| 9 | </svg> | ||
diff --git a/src/chrome/browser/tabbrowser/tab-audio-small.svg b/src/chrome/browser/tabbrowser/tab-audio-small.svg new file mode 100644 index 0000000..abfe712 --- /dev/null +++ b/src/chrome/browser/tabbrowser/tab-audio-small.svg | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- This Source Code Form is subject to the terms of the Mozilla Public | ||
| 3 | - License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| 4 | - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> | ||
| 5 | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"> | ||
| 6 | <style> | ||
| 7 | .icon:not(:target) { | ||
| 8 | display: none; | ||
| 9 | } | ||
| 10 | |||
| 11 | .icon { | ||
| 12 | fill: #262626; | ||
| 13 | } | ||
| 14 | .icon > .outline { | ||
| 15 | fill: #fff; | ||
| 16 | } | ||
| 17 | |||
| 18 | .icon.white { | ||
| 19 | fill: #fff; | ||
| 20 | } | ||
| 21 | .icon.white > .outline { | ||
| 22 | fill: #000; | ||
| 23 | fill-opacity: .5; | ||
| 24 | } | ||
| 25 | </style> | ||
| 26 | |||
| 27 | <g id="tab-audio" class="icon"> | ||
| 28 | <path class="outline" d="M12.4,3.6l-1-0.6l-0.9,2.5H10V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5H4C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.6l3.6,3.6 c0.3,0.3,0.9,0.1,0.9-0.4v-3.7h0.5l0.9,2.5l1-0.6C14,11.5,15,9.8,15,8S14,4.5,12.4,3.6z M9,13l-3-3H4c-0.6,0-1-0.4-1-1V7 c0-0.6,0.4-1,1-1h2l3-3V13z M10,9.5v-3c0.8,0,1.5,0.7,1.5,1.5S10.8,9.5,10,9.5z M11.9,11.5l-0.4-0.9C12.4,10,13,9.1,13,8 s-0.6-2-1.4-2.5l0.3-1C13.2,5.2,14,6.5,14,8S13.2,10.8,11.9,11.5z"/> | ||
| 29 | <path d="M4,6C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h2l3,3V3L6,6H4z M10,6.5v3c0.8,0,1.5-0.7,1.5-1.5S10.8,6.5,10,6.5z M11.9,4.5 l-0.4,0.9C12.4,6,13,6.9,13,8s-0.6,2-1.4,2.5l0.4,0.9c1.2-0.7,2.1-2,2.1-3.5S13.2,5.2,11.9,4.5z"/> | ||
| 30 | </g> | ||
| 31 | <g id="tab-audio-muted" class="icon"> | ||
| 32 | <path class="outline" d="M5.6,5H4C2.9,5,2,5.9,2,7v2c0,0.7,0.3,1.3,0.9,1.7l-1.8,1.8l2.5,2.5l3-3l2.6,2.6c0.3,0.3,0.9,0.1,0.9-0.4V8.5l3.9-3.9 l-2.5-2.5L10,3.5V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5z"/> | ||
| 33 | <path d="M11.5,3.5L9,5.9V3L6,6H4C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h0.9l-2.5,2.5l1.1,1.1l9-9L11.5,3.5z M9,13V9.7l-1.7,1.7L9,13z"/> | ||
| 34 | </g> | ||
| 35 | |||
| 36 | <g id="tab-audio-white" class="icon white"> | ||
| 37 | <path class="outline" d="M12.4,3.6l-1-0.6l-0.9,2.5H10V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5H4C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.6l3.6,3.6 c0.3,0.3,0.9,0.1,0.9-0.4v-3.7h0.5l0.9,2.5l1-0.6C14,11.5,15,9.8,15,8S14,4.5,12.4,3.6z M9,13l-3-3H4c-0.6,0-1-0.4-1-1V7 c0-0.6,0.4-1,1-1h2l3-3V13z M10,9.5v-3c0.8,0,1.5,0.7,1.5,1.5S10.8,9.5,10,9.5z M11.9,11.5l-0.4-0.9C12.4,10,13,9.1,13,8 s-0.6-2-1.4-2.5l0.3-1C13.2,5.2,14,6.5,14,8S13.2,10.8,11.9,11.5z"/> | ||
| 38 | <path d="M4,6C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h2l3,3V3L6,6H4z M10,6.5v3c0.8,0,1.5-0.7,1.5-1.5S10.8,6.5,10,6.5z M11.9,4.5 l-0.4,0.9C12.4,6,13,6.9,13,8s-0.6,2-1.4,2.5l0.4,0.9c1.2-0.7,2.1-2,2.1-3.5S13.2,5.2,11.9,4.5z"/> | ||
| 39 | </g> | ||
| 40 | <g id="tab-audio-white-muted" class="icon white"> | ||
| 41 | <path class="outline" d="M5.6,5H4C2.9,5,2,5.9,2,7v2c0,0.7,0.3,1.3,0.9,1.7l-1.8,1.8l2.5,2.5l3-3l2.6,2.6c0.3,0.3,0.9,0.1,0.9-0.4V8.5l3.9-3.9 l-2.5-2.5L10,3.5V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5z"/> | ||
| 42 | <path d="M11.5,3.5L9,5.9V3L6,6H4C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h0.9l-2.5,2.5l1.1,1.1l9-9L11.5,3.5z M9,13V9.7l-1.7,1.7L9,13z"/> | ||
| 43 | </g> | ||
| 44 | |||
| 45 | <g id="tab-audio-blocked" class="icon"> | ||
| 46 | <path class="outline" d="M8,1.2C4.3,1.2,1.2,4.3,1.2,8s3.1,6.8,6.8,6.8s6.8-3.1,6.8-6.8S11.7,1.2,8,1.2z M8,11.9 | ||
| 47 | c-2.1,0-3.9-1.7-3.9-3.9c0-2.1,1.7-3.9,3.9-3.9s3.9,1.7,3.9,3.9C11.9,10.1,10.1,11.9,8,11.9z M11.1,7.3L6.6,4.6L5.4,3.9v1.4v5.3V12 | ||
| 48 | l1.2-0.7L11,8.6L12.2,8L11.1,7.3z"/> | ||
| 49 | <path d="M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z M8,12.7c-2.6,0-4.7-2.1-4.7-4.7 | ||
| 50 | S5.4,3.3,8,3.3s4.7,2.1,4.7,4.7S10.6,12.7,8,12.7z M10.7,8L6.2,5.3v5.4L10.7,8z"/> | ||
| 51 | </g> | ||
| 52 | <g id="tab-audio-white-blocked" class="icon"> | ||
| 53 | <path class="outline" d="M8,0c3.3,0,6.4,2.2,7.5,5.3c1.1,3.1,0.1,6.7-2.5,8.9c-2.6,2.1-6.3,2.4-9.2,0.7 | ||
| 54 | C1,13.1-0.5,9.8,0.1,6.5C0.9,2.8,4.2,0,8,0z"/> | ||
| 55 | <path d="M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z M8,12.7c-2.6,0-4.7-2.1-4.7-4.7 | ||
| 56 | S5.4,3.3,8,3.3s4.7,2.1,4.7,4.7S10.6,12.7,8,12.7z M10.7,8L6.2,5.3v5.4L10.7,8z"/> | ||
| 57 | </g> | ||
| 58 | </svg> | ||
diff --git a/src/chrome/browser/tabbrowser/tab-audio.svg b/src/chrome/browser/tabbrowser/tab-audio.svg new file mode 100644 index 0000000..274e10c --- /dev/null +++ b/src/chrome/browser/tabbrowser/tab-audio.svg | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- This Source Code Form is subject to the terms of the Mozilla Public | ||
| 3 | - License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| 4 | - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> | ||
| 5 | <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"> | ||
| 6 | <style> | ||
| 7 | path:not(:target) { | ||
| 8 | display: none; | ||
| 9 | } | ||
| 10 | </style> | ||
| 11 | |||
| 12 | <path id="tab-audio" d="M4,5C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.2L9,14V2L5.2,5H4z M11,8c0-0.6-0.4-1-1-1v2C10.6,9,11,8.6,11,8z M13,8 c0-1.4-1-2.6-2.3-2.9L10.4,6C11.3,6.2,12,7,12,8s-0.7,1.8-1.6,2l0.4,0.9C12,10.6,13,9.4,13,8z M11.4,3.2l-0.4,0.9 C12.8,4.6,14,6.2,14,8s-1.2,3.4-2.9,3.8l0.4,0.9C13.5,12.2,15,10.3,15,8S13.5,3.8,11.4,3.2z"/> | ||
| 13 | |||
| 14 | <path id="tab-audio-muted" d="M12.5,3.4L9,6.3V2L5.2,5H4C2.9,5,2,5.9,2,7v2c0,0.9,0.6,1.6,1.4,1.9l-1.9,1.5l1,1.2l11-9L12.5,3.4z M9,14v-4l-2.5,2L9,14z"/> | ||
| 15 | |||
| 16 | <path id="tab-audio-blocked" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M5.6,11.6l6-3.6l-6-3.6V11.6z M8,14.2 | ||
| 17 | c-3.4,0-6.2-2.8-6.2-6.2S4.6,1.8,8,1.8s6.2,2.8,6.2,6.2S11.4,14.2,8,14.2z"/> | ||
| 18 | </svg> | ||
