diff --git a/chrome/content/zotero/preferences/preferences_general.xhtml b/chrome/content/zotero/preferences/preferences_general.xhtml index 00f7d2901c..752105b57e 100644 --- a/chrome/content/zotero/preferences/preferences_general.xhtml +++ b/chrome/content/zotero/preferences/preferences_general.xhtml @@ -246,6 +246,22 @@ preference="extensions.zotero.openNoteInNewWindow" native="true" /> + + diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index add7e31708..2982559df5 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -103,6 +103,8 @@ class EditorInstance { Zotero.Prefs.registerObserver('note.fontSize', this._handleFontChange), Zotero.Prefs.registerObserver('note.tabFontSize', this._handleFontChange), Zotero.Prefs.registerObserver('note.fontFamily', this._handleFontChange), + Zotero.Prefs.registerObserver('note.contentViewMode', this._handleContentViewModeChange), + Zotero.Prefs.registerObserver('note.tabContentViewMode', this._handleContentViewModeChange), Zotero.Prefs.registerObserver('note.css', this._handleStyleChange), Zotero.Prefs.registerObserver('layout.spellcheckDefault', this._handleSpellCheckChange, true) ]; @@ -450,8 +452,8 @@ class EditorInstance { } _getContentViewMode() { - // TODO: Use prefs - return this._tabID ? 'comfortable' : 'wide'; + let contentViewModePrefKey = this._tabID ? 'note.tabContentViewMode' : 'note.contentViewMode'; + return Zotero.Prefs.get(contentViewModePrefKey) || 'wide'; } _handleFontChange = () => { diff --git a/chrome/locale/en-US/zotero/preferences.ftl b/chrome/locale/en-US/zotero/preferences.ftl index a9ae6dbf8f..5b7da570c8 100644 --- a/chrome/locale/en-US/zotero/preferences.ftl +++ b/chrome/locale/en-US/zotero/preferences.ftl @@ -40,6 +40,12 @@ preferences-read-aloud-highlight-granularity-word = preferences-note-title = Notes preferences-note-open-in-new-window = .label = Open notes in new windows instead of tabs +preferences-note-content-view = Note content width +preferences-note-tab-content-view = Note tab content width +preferences-note-content-view-wide = + .label = Full width +preferences-note-content-view-comfortable = + .label = Readable width preferences-color-scheme = Color Scheme: preferences-color-scheme-auto = diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index c51de7cda2..4a6ba85546 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -212,6 +212,8 @@ pref("extensions.zotero.fileHandler.snapshot", ""); pref("extensions.zotero.openReaderInNewWindow", false); pref("extensions.zotero.openNoteInNewWindow", false); +pref("extensions.zotero.note.contentViewMode", "wide"); +pref("extensions.zotero.note.tabContentViewMode", "comfortable"); // File/URL opening executable if launch() fails pref("extensions.zotero.fallbackLauncher.unix", "/usr/bin/xdg-open");