b=448495, r=gavin. toolbar and sidebar UI fixup

This commit is contained in:
mfinkle@markfinkle8198 2008-07-30 01:26:53 -05:00
Родитель 328e3c78b8
Коммит f56e875416
4 изменённых файлов: 54 добавлений и 68 удалений

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

@ -309,15 +309,13 @@ var BrowserUI = {
var container = document.getElementById("browser-container");
// Make sure the UI elements are sized correctly since the window size can change
sidebar.left = toolbar.width = container.boxObject.width;
sidebar.height = tablist.height = container.boxObject.height - toolbar.boxObject.height;
sidebar.left = container.boxObject.width;
sidebar.height = tablist.height = container.boxObject.height;
if (aMode == PANELMODE_URLVIEW || aMode == PANELMODE_SIDEBAR ||
aMode == PANELMODE_TABLIST || aMode == PANELMODE_FULL)
{
toolbar.setAttribute("mode", "view");
toolbar.top = 0;
this._edit.hidden = true;
this._edit.reallyClosePopup();
this._caption.hidden = false;
@ -335,7 +333,6 @@ var BrowserUI = {
}
else if (aMode == PANELMODE_URLEDIT) {
toolbar.setAttribute("mode", "edit");
toolbar.top = 0;
this._caption.hidden = true;
this._edit.hidden = false;
this._edit.focus();
@ -346,7 +343,6 @@ var BrowserUI = {
tablist.left = -tablist.boxObject.width;
}
else if (aMode == PANELMODE_BOOKMARK) {
toolbar.top = 0;
toolbar.setAttribute("mode", "view");
this._edit.hidden = true;
this._edit.reallyClosePopup();
@ -360,7 +356,6 @@ var BrowserUI = {
bookmark.width = container.boxObject.width;
}
else if (aMode == PANELMODE_BOOKMARKLIST) {
toolbar.top = 0;
toolbar.setAttribute("mode", "view");
this._edit.hidden = true;
this._edit.reallyClosePopup();
@ -372,10 +367,9 @@ var BrowserUI = {
urllist.hidden = false;
urllist.width = container.boxObject.width;
urllist.height = container.boxObject.height - toolbar.boxObject.height;
urllist.height = container.boxObject.height;
}
else if (aMode == PANELMODE_NONE) {
toolbar.top = -toolbar.boxObject.height;
sidebar.left = toolbar.boxObject.width;
tablist.left = -tablist.boxObject.width;
@ -472,24 +466,20 @@ var BrowserUI = {
case "error":
this._favicon.setAttribute("src", "chrome://browser/skin/images/default-favicon.png");
break;
case "pan": {
// Default to hide the controls when user pans
case "overpan": {
// Default to hide the controls when user overpans
let mode = PANELMODE_NONE;
// Open the urlbar controls if browser is at top of content
if (Browser.content.scrollY == 0)
mode = PANELMODE_URLVIEW
// Open the sidebar controls if we get a right side overpan
if (aEvent.detail == 2 && this.mode == PANELMODE_NONE)
mode = PANELMODE_SIDEBAR;
// Close the sidebar controls if we get a left side overpan
else if (aEvent.detail == 1 && this.mode == PANELMODE_NONE)
mode = PANELMODE_TABLIST;
this.show(mode);
break;
}
case "overpan":
// Open the sidebar controls if we get a right side overpan
if (aEvent.detail == 2)
this.show(PANELMODE_SIDEBAR);
// Close the sidebar controls if we get a left side overpan
else if (aEvent.detail == 1)
this.show(PANELMODE_TABLIST);
break;
}
},

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

@ -176,6 +176,37 @@
</panel>
</popupset>
<toolbar id="toolbar-main">
<hbox id="urlbar-container" flex="1">
<box id="identity-box"
onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
<stack id="urlbar-image-stack">
<image id="urlbar-throbber" src=""/>
<image id="urlbar-favicon" src=""/>
</stack>
</box>
<description id="urlbar-caption" crop="end" flex="1"/>
<textbox id="urlbar-edit"
type="autocomplete"
autocompletesearch="history"
enablehistory="false"
maxrows="6"
completeselectedindex="true"
minresultsforpopup="0"
flex="1"
hidden="true"
autocompletepopup="popup_autocomplete"
ontextentered="BrowserUI.goToURI();"
clickSelectsAll="true"/>
</hbox>
<hbox id="urlbar-icons">
<toolbarbutton id="tool-reload" class="urlbar-icon-button" command="cmd_reload"/>
<toolbarbutton id="tool-stop" class="urlbar-icon-button" command="cmd_stop"/>
<toolbarbutton id="tool-go" class="urlbar-icon-button" command="cmd_go"/>
</hbox>
</toolbar>
<stack id="browser-container" flex="1" style="overflow: hidden;">
<vbox id="browser">
<notificationbox id="notifications" flex="1">
@ -184,7 +215,7 @@
</notificationbox>
</vbox>
<vbox id="browser-controls" style="-moz-stack-sizing: ignore; width: 80px;" top="60" left="0">
<vbox id="browser-controls" style="-moz-stack-sizing: ignore; width: 80px;" top="0" left="0">
<toolbarbutton id="tool-back" class="browser-control-button" command="cmd_back"/>
<toolbarbutton id="tool-forward" class="browser-control-button" command="cmd_forward"/>
<toolbarbutton id="tool-star" class="browser-control-button" command="cmd_star"/>
@ -192,49 +223,18 @@
<toolbarbutton id="tool-actions" class="browser-control-button" command="cmd_actions"/>
</vbox>
<vbox id="tab-list-container" style="-moz-stack-sizing: ignore;" top="60" left="0">
<vbox id="tab-list-container" style="-moz-stack-sizing: ignore;" top="0" left="0">
<richlistbox id="tab-list" onselect="BrowserUI.selectTab(this.selectedItem);"/>
<button id="newtab-button" label="+" command="cmd_newTab"/>
</vbox>
<toolbar id="toolbar-main" style="-moz-stack-sizing: ignore; height: 60px;" top="0" left="0">
<hbox id="urlbar-container" flex="1">
<box id="identity-box"
onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
<stack id="urlbar-image-stack">
<image id="urlbar-throbber" src=""/>
<image id="urlbar-favicon" src=""/>
</stack>
</box>
<description id="urlbar-caption" crop="end" flex="1"/>
<textbox id="urlbar-edit"
type="autocomplete"
autocompletesearch="history"
enablehistory="false"
maxrows="6"
completeselectedindex="true"
minresultsforpopup="0"
flex="1"
hidden="true"
autocompletepopup="popup_autocomplete"
ontextentered="BrowserUI.goToURI();"
clickSelectsAll="true"/>
</hbox>
<hbox id="urlbar-icons">
<toolbarbutton id="tool-reload" class="urlbar-icon-button" command="cmd_reload"/>
<toolbarbutton id="tool-stop" class="urlbar-icon-button" command="cmd_stop"/>
<toolbarbutton id="tool-go" class="urlbar-icon-button" command="cmd_go"/>
</hbox>
</toolbar>
<vbox id="urllist-container" hidden="true" style="-moz-stack-sizing: ignore;" top="60" left="0">
<vbox id="urllist-container" hidden="true" style="-moz-stack-sizing: ignore;" top="0" left="0">
<hbox id="urllist-items-container" flex="1">
<richlistbox id="urllist-items" flex="1"/>
</hbox>
</vbox>
<vbox id="bookmark-container" hidden="true" style="-moz-stack-sizing: ignore;" top="60" left="0">
<vbox id="bookmark-container" hidden="true" style="-moz-stack-sizing: ignore;" top="0" left="0">
<vbox id="bookmark-form">
<hbox align="start">
<image id="bookmark-image" src="chrome://browser/skin/images/starred48.png"/>

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

@ -722,19 +722,14 @@
<parameter name="aDx"/>
<parameter name="aDy"/>
<body><![CDATA[
// Fire the panning event
var event = document.createEvent("UIEvents");
event.initUIEvent("pan", true, true, window, 0);
if (this.dispatchEvent(event)) {
// Constrain offsets to the actual scrollWidth/scrollHeight
var [x, y] = this._constrainPanCoords(aDx, aDy);
// Constrain offsets to the actual scrollWidth/scrollHeight
var [x, y] = this._constrainPanCoords(aDx, aDy);
// Canvas needs to move up for content to scroll down
this.dragData.dragX = -x;
this.dragData.dragY = -y;
// Canvas needs to move up for content to scroll down
this.dragData.dragX = -x;
this.dragData.dragY = -y;
this._updateCanvasPosition();
}
this._updateCanvasPosition();
]]></body>
</method>

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

@ -93,6 +93,7 @@ toolbarbutton[open="true"] {
background-repeat: repeat-x;
background-position: top left;
padding: 8px;
border: none;
}
toolbarbutton.urlbar-icon-button {