Bug 1699841 - Hide the secondary text for locales where it doesn't fit, and always make the overlay icon visible in such locales. r=desktop-theme-reviewers,harry

Differential Revision: https://phabricator.services.mozilla.com/D109842
This commit is contained in:
Jared Wein 2021-03-26 22:55:20 +00:00
Родитель 7df1ae275d
Коммит f561f5d7a4
3 изменённых файлов: 17 добавлений и 1 удалений

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

@ -534,6 +534,10 @@ pref("browser.tabs.loadBookmarksInBackground", false);
pref("browser.tabs.loadBookmarksInTabs", false);
pref("browser.tabs.tabClipWidth", 140);
pref("browser.tabs.tabMinWidth", 76);
// Users running in any of the following language codes will have the
// secondary text on tabs hidden due to size constraints and readability
// of the text at small font sizes.
pref("browser.tabs.secondaryTextUnsupportedLocales", "ar,bn,bo,ckb,fa,gu,he,hi,ja,km,kn,ko,lo,mr,my,ne,pa,si,ta,te,th,ur,zh");
// Initial titlebar state is managed by -moz-gtk-csd-hide-titlebar-by-default
// on Linux.
#ifndef UNIX_BUT_NOT_MAC

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

@ -70,6 +70,16 @@
var tab = this.allTabs[0];
tab.label = this.emptyTabTitle;
// Hide the secondary text for locales where it is unsupported due to size constraints.
const language = Services.locale.appLocaleAsBCP47;
const unsupportedLocales = Services.prefs.getCharPref(
"browser.tabs.secondaryTextUnsupportedLocales"
);
this.toggleAttribute(
"secondarytext-unsupported",
unsupportedLocales.split(",").includes(language.split("-")[0])
);
this.newTabButton.setAttribute(
"aria-label",
GetDynamicShortcutTooltipText("tabs-newtab-button")

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

@ -388,7 +388,8 @@
} /*** END !proton ***/
@supports -moz-bool-pref("browser.proton.tabs.enabled") {
#toolbar-menubar:not(:hover) + #TabsToolbar:not(:hover) .tab-icon-overlay@tabIndicatorReplacesIcon@,
#tabbrowser-tabs[secondarytext-unsupported] .tab-icon-stack@tabIndicatorReplacesIcon@ > :not(.tab-icon-overlay),
#toolbar-menubar:not(:hover) + #TabsToolbar:not(:hover) #tabbrowser-tabs:not([secondarytext-unsupported]) .tab-icon-overlay@tabIndicatorReplacesIcon@,
:is(#toolbar-menubar:hover + #TabsToolbar, #TabsToolbar:hover) .tab-icon-stack@tabIndicatorReplacesIcon@ > :not(.tab-icon-overlay) {
opacity: 0;
}
@ -553,6 +554,7 @@
} /*** END !proton ***/
@supports -moz-bool-pref("browser.proton.tabs.enabled") {
#tabbrowser-tabs[secondarytext-unsupported] .tab-secondary-label,
.tab-label-container:not(.proton),
.tab-label-container:not(.proton) + .tab-icon-sound {
display: none;