diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js index 7fd86da4ed..b86f432888 100644 --- a/chrome/content/zotero/selectItemsDialog.js +++ b/chrome/content/zotero/selectItemsDialog.js @@ -30,6 +30,7 @@ var itemsView; var collectionsView; var loaded; var io; +const isSelectItemsDialog = !!document.querySelector('#zotero-select-items-dialog'); const isEditBibliographyDialog = !!document.querySelector('#zotero-edit-bibliography-dialog'); const isAddEditItemsDialog = !!document.querySelector('#zotero-add-citation-dialog'); @@ -38,6 +39,21 @@ const isAddEditItemsDialog = !!document.querySelector('#zotero-add-citation-dial * io - used for input/output (dataOut is list of item IDs) */ var doLoad = async function () { + // Move the dialog button box into the items pane + let itemsContainer = document.getElementById('zotero-items-tree-container'); + // TEMP: Only if we're in the redesigned Select Items dialog, not the + // classic Add Citation dialog, or the Edit Bibliography dialog + // (until we redesign that too) + if (isSelectItemsDialog) { + let buttonBox = document.querySelector('dialog') + .shadowRoot + .querySelector('.dialog-button-box'); + itemsContainer.append(buttonBox); + } + + let searchBar = document.getElementById('zotero-tb-search'); + searchBar.searchTextbox.select(); + // Set font size from pref var sbc = document.getElementById('zotero-select-items-container'); Zotero.UIProperties.registerRoot(sbc); diff --git a/chrome/content/zotero/selectItemsDialog.xhtml b/chrome/content/zotero/selectItemsDialog.xhtml index 9a0f8573f9..d0eefaed22 100644 --- a/chrome/content/zotero/selectItemsDialog.xhtml +++ b/chrome/content/zotero/selectItemsDialog.xhtml @@ -40,6 +40,7 @@ onunload="doUnload();" persist="screenX screenY width height" class="zotero-dialog" + chromemargin="0,0,0,0" > - - - - + + + + + + + + + - - - - \ No newline at end of file + diff --git a/scss/components/_selectItemsDialog.scss b/scss/components/_selectItemsDialog.scss index 198744a486..a5003d73d2 100644 --- a/scss/components/_selectItemsDialog.scss +++ b/scss/components/_selectItemsDialog.scss @@ -1,40 +1,77 @@ #zotero-select-items-dialog { display: flex; - min-width: 600px; + min-width: 800px; min-height: 450px; } #select-items-dialog { - padding: 2em; + padding: 0; + appearance: none; + background: var(--material-background); + + #collections-items-container { + flex: 1 1 auto; + } #zotero-select-items-container { display: flex; flex-direction: column; - gap: 8px; } #zotero-collections-tree-container { min-width: 200px; min-height: 100%; + padding: 16px 0; + background: var(--material-sidepane); + border-inline-end: var(--material-panedivider); + } + + #zotero-collections-tree { + background: var(--material-sidepane); } #zotero-items-pane-content { - min-height: 100%; + // Please do not become infinitely tall + min-height: 0; + flex: 1; + flex-basis: 0; } + #search-toolbar, .dialog-button-box { + padding: 16px; + } + #search-toolbar { display: flex; flex-direction: row; justify-content: flex-end; - } - - #search-toolbar { flex: 0 0 auto; } + + .dialog-button-box { + gap: 8px; + + button { + margin: 0; + } + } - #collections-items-container { - flex: 1 1 auto; - margin-bottom: 8px; + #zotero-items-pane-content, .dialog-button-box { + border-top: var(--material-border-quarternary); + } + + // Draggable areas: + #zotero-collections-tree-container, + #search-toolbar, + .dialog-button-box { + -moz-window-dragging: drag; + } + + // Non-draggable sub-areas: + #zotero-collections-tree-container .windowed-list, + #search-toolbar quick-search-textbox, + .dialog-button-box button { + -moz-window-dragging: no-drag; } }