From 006509b5d29088cfc113a1abc9ac6d7dc05952b7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 1 Feb 2007 09:15:37 +0000 Subject: [PATCH] Closes #382, Make font sizes configurable/changeable Configurable in preferences or via hidden pref for more extreme options Also straightened up diplay of UI options in pref pane --- chrome/content/zotero/overlay.js | 16 +++++- chrome/content/zotero/preferences.xul | 64 ++++++++++++++++------ chrome/locale/en-US/zotero/preferences.dtd | 1 + chrome/skin/default/zotero/overlay.css | 23 ++++++++ chrome/skin/default/zotero/preferences.css | 45 +++++++++++---- defaults/preferences/zotero.js | 1 + 6 files changed, 121 insertions(+), 29 deletions(-) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index e5347ee5f6..a602b912e7 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -108,6 +108,20 @@ var ZoteroPane = new function() document.getElementById('zotero-tb-fullscreen').setAttribute('zoterotop','true'); } + // Font size + document.getElementById('zotero-pane').style.fontSize = Zotero.Prefs.get('fontSize') + 'em'; + var size = Zotero.Prefs.get('fontSize'); + if (size <= 1) { + size = 'small'; + } + else if (size <= 1.25) { + size = 'medium'; + } + else { + size = 'large'; + } + document.getElementById('zotero-pane').setAttribute('fontSize', size); + //Initialize collections view collectionsView = new Zotero.CollectionTreeView(); var collectionsTree = document.getElementById('zotero-collections-tree'); @@ -1131,7 +1145,7 @@ var ZoteroPane = new function() // obj.value == 'cell'/'text'/'image' if (!obj.value) { - return false; + return; } if (tree.id == 'zotero-collections-tree') { diff --git a/chrome/content/zotero/preferences.xul b/chrome/content/zotero/preferences.xul index e5202fc042..e56cdfbfab 100644 --- a/chrome/content/zotero/preferences.xul +++ b/chrome/content/zotero/preferences.xul @@ -43,6 +43,7 @@ To add a new preference: + @@ -56,25 +57,52 @@ To add a new preference: - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd index 720fc6e4ec..919130fa93 100644 --- a/chrome/locale/en-US/zotero/preferences.dtd +++ b/chrome/locale/en-US/zotero/preferences.dtd @@ -7,6 +7,7 @@ + diff --git a/chrome/skin/default/zotero/overlay.css b/chrome/skin/default/zotero/overlay.css index 523ad7bf6e..36d6432268 100644 --- a/chrome/skin/default/zotero/overlay.css +++ b/chrome/skin/default/zotero/overlay.css @@ -1,3 +1,26 @@ +/* Font sizes */ +#zotero-pane[fontSize=medium] #zotero-tb-search, #zotero-pane[fontSize=large] #zotero-tb-search, +#zotero-pane[fontSize=medium] zoterotagselector textbox, #zotero-pane[fontSize=large] zoterotagselector textbox +{ + font-size: 1em !important; +} + +#zotero-pane[fontSize=medium] treechildren::-moz-tree-row +{ + height: 1.5em; +} + +#zotero-pane[fontSize=large] treechildren::-moz-tree-row +{ + height: 1.5em; +} + +#zotero-pane[fontSize=large] .treecol-text +{ + margin:0; + padding:0; +} + #zotero-status-bar-icon { width: 55px; diff --git a/chrome/skin/default/zotero/preferences.css b/chrome/skin/default/zotero/preferences.css index e94d82b4ce..fc7e2a5743 100644 --- a/chrome/skin/default/zotero/preferences.css +++ b/chrome/skin/default/zotero/preferences.css @@ -29,22 +29,47 @@ radio[pane=zotero-prefpane-keys][selected="true"] /* General pane */ +grid row hbox:first-child +{ + -moz-box-pack: end; +} + +#fontSize +{ + font-size: 3mm; /* Firefox default */ +} + +#fontSize1 +{ + font-size: 1.0em; +} + +#fontSize2 +{ + font-size: 1.25em; +} + +#fontSize3 +{ + font-size: 1.5em; +} + +#fontSize radio, #statusBarIcon radio +{ + width: 90px; +} + +#fontSize radio .radio-icon, #statusBarIcon radio .radio-icon +{ + margin-left: 6px; +} + #statusLine { margin-bottom:.75em; color: red; } -#statusBarIcon radio -{ - margin-right: 20px; -} - -#statusBarIcon radio .radio-icon -{ - margin-left: 6px; -} - /* Shortcut Keys pane */ #zotero-prefpane-keys row { diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index 99c5f000cc..9de4251c9b 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -15,6 +15,7 @@ pref("extensions.zotero.downloadAssociatedFiles",false); pref("extensions.zotero.reportTranslationFailure",true); pref("extensions.zotero.enableMacClipboard",false); pref("extensions.zotero.automaticTags",true); +pref("extensions.zotero.fontSize", "1.0"); pref("extensions.zotero.lastCreatorFieldMode",0); pref("extensions.zotero.lastRenameAssociatedFile", false);