mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
f9edcd0690
commit
7ef7577821
3 changed files with 11 additions and 3 deletions
|
|
@ -72,6 +72,7 @@ import {quickMakeCard} from "../../card/makeCard";
|
||||||
import {copyPNG} from "../../menus/util";
|
import {copyPNG} from "../../menus/util";
|
||||||
import {getContentByInlineHTML} from "../../protyle/wysiwyg/keydown";
|
import {getContentByInlineHTML} from "../../protyle/wysiwyg/keydown";
|
||||||
import {searchKeydown} from "./searchKeydown";
|
import {searchKeydown} from "./searchKeydown";
|
||||||
|
import {openNewWindow} from "../../window/openNewWindow";
|
||||||
|
|
||||||
const switchDialogEvent = (app: App, event: MouseEvent) => {
|
const switchDialogEvent = (app: App, event: MouseEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -1577,14 +1578,19 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event) ||
|
if ((
|
||||||
|
matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event) ||
|
||||||
matchHotKey(window.siyuan.config.keymap.general.splitMoveR.custom, event) ||
|
matchHotKey(window.siyuan.config.keymap.general.splitMoveR.custom, event) ||
|
||||||
matchHotKey(window.siyuan.config.keymap.general.splitTB.custom, event) ||
|
matchHotKey(window.siyuan.config.keymap.general.splitTB.custom, event) ||
|
||||||
matchHotKey(window.siyuan.config.keymap.general.splitMoveB.custom, event)) && !event.repeat) {
|
matchHotKey(window.siyuan.config.keymap.general.tabToWindow.custom, event) ||
|
||||||
|
matchHotKey(window.siyuan.config.keymap.general.splitMoveB.custom, event)
|
||||||
|
) && !event.repeat) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const tab = getActiveTab(false);
|
const tab = getActiveTab(false);
|
||||||
if (tab) {
|
if (tab) {
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.general.tabToWindow.custom, event)) {
|
||||||
|
openNewWindow(tab);
|
||||||
|
} else if (matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event)) {
|
||||||
tab.parent.split("lr").addTab(copyTab(app, tab));
|
tab.parent.split("lr").addTab(copyTab(app, tab));
|
||||||
} else if (matchHotKey(window.siyuan.config.keymap.general.splitTB.custom, event)) {
|
} else if (matchHotKey(window.siyuan.config.keymap.general.splitTB.custom, event)) {
|
||||||
tab.parent.split("tb").addTab(copyTab(app, tab));
|
tab.parent.split("tb").addTab(copyTab(app, tab));
|
||||||
|
|
|
||||||
|
|
@ -279,6 +279,7 @@ export abstract class Constants {
|
||||||
closeUnmodified: {default: "", custom: ""},
|
closeUnmodified: {default: "", custom: ""},
|
||||||
closeLeft: {default: "", custom: ""},
|
closeLeft: {default: "", custom: ""},
|
||||||
closeRight: {default: "", custom: ""},
|
closeRight: {default: "", custom: ""},
|
||||||
|
tabToWindow: {default: "", custom: ""},
|
||||||
},
|
},
|
||||||
editor: {
|
editor: {
|
||||||
general: {
|
general: {
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.tabToWindow,
|
label: window.siyuan.languages.tabToWindow,
|
||||||
|
accelerator: window.siyuan.config.keymap.general.tabToWindow.custom,
|
||||||
icon: "iconOpenWindow",
|
icon: "iconOpenWindow",
|
||||||
click: () => {
|
click: () => {
|
||||||
openNewWindow(tab);
|
openNewWindow(tab);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue