From fd9e25fa29374000e2aa23af1f96569438381190 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 13 Feb 2011 03:51:24 +0000 Subject: [PATCH] - Put all Zotero buttons in one contiguous toolbar. This seems to be the only way to get a unified window on OS X. It also means that if the window is too small, the search box pushes over the metadata pane buttons, instead of getting truncated. - Firefox 3.6 fixes --- .../content/zotero-platform/mac/overlay.css | 8 - chrome/content/zotero-platform/mac/tab.css | 4 +- chrome/content/zotero/bindings/itembox.xml | 6 +- chrome/content/zotero/standalone.xul | 1 - chrome/content/zotero/zoteroPane.js | 18 +- chrome/content/zotero/zoteroPane.xul | 507 +++++++++--------- 6 files changed, 280 insertions(+), 264 deletions(-) diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index b668e0a8f..d798ad26d 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -12,14 +12,6 @@ background-image: none; } -#zotero-pane .toolbar { - /* This will be ignored on FF <3.5 */ - -moz-appearance: -moz-mac-unified-toolbar; - /* This will be ignored on FF >=3.5 */ - background: url("chrome://zotero/skin/mac/toolbar-background.png") left center repeat-x; - margin-left: -1px; -} - #zotero-items-toolbar[state=collapsed] { margin-left: -8px !important; diff --git a/chrome/content/zotero-platform/mac/tab.css b/chrome/content/zotero-platform/mac/tab.css index b06b5c528..9d6de9b3a 100644 --- a/chrome/content/zotero-platform/mac/tab.css +++ b/chrome/content/zotero-platform/mac/tab.css @@ -1,4 +1,4 @@ -#zotero-pane .toolbar { +#zotero-toolbar { -moz-appearance: none !important; - background-color: -moz-mac-chrome-active !important; + background: url("chrome://zotero/skin/mac/toolbar-background.png") left center repeat-x; } \ No newline at end of file diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 06da90500..e28f0a438 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -803,13 +803,13 @@ // appropriately truncate lastName // get item box width - var computedStyle = window.getComputedStyle(this); + var computedStyle = window.getComputedStyle(this, null); var boxWidth = computedStyle.getPropertyValue('width'); // get field label width - var computedStyle = window.getComputedStyle(row.firstChild); + var computedStyle = window.getComputedStyle(row.firstChild, null); var leftHboxWidth = computedStyle.getPropertyValue('width'); // get last name width - computedStyle = window.getComputedStyle(lastName); + computedStyle = window.getComputedStyle(lastName, null); var lastNameWidth = computedStyle.getPropertyValue('width'); if(boxWidth.substr(-2) === 'px' && leftHboxWidth.substr(-2) === 'px' diff --git a/chrome/content/zotero/standalone.xul b/chrome/content/zotero/standalone.xul index ad6945d8d..1de063232 100644 --- a/chrome/content/zotero/standalone.xul +++ b/chrome/content/zotero/standalone.xul @@ -212,7 +212,6 @@ context="toolbar-context-menu" defaultset="personal-bookmarks" customizable="true"/>--> - diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index dbf2cb537..4097994da 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -115,7 +115,9 @@ var ZoteroPane = new function() _loaded = true; var zp = document.getElementById('zotero-pane'); - Zotero.setFontSize(zp) + Zotero.setFontSize(zp); + ZoteroPane.updateToolbarPosition(); + window.addEventListener("resize", this.updateToolbarPosition, false); if (Zotero.isMac) { //document.getElementById('zotero-tb-actions-zeroconf-update').setAttribute('hidden', false); @@ -3481,4 +3483,18 @@ var ZoteroPane = new function() } Zotero.Prefs.set("pane.persist", JSON.stringify(serializedValues)); } + + /** + * Moves around the toolbar when the user moves around the pane + */ + this.updateToolbarPosition = function() { + const PANES = ["collections", "items"]; + for each(var paneName in PANES) { + var pane = document.getElementById("zotero-"+paneName+"-pane"); + var toolbar = document.getElementById("zotero-"+paneName+"-toolbar"); + + computedStyle = window.getComputedStyle(pane, null); + toolbar.style.width = computedStyle.getPropertyValue("width"); + } + } } \ No newline at end of file diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index ea460a961..9e4accf4c 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -76,122 +76,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -230,112 +151,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -392,37 +208,230 @@ - -