fixes for extra window

This commit is contained in:
zadam 2020-04-26 23:11:52 +02:00
parent 7ea53d468e
commit 907cdd8fcb
5 changed files with 17 additions and 3 deletions

View File

@ -30,7 +30,7 @@ export default class DesktopExtraWindowLayout {
.child(new TitleBarButtonsWidget()))
.child(new FlexContainer('row')
.collapsible()
.child(new FlexContainer('column').id('center-pane')
.child(new FlexContainer('column').id('center-pane').css('flex-grow', '1')
.child(new FlexContainer('row').class('title-row')
.cssBlock('.title-row > * { margin: 5px; }')
.child(new NoteTitleWidget())

View File

@ -322,6 +322,14 @@ export default class TabManager extends Component {
}
}
moveTabToNewWindowCommand({tabId}) {
const notePath = this.getTabContextById(tabId).notePath;
this.removeTab(tabId);
appContext.openInNewWindow(notePath);
}
async hoistedNoteChangedEvent({hoistedNoteId}) {
if (hoistedNoteId === 'root') {
return;

View File

@ -56,7 +56,8 @@ class TreeContextMenu {
const insertNoteAfterEnabled = isNotRoot && !isHoisted && parentNotSearch;
return [
{ title: 'Open in new tab', command: "openInTab", uiIcon: "empty", enabled: noSelectedNotes },
{ title: 'Open in a new tab <kbd>Ctrl+Click</kbd>', command: "openInTab", uiIcon: "empty", enabled: noSelectedNotes },
{ title: 'Open in a new window', command: "openInWindow", uiIcon: "empty", enabled: noSelectedNotes },
{ title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "plus",
items: insertNoteAfterEnabled ? this.getNoteTypeItems("insertNoteAfter") : null,
enabled: insertNoteAfterEnabled && noSelectedNotes },
@ -111,6 +112,9 @@ class TreeContextMenu {
if (command === 'openInTab') {
appContext.tabManager.openTabWithNote(notePath);
}
else if (command === 'openInWindow') {
appContext.openInNewWindow(notePath);
}
else if (command === "insertNoteAfter") {
const parentNoteId = this.node.data.parentNoteId;
const isProtected = await treeService.getParentProtectedStatus(this.node);

View File

@ -258,8 +258,9 @@ export default class TabRowWidget extends BasicWidget {
x: e.pageX,
y: e.pageY,
items: [
{title: "Move this tab to a new window", command: "moveTabToNewWindow", uiIcon: "empty"},
{title: "Close all tabs", command: "removeAllTabs", uiIcon: "empty"},
{title: "Close all tabs except for this", command: "removeAllTabsExceptForThis", uiIcon: "empty"}
{title: "Close all tabs except for this", command: "removeAllTabsExceptForThis", uiIcon: "empty"},
],
selectMenuItemHandler: ({command}) => {
this.triggerCommand(command, {tabId});

View File

@ -56,6 +56,7 @@ const TPL = `
overflow: auto;
height: 100%;
font-family: var(--detail-text-font-family);
padding-left: 12px;
}
.note-detail-text-editor {