mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
bit better right pane layout
This commit is contained in:
parent
0f4ba43463
commit
4c82e882e0
@ -58,11 +58,16 @@ export default class CollapsibleWidget extends TabAwareWidget {
|
|||||||
this.$headerActions = this.$widget.find('.widget-header-actions');
|
this.$headerActions = this.$widget.find('.widget-header-actions');
|
||||||
this.$headerActions.append(...this.getHeaderActions());
|
this.$headerActions.append(...this.getHeaderActions());
|
||||||
|
|
||||||
|
this.decorateWidget();
|
||||||
|
|
||||||
this.initialized = this.doRenderBody();
|
this.initialized = this.doRenderBody();
|
||||||
|
|
||||||
return this.$widget;
|
return this.$widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** for overriding */
|
||||||
|
decorateWidget() {}
|
||||||
|
|
||||||
/** for overriding */
|
/** for overriding */
|
||||||
async doRenderBody() {}
|
async doRenderBody() {}
|
||||||
|
|
||||||
|
@ -26,6 +26,75 @@ import SimilarNotesWidget from "./similar_notes.js";
|
|||||||
import WhatLinksHereWidget from "./what_links_here.js";
|
import WhatLinksHereWidget from "./what_links_here.js";
|
||||||
import SidePaneToggles from "./side_pane_toggles.js";
|
import SidePaneToggles from "./side_pane_toggles.js";
|
||||||
|
|
||||||
|
const RIGHT_PANE_CSS = `
|
||||||
|
<style>
|
||||||
|
#right-pane .card {
|
||||||
|
border: 0;
|
||||||
|
min-height: 0;
|
||||||
|
max-height: 30%;
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-shrink: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .card-header {
|
||||||
|
background: inherit;
|
||||||
|
padding: 3px 10px 3px 10px;
|
||||||
|
width: 99%; /* to give minimal right margin */
|
||||||
|
background-color: var(--button-background-color);
|
||||||
|
border-color: var(--button-border-color);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-style: solid;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .widget-title {
|
||||||
|
border-radius: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
background: inherit;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--muted-text-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .widget-header-action {
|
||||||
|
color: var(--link-color) !important;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .widget-help {
|
||||||
|
color: var(--muted-text-color);
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .widget-help.no-link:hover {
|
||||||
|
cursor: default;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .body-wrapper {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .card-body {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
border: 0;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-pane .card-body ul {
|
||||||
|
padding-left: 25px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>`;
|
||||||
|
|
||||||
export default class DesktopLayout {
|
export default class DesktopLayout {
|
||||||
getRootWidget(appContext) {
|
getRootWidget(appContext) {
|
||||||
return new FlexContainer('column')
|
return new FlexContainer('column')
|
||||||
@ -57,7 +126,7 @@ export default class DesktopLayout {
|
|||||||
.child(new TabCachingWidget(() => new PromotedAttributesWidget()))
|
.child(new TabCachingWidget(() => new PromotedAttributesWidget()))
|
||||||
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
||||||
)
|
)
|
||||||
.child(new SidePaneContainer('right')
|
.child(new SidePaneContainer('right').cssBlock(RIGHT_PANE_CSS)
|
||||||
.child(new NoteInfoWidget())
|
.child(new NoteInfoWidget())
|
||||||
.child(new TabCachingWidget(() => new CalendarWidget()))
|
.child(new TabCachingWidget(() => new CalendarWidget()))
|
||||||
.child(new TabCachingWidget(() => new AttributesWidget()))
|
.child(new TabCachingWidget(() => new AttributesWidget()))
|
||||||
|
@ -46,7 +46,9 @@ export default class FlexContainer extends BasicWidget {
|
|||||||
this.$widget = $(`<div>`);
|
this.$widget = $(`<div>`);
|
||||||
|
|
||||||
if (this.cssEl) {
|
if (this.cssEl) {
|
||||||
this.$widget.append($(`<style>`).append(this.cssEl));
|
const css = this.cssEl.trim().startsWith('<style>') ? this.cssEl : `<style>${this.cssEl}</style>`;
|
||||||
|
|
||||||
|
this.$widget.append(css);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const key in this.attrs) {
|
for (const key in this.attrs) {
|
||||||
|
@ -818,8 +818,4 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
|
|
||||||
noteCreateService.duplicateNote(noteId, branch.parentNoteId);
|
noteCreateService.duplicateNote(noteId, branch.parentNoteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
activeScreenChangedEvent({activeScreen}) {
|
|
||||||
this.toggle(activeScreen === 'tree');
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -141,69 +141,6 @@ body {
|
|||||||
border-color: var(--button-border-color);
|
border-color: var(--button-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
#right-pane .card {
|
|
||||||
border: 0;
|
|
||||||
min-height: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .card-header {
|
|
||||||
background: inherit;
|
|
||||||
padding: 3px 10px 3px 10px;
|
|
||||||
width: 99%; /* to give minimal right margin */
|
|
||||||
background-color: var(--button-background-color);
|
|
||||||
border-color: var(--button-border-color);
|
|
||||||
border-width: 1px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border-style: solid;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .widget-title {
|
|
||||||
border-radius: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
background: inherit;
|
|
||||||
font-weight: bold;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--muted-text-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .widget-header-action {
|
|
||||||
color: var(--link-color) !important;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .widget-help {
|
|
||||||
color: var(--muted-text-color);
|
|
||||||
position: relative;
|
|
||||||
top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .widget-help.no-link:hover {
|
|
||||||
cursor: default;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .body-wrapper {
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .card-body {
|
|
||||||
width: 100%;
|
|
||||||
padding: 8px;
|
|
||||||
border: 0;
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#right-pane .card-body ul {
|
|
||||||
padding-left: 25px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#widgets-configuration {
|
#widgets-configuration {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user