Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Closes #93: Layout is wrong when resizing and slightly wrong when goi…
Browse files Browse the repository at this point in the history
…ng full screen

Do a soft disable/re-enable similar to alt-ctrl-shift-d when the user finishes resizing.
  • Loading branch information
Mardak committed Feb 11, 2011
1 parent 3bfc994 commit 4ee88af
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions homeDash/bootstrap.js
Expand Up @@ -70,18 +70,6 @@ function removeChrome(window) {
return windowTop - gBrowser.parentNode.boxObject.y + "px";
}

// Handle switching in and out of full screen
change(window.FullScreen, "mouseoverToggle", function(orig) {
return function() {
// Wait a bit for the UI to switch when going in/out of full screen
if (window.fullScreen)
Utils.delay(function() gBrowser.style.marginTop = getTopOffset());

// Always do the original functionality
return orig.apply(this, arguments);
};
});

// Remove the lightweight theme to avoid browser size and color changes
Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
change(LightweightThemeManager, "currentTheme", null);
Expand Down Expand Up @@ -3560,6 +3548,21 @@ function activateHomeDash(activating) {

// Wait for the chrome to be removed and resized before adding
Utils.delay(function() addDashboard(window));

// Detect resizes (including full screen) to restart Home Dash
let {clearTimeout, setTimeout} = window;
let resizeTimeout;
listen(window, window, "resize", function(event) {
if (event.target != window)
return;

// Only restart a little after the user finishes resizing/dragging
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
unload()
activateHomeDash(true);
}, 1000);
});
});
}

Expand Down

0 comments on commit 4ee88af

Please sign in to comment.