Add uiDensity pref and menu controls
This commit is contained in:
parent
be4ecb31bc
commit
d6e5da403c
5 changed files with 42 additions and 1 deletions
|
@ -438,6 +438,11 @@ const ZoteroStandalone = new function() {
|
||||||
this.updateMenuItemCheckmark('view-menuitem-standard', mode != 'stacked');
|
this.updateMenuItemCheckmark('view-menuitem-standard', mode != 'stacked');
|
||||||
this.updateMenuItemCheckmark('view-menuitem-stacked', mode == 'stacked');
|
this.updateMenuItemCheckmark('view-menuitem-stacked', mode == 'stacked');
|
||||||
|
|
||||||
|
// Density
|
||||||
|
let density = Zotero.Prefs.get('uiDensity');
|
||||||
|
this.updateMenuItemCheckmark('view-menuitem-ui-density-compact', density == 'compact');
|
||||||
|
this.updateMenuItemCheckmark('view-menuitem-ui-density-comfortable', density == 'comfortable');
|
||||||
|
|
||||||
// Panes
|
// Panes
|
||||||
this.updateMenuItemCheckmark(
|
this.updateMenuItemCheckmark(
|
||||||
'view-menuitem-collections-pane',
|
'view-menuitem-collections-pane',
|
||||||
|
@ -498,6 +503,14 @@ const ZoteroStandalone = new function() {
|
||||||
Zotero.Prefs.set('layout', 'stacked');
|
Zotero.Prefs.set('layout', 'stacked');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'ui-density-comfortable':
|
||||||
|
Zotero.Prefs.set('uiDensity', 'comfortable');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ui-density-compact':
|
||||||
|
Zotero.Prefs.set('uiDensity', 'compact');
|
||||||
|
break;
|
||||||
|
|
||||||
case 'collections-pane':
|
case 'collections-pane':
|
||||||
var collectionsPane = document.getElementById('zotero-collections-pane');
|
var collectionsPane = document.getElementById('zotero-collections-pane');
|
||||||
// Show
|
// Show
|
||||||
|
|
|
@ -44,7 +44,7 @@ Zotero.Prefs = new function() {
|
||||||
|
|
||||||
// Process pref version updates
|
// Process pref version updates
|
||||||
var fromVersion = this.get('prefVersion');
|
var fromVersion = this.get('prefVersion');
|
||||||
var toVersion = 9;
|
var toVersion = 10;
|
||||||
if (!fromVersion) {
|
if (!fromVersion) {
|
||||||
this.set('prefVersion', toVersion);
|
this.set('prefVersion', toVersion);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,11 @@ Zotero.Prefs = new function() {
|
||||||
this.clear('attachmentRenameFormatString');
|
this.clear('attachmentRenameFormatString');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Set UI density to Compact for existing users
|
||||||
|
case 10:
|
||||||
|
this.set('uiDensity', 'compact');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.set('prefVersion', toVersion);
|
this.set('prefVersion', toVersion);
|
||||||
|
|
|
@ -461,6 +461,20 @@
|
||||||
/>
|
/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menu>
|
</menu>
|
||||||
|
<menu id="density-menu" data-l10n-id="menu-ui-density">
|
||||||
|
<menupopup oncommand="ZoteroStandalone.onViewMenuItemClick(event)">
|
||||||
|
<menuitem
|
||||||
|
id="view-menuitem-ui-density-compact"
|
||||||
|
data-l10n-id="menu-ui-density-compact"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
<menuitem
|
||||||
|
id="view-menuitem-ui-density-comfortable"
|
||||||
|
data-l10n-id="menu-ui-density-comfortable"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</menupopup>
|
||||||
|
</menu>
|
||||||
<menu id="font-size-menu"
|
<menu id="font-size-menu"
|
||||||
label="&fontSize.label;">
|
label="&fontSize.label;">
|
||||||
<menupopup oncommand="ZoteroStandalone.onViewMenuItemClick(event)">
|
<menupopup oncommand="ZoteroStandalone.onViewMenuItemClick(event)">
|
||||||
|
|
|
@ -192,3 +192,10 @@ restart-in-troubleshooting-mode-menuitem =
|
||||||
.accesskey = T
|
.accesskey = T
|
||||||
restart-in-troubleshooting-mode-dialog-title = Restart in Troubleshooting Mode
|
restart-in-troubleshooting-mode-dialog-title = Restart in Troubleshooting Mode
|
||||||
restart-in-troubleshooting-mode-dialog-description = { -app-name } will restart with all plugins disabled. Some features may not function correctly while Troubleshooting Mode is enabled.
|
restart-in-troubleshooting-mode-dialog-description = { -app-name } will restart with all plugins disabled. Some features may not function correctly while Troubleshooting Mode is enabled.
|
||||||
|
|
||||||
|
menu-ui-density =
|
||||||
|
.label = Density
|
||||||
|
menu-ui-density-comfortable =
|
||||||
|
.label = Comfortable
|
||||||
|
menu-ui-density-compact =
|
||||||
|
.label = Compact
|
||||||
|
|
|
@ -72,6 +72,8 @@ pref("extensions.zotero.lastLongTagDelimiter", ";");
|
||||||
pref("extensions.zotero.fallbackSort", "firstCreator,date,title,dateAdded");
|
pref("extensions.zotero.fallbackSort", "firstCreator,date,title,dateAdded");
|
||||||
pref("extensions.zotero.sortCreatorAsString", false);
|
pref("extensions.zotero.sortCreatorAsString", false);
|
||||||
|
|
||||||
|
pref("extensions.zotero.uiDensity", "comfortable");
|
||||||
|
|
||||||
|
|
||||||
//Tag Selector
|
//Tag Selector
|
||||||
pref("extensions.zotero.tagSelector.showAutomatic", true);
|
pref("extensions.zotero.tagSelector.showAutomatic", true);
|
||||||
|
|
Loading…
Reference in a new issue