Commit 2282a161 authored by henry's avatar henry
Browse files

fixup! BB 32308: Use direct browser sizing for letterboxing.

TB 44214: Move the letterboxing classes one element up from tabpanels to
tabbox.

This is because we need to restyle the tabbox.
parent 261e8522
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -769,8 +769,8 @@ class _RFPHelper {
  _updateSizeForTabsInWindow(aWindow) {
  _updateSizeForTabsInWindow(aWindow) {
    let tabBrowser = aWindow.gBrowser;
    let tabBrowser = aWindow.gBrowser;


    tabBrowser.tabpanels?.classList.add("letterboxing");
    tabBrowser.tabbox.classList.add("letterboxing");
    tabBrowser.tabpanels?.classList.toggle(
    tabBrowser.tabbox.classList.toggle(
      "letterboxing-vcenter",
      "letterboxing-vcenter",
      Services.prefs.getBoolPref(kPrefLetterboxingVcenter, false)
      Services.prefs.getBoolPref(kPrefLetterboxingVcenter, false)
    );
    );
@@ -782,7 +782,7 @@ class _RFPHelper {
    // We need to add this class late because otherwise new windows get
    // We need to add this class late because otherwise new windows get
    // maximized.
    // maximized.
    aWindow.setTimeout(() => {
    aWindow.setTimeout(() => {
      tabBrowser.tabpanels?.classList.add("letterboxing-ready");
      tabBrowser.tabbox.classList.add("letterboxing-ready");
      if (!aWindow._rfpOriginalSize) {
      if (!aWindow._rfpOriginalSize) {
        this._recordWindowSize(aWindow);
        this._recordWindowSize(aWindow);
      }
      }
@@ -877,7 +877,7 @@ class _RFPHelper {
    aWindow.removeEventListener("TabOpen", this);
    aWindow.removeEventListener("TabOpen", this);


    // revert tabpanel's style to default
    // revert tabpanel's style to default
    tabBrowser.tabpanels?.classList.remove("letterboxing");
    tabBrowser.tabbox.classList.remove("letterboxing");


    // and restore default size on each browser element
    // and restore default size on each browser element
    for (let tab of tabBrowser.tabs) {
    for (let tab of tabBrowser.tabs) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -17,7 +17,7 @@
  }
  }
}
}


.letterboxing {
#tabbrowser-tabbox.letterboxing {
  --letterboxing-bgcolor: var(--tabpanel-background-color);
  --letterboxing-bgcolor: var(--tabpanel-background-color);
  --letterboxing-border-radius: 8px;
  --letterboxing-border-radius: 8px;
  --letterboxing-border-top-radius: 0;
  --letterboxing-border-top-radius: 0;