mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
ae82c47e85
commit
2b5baa93d2
8 changed files with 46 additions and 14 deletions
|
|
@ -32,6 +32,7 @@
|
||||||
--b3-toolbar-blur-background: #373a41;
|
--b3-toolbar-blur-background: #373a41;
|
||||||
--b3-toolbar-color: #9aa0a6;
|
--b3-toolbar-color: #9aa0a6;
|
||||||
--b3-toolbar-hover: #383a42;
|
--b3-toolbar-hover: #383a42;
|
||||||
|
--b3-toolbar-left-mac: 69px;
|
||||||
|
|
||||||
/* 线条 */
|
/* 线条 */
|
||||||
--b3-border-color: rgba(0, 0, 0, .1);
|
--b3-border-color: rgba(0, 0, 0, .1);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
--b3-toolbar-blur-background: #373a41;
|
--b3-toolbar-blur-background: #373a41;
|
||||||
--b3-toolbar-color: #ced0d6;
|
--b3-toolbar-color: #ced0d6;
|
||||||
--b3-toolbar-hover: #383a42;
|
--b3-toolbar-hover: #383a42;
|
||||||
|
--b3-toolbar-left-mac: 69px;
|
||||||
|
|
||||||
/* 线条 */
|
/* 线条 */
|
||||||
--b3-border-color: #0e0f10;
|
--b3-border-color: #0e0f10;
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ html {
|
||||||
|
|
||||||
& > .protyle-breadcrumb,
|
& > .protyle-breadcrumb,
|
||||||
& > .block__icons { // 关系图
|
& > .block__icons { // 关系图
|
||||||
padding-left: 69px;
|
padding-left: var(--b3-toolbar-left-mac);
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ html {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
padding: 0 5px 0 69px;
|
padding: 0 5px 0 var(--b3-toolbar-left-mac);
|
||||||
border-bottom: .5px solid var(--b3-border-color);
|
border-bottom: .5px solid var(--b3-border-color);
|
||||||
|
|
||||||
&--browser {
|
&--browser {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,20 @@
|
||||||
.card {
|
.card {
|
||||||
|
&__main {
|
||||||
|
@extend .fn__flex-column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
max-height: 100%;
|
||||||
|
background-color: var(--b3-theme-surface);
|
||||||
|
|
||||||
|
&.fullscreen > .b3-form__space--small {
|
||||||
|
padding-left: var(--b3-toolbar-left-mac);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__header {
|
||||||
|
display: flex;
|
||||||
|
padding: 8px 8px 8px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
&__empty {
|
&__empty {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -72,13 +72,14 @@ body {
|
||||||
& > .protyle-breadcrumb,
|
& > .protyle-breadcrumb,
|
||||||
& > .block__icons {
|
& > .block__icons {
|
||||||
height: 42px;
|
height: 42px;
|
||||||
|
padding-right: 42px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.body--win32 .fullscreen {
|
&.body--win32 .fullscreen {
|
||||||
& > .protyle-breadcrumb,
|
& > .protyle-breadcrumb,
|
||||||
& > .block__icons {
|
& > .block__icons {
|
||||||
padding-right: 126px;
|
padding-right: 168px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {isMobile} from "../util/functions";
|
||||||
import {Protyle} from "../protyle";
|
import {Protyle} from "../protyle";
|
||||||
import {Constants} from "../constants";
|
import {Constants} from "../constants";
|
||||||
import {disabledProtyle, onGet} from "../protyle/util/onGet";
|
import {disabledProtyle, onGet} from "../protyle/util/onGet";
|
||||||
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
import {hasClosestByAttribute, hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||||
import {hideElements} from "../protyle/ui/hideElements";
|
import {hideElements} from "../protyle/ui/hideElements";
|
||||||
import {needSubscribe} from "../util/needSubscribe";
|
import {needSubscribe} from "../util/needSubscribe";
|
||||||
|
import {fullscreen} from "../protyle/breadcrumb/action";
|
||||||
|
|
||||||
export const openCard = () => {
|
export const openCard = () => {
|
||||||
const exit = window.siyuan.dialogs.find(item => {
|
const exit = window.siyuan.dialogs.find(item => {
|
||||||
|
|
@ -39,10 +40,14 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
const dialog = new Dialog({
|
const dialog = new Dialog({
|
||||||
content: `<div class="fn__flex-column" style="box-sizing: border-box;max-height: 100%">
|
content: `<div class="card__main">
|
||||||
<div class="fn__flex b3-form__space--small">
|
<div class="card__header">
|
||||||
<span class="fn__flex-1 fn__flex-center">${window.siyuan.languages.riffCard}</span>
|
<span class="fn__flex-1 fn__flex-center">${window.siyuan.languages.riffCard}</span>
|
||||||
${html}
|
${html}
|
||||||
|
<div class="fn__space"></div>
|
||||||
|
<div data-type="fullscreen" class="b3-tooltips b3-tooltips__sw block__icon block__icon--show" aria-label="${window.siyuan.languages.fullscreen}">
|
||||||
|
<svg><use xlink:href="#iconFullscreen"></use></svg>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card__block fn__flex-1${blocks.length === 0 ? " fn__none" : ""}${window.siyuan.config.flashcard.mark ? " card__block--hidemark" : ""}${window.siyuan.config.flashcard.superBlock ? " card__block--hidesb" : ""}${window.siyuan.config.flashcard.list ? " card__block--hideli" : ""}" data-type="render"></div>
|
<div class="card__block fn__flex-1${blocks.length === 0 ? " fn__none" : ""}${window.siyuan.config.flashcard.mark ? " card__block--hidemark" : ""}${window.siyuan.config.flashcard.superBlock ? " card__block--hidesb" : ""}${window.siyuan.config.flashcard.list ? " card__block--hideli" : ""}" data-type="render"></div>
|
||||||
<div class="card__empty${blocks.length === 0 ? "" : " fn__none"}" data-type="empty">
|
<div class="card__empty${blocks.length === 0 ? "" : " fn__none"}" data-type="empty">
|
||||||
|
|
@ -130,6 +135,14 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
|
||||||
const selectElement = dialog.element.querySelector("select");
|
const selectElement = dialog.element.querySelector("select");
|
||||||
const titleElement = countElement.previousElementSibling;
|
const titleElement = countElement.previousElementSibling;
|
||||||
dialog.element.addEventListener("click", (event) => {
|
dialog.element.addEventListener("click", (event) => {
|
||||||
|
const fullscreenElement = hasClosestByAttribute(event.target as HTMLElement, "data-type", "fullscreen");
|
||||||
|
if (fullscreenElement) {
|
||||||
|
fullscreen(dialog.element.querySelector(".card__main"),
|
||||||
|
dialog.element.querySelector('[data-type="fullscreen"]'));
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
let type = "";
|
let type = "";
|
||||||
if (typeof event.detail === "string") {
|
if (typeof event.detail === "string") {
|
||||||
if (event.detail === "1" || event.detail === "j") {
|
if (event.detail === "1" || event.detail === "j") {
|
||||||
|
|
|
||||||
|
|
@ -620,7 +620,7 @@ export const globalShortcut = () => {
|
||||||
if (matchDock) {
|
if (matchDock) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
|
if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
|
||||||
openCard();
|
openCard();
|
||||||
if (document.activeElement) {
|
if (document.activeElement) {
|
||||||
(document.activeElement as HTMLElement).blur();
|
(document.activeElement as HTMLElement).blur();
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ const getAllWnds = (layout: Layout, wnds: Wnd[]) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setTabPosition = () => {
|
export const setTabPosition = () => {
|
||||||
if (!isWindow()) {
|
if (!isWindow()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -34,19 +35,18 @@ export const setTabPosition = () => {
|
||||||
const headersLastElement = headerElement.lastElementChild as HTMLElement;
|
const headersLastElement = headerElement.lastElementChild as HTMLElement;
|
||||||
if ("darwin" === window.siyuan.config.system.os) {
|
if ("darwin" === window.siyuan.config.system.os) {
|
||||||
if (rect.top <= 0 && rect.left <= 0 && !getCurrentWindow().isFullScreen()) {
|
if (rect.top <= 0 && rect.left <= 0 && !getCurrentWindow().isFullScreen()) {
|
||||||
item.headersElement.style.paddingLeft = "69px";
|
item.headersElement.style.paddingLeft = "var(--b3-toolbar-left-mac)";
|
||||||
headersLastElement.style.paddingRight = "42px";
|
headersLastElement.style.paddingRight = "42px";
|
||||||
} else {
|
} else {
|
||||||
item.headersElement.style.paddingLeft = "";
|
item.headersElement.style.paddingLeft = "";
|
||||||
headersLastElement.style.paddingRight = "";
|
headersLastElement.style.paddingRight = "";
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// 显示器缩放后像素存在小数点偏差 https://github.com/siyuan-note/siyuan/issues/7355
|
// 显示器缩放后像素存在小数点偏差 https://github.com/siyuan-note/siyuan/issues/7355
|
||||||
if (rect.top <= 0 && rect.right + 8 >= window.innerWidth) {
|
if (rect.top <= 0 && rect.right + 8 >= window.innerWidth) {
|
||||||
headersLastElement.style.paddingRight = (42 * 4) + "px";
|
headersLastElement.style.paddingRight = (42 * ("darwin" === window.siyuan.config.system.os ? 1 : 4)) + "px";
|
||||||
} else {
|
} else {
|
||||||
headersLastElement.style.paddingRight = "";
|
headersLastElement.style.paddingRight = "";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue