зеркало из https://github.com/mozilla/pjs.git
Bug 212540 - Toolbar Customization dialog should stay where the user places it
r=mconnor p=mossop.bugzilla@blueprintit.co.uk (Dave Townsend)
This commit is contained in:
Родитель
d0698c118e
Коммит
a32f4e2afd
|
@ -39,11 +39,6 @@
|
|||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
const kRowMax = 4;
|
||||
const kWindowWidth = 635;
|
||||
const kWindowHeight = 400;
|
||||
const kAnimateIncrement = 50;
|
||||
const kAnimateSteps = kWindowHeight / kAnimateIncrement - 1;
|
||||
const kVSizeSlop = 5;
|
||||
|
||||
var gToolboxDocument = null;
|
||||
var gToolbox = null;
|
||||
|
@ -104,17 +99,12 @@ function initDialog()
|
|||
function repositionDialog()
|
||||
{
|
||||
// Position the dialog touching the bottom of the toolbox and centered with
|
||||
// it. We must resize the window smaller first so that it is positioned
|
||||
// properly.
|
||||
var screenX = gToolbox.boxObject.screenX + ((gToolbox.boxObject.width - kWindowWidth) / 2);
|
||||
// it.
|
||||
var screenX = gToolbox.boxObject.screenX
|
||||
+ ((gToolbox.boxObject.width
|
||||
- parseInt(document.documentElement.style.width)) / 2);
|
||||
var screenY = gToolbox.boxObject.screenY + gToolbox.boxObject.height;
|
||||
|
||||
var newHeight = kWindowHeight;
|
||||
if (newHeight >= screen.availHeight - screenY - kVSizeSlop) {
|
||||
newHeight = screen.availHeight - screenY - kVSizeSlop;
|
||||
}
|
||||
|
||||
window.resizeTo(kWindowWidth, newHeight);
|
||||
window.moveTo(screenX, screenY);
|
||||
}
|
||||
|
||||
|
@ -561,7 +551,6 @@ function addNewToolbar()
|
|||
|
||||
gToolbox.appendCustomToolbar(name.value, "");
|
||||
|
||||
repositionDialog();
|
||||
gToolboxChanged = true;
|
||||
}
|
||||
|
||||
|
@ -615,7 +604,6 @@ function restoreDefaultSet()
|
|||
// Restore the disabled and command states
|
||||
restoreItemAttributes(["itemdisabled", "itemcommand"], savedAttributes);
|
||||
|
||||
repositionDialog();
|
||||
gToolboxChanged = true;
|
||||
}
|
||||
|
||||
|
@ -670,8 +658,6 @@ function updateIconSize(aUseSmallIcons)
|
|||
gToolboxDocument.persist(toolbar.id, "iconsize");
|
||||
}
|
||||
}
|
||||
|
||||
repositionDialog();
|
||||
}
|
||||
|
||||
function updateToolbarMode(aModeValue)
|
||||
|
@ -689,8 +675,6 @@ function updateToolbarMode(aModeValue)
|
|||
|
||||
var iconSizeCheckbox = document.getElementById("smallicons");
|
||||
iconSizeCheckbox.disabled = aModeValue == "text";
|
||||
|
||||
repositionDialog();
|
||||
}
|
||||
|
||||
|
||||
|
@ -922,7 +906,6 @@ var toolbarDNDObserver =
|
|||
|
||||
gCurrentDragOverItem = null;
|
||||
|
||||
repositionDialog();
|
||||
gToolboxChanged = true;
|
||||
},
|
||||
|
||||
|
@ -979,7 +962,6 @@ var paletteDNDObserver =
|
|||
}
|
||||
}
|
||||
|
||||
repositionDialog();
|
||||
gToolboxChanged = true;
|
||||
},
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
onload="onLoad();"
|
||||
onunload="onUnload();"
|
||||
onclose="onAccept(); return false;"
|
||||
style="&dialog.style;"
|
||||
persist="width height"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/customizeToolbar.js"/>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<!ENTITY dialog.title "Customize Toolbar">
|
||||
<!ENTITY dialog.style "width: 635px; height: 400px;">
|
||||
<!ENTITY instructions.description "You can add or remove items by dragging to or from the toolbars.">
|
||||
<!ENTITY show.label "Show:">
|
||||
<!ENTITY iconsAndText.label "Icons and Text">
|
||||
|
|
Загрузка…
Ссылка в новой задаче