zotero/scss/components/_mainWindow.scss
Dan Stillman 1694056956 Support multiple library tabs (#6035)
Additional library tabs can be opened via File → New Library Tab
(Cmd/Ctrl-T), a collection's context menu, or Duplicate Tab, and each
holds its own live library view. Library tabs share layout settings
(pane sizes, stacked or standard layout, and columns) and tag selector
display options, and a tab picks up the current ones when it's shown.
Closed library tabs reopen with their collections, selected items,
searches, and tag selection.

Every library tab can be closed, including the window's first one, so
a window can have no library view at all. Closing a window's last tab
closes the window, except for the last tab of the last window on
Windows and Linux, which stays open so that closing a tab doesn't quit
Zotero.

For backward compatibility with plugins, the window's first library
view keeps the original element ids. Other views append their tab's id
to each element id (e.g., zotero-items-tree-tab-k3Xq9TzA).

The onMainWindowLoad and onMainWindowUnload plugin hooks now follow a
window's library views rather than the window itself. Since a main
window might not have a library view, code that iterates
Zotero.getMainWindows() should check ZoteroPane.libraryView.
2026-11-06 20:58:05 -05:00

92 lines
2.1 KiB
SCSS

:is(panel) {
&::part(content) {
--panel-background-color: var(--material-toolbar);
}
&#autoscroller {
&::part(content) {
--panel-background-color: inherit;
}
}
}
#main-window {
min-width: max(var(--width-of-fixed-components) + $min-width-items-pane, $min-width-tabs-deck);
min-height: 300px;
}
#main-window.stacked {
min-height: calc(var(--height-of-fixed-components) + $min-height-items-pane + $height-toolbar);
}
tab-content:has(> library-view) {
min-width: 0;
min-height: 0;
flex-direction: column;
}
library-view {
flex: 1;
min-width: 0;
min-height: 0;
}
#zotero-pane-stack > hbox {
// Let window chrome, tabs, and toolbar shrink even when sidebars overflow
min-width: 0;
}
#browser, #zotero-pane-stack, :is(#zotero-trees, .zotero-trees) {
min-height: 0;
}
#zotero-pane-overlay {
background: rgba(0,0,0,.3);
}
#zotero-pane-progress-box {
background: var(--color-sidepane);
border-radius: 5px;
border: var(--color-panedivider);
min-height: 30px;
width: 300px;
}
#zotero-pane-progressmeter-container {
padding: 10px;
justify-content: center;
}
#zotero-pane-progress-label {
margin: 0;
}
#zotero-pane-progressmeter {
width: 100%;
margin-top: 4px;
}
:is(#zotero-layout-switcher, .zotero-layout-switcher) {
flex-grow: 1;
flex-shrink: 1;
min-width: 0;
/*
Fx115: make panes occupy all available width/height after layout switch
or splitter expand/collapse.
The splitter element stores state in the style attribute's width/height
properties, and if we remove them, the splitter breaks. So we override
them here with !important.
*/
&[orient="horizontal"] :is(#zotero-items-pane-container, .zotero-items-pane-container, #zotero-item-pane, .zotero-item-pane) {
height: auto !important;
}
&[orient="vertical"],
&[orient="vertical"] :is(#zotero-items-pane-container, .zotero-items-pane-container, #zotero-item-pane, .zotero-item-pane) {
width: -moz-available !important;
/* min-width: 0 is required here to allow the pane to shrink in Stacked view,
but the child #zotero-items-pane sets a larger min-width, and the splitter
follows that instead of this. */
min-width: 0 !important;
}
}