Vanessa 2023-04-03 19:50:25 +08:00
parent ae82c47e85
commit 2b5baa93d2
8 changed files with 46 additions and 14 deletions

View file

@ -32,6 +32,7 @@
--b3-toolbar-blur-background: #373a41;
--b3-toolbar-color: #9aa0a6;
--b3-toolbar-hover: #383a42;
--b3-toolbar-left-mac: 69px;
/* 线条 */
--b3-border-color: rgba(0, 0, 0, .1);

View file

@ -32,6 +32,7 @@
--b3-toolbar-blur-background: #373a41;
--b3-toolbar-color: #ced0d6;
--b3-toolbar-hover: #383a42;
--b3-toolbar-left-mac: 69px;
/* 线条 */
--b3-border-color: #0e0f10;

View file

@ -117,7 +117,7 @@ html {
& > .protyle-breadcrumb,
& > .block__icons { // 关系图
padding-left: 69px;
padding-left: var(--b3-toolbar-left-mac);
height: 32px;
}
@ -156,7 +156,7 @@ html {
box-sizing: border-box;
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);
&--browser {

View file

@ -1,4 +1,20 @@
.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 {
display: flex;
justify-content: center;

View file

@ -72,13 +72,14 @@ body {
& > .protyle-breadcrumb,
& > .block__icons {
height: 42px;
padding-right: 42px;
}
}
&.body--win32 .fullscreen {
& > .protyle-breadcrumb,
& > .block__icons {
padding-right: 126px;
padding-right: 168px;
}
}

View file

@ -4,9 +4,10 @@ import {isMobile} from "../util/functions";
import {Protyle} from "../protyle";
import {Constants} from "../constants";
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 {needSubscribe} from "../util/needSubscribe";
import {fullscreen} from "../protyle/breadcrumb/action";
export const openCard = () => {
const exit = window.siyuan.dialogs.find(item => {
@ -39,10 +40,14 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
</div>`;
}
const dialog = new Dialog({
content: `<div class="fn__flex-column" style="box-sizing: border-box;max-height: 100%">
<div class="fn__flex b3-form__space--small">
content: `<div class="card__main">
<div class="card__header">
<span class="fn__flex-1 fn__flex-center">${window.siyuan.languages.riffCard}</span>
${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 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">
@ -130,6 +135,14 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
const selectElement = dialog.element.querySelector("select");
const titleElement = countElement.previousElementSibling;
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 = "";
if (typeof event.detail === "string") {
if (event.detail === "1" || event.detail === "j") {

View file

@ -620,7 +620,7 @@ export const globalShortcut = () => {
if (matchDock) {
return;
}
if (matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
openCard();
if (document.activeElement) {
(document.activeElement as HTMLElement).blur();

View file

@ -13,6 +13,7 @@ const getAllWnds = (layout: Layout, wnds: Wnd[]) => {
}
}
};
export const setTabPosition = () => {
if (!isWindow()) {
return;
@ -34,19 +35,18 @@ export const setTabPosition = () => {
const headersLastElement = headerElement.lastElementChild as HTMLElement;
if ("darwin" === window.siyuan.config.system.os) {
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";
} else {
item.headersElement.style.paddingLeft = "";
headersLastElement.style.paddingRight = "";
}
}
// 显示器缩放后像素存在小数点偏差 https://github.com/siyuan-note/siyuan/issues/7355
if (rect.top <= 0 && rect.right + 8 >= window.innerWidth) {
headersLastElement.style.paddingRight = (42 * ("darwin" === window.siyuan.config.system.os ? 1 : 4)) + "px";
} else {
// 显示器缩放后像素存在小数点偏差 https://github.com/siyuan-note/siyuan/issues/7355
if (rect.top <= 0 && rect.right + 8 >= window.innerWidth) {
headersLastElement.style.paddingRight = (42 * 4) + "px";
} else {
headersLastElement.style.paddingRight = "";
}
headersLastElement.style.paddingRight = "";
}
});
};