feat: Add border-radius for window on linux

This commit is contained in:
MystiPanda 2024-03-13 13:58:29 +08:00
parent 4256590735
commit 75d41b6fe5
7 changed files with 21 additions and 11 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ dist-ssr
update.json
scripts/_env.sh
.vscode
.tool-version

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
nodejs 21.7.1

View File

@ -171,7 +171,7 @@ pub fn create_window(app_handle: &AppHandle) {
.title_bar_style(tauri::TitleBarStyle::Overlay)
.build();
#[cfg(target_os = "linux")]
let window = builder.decorations(true).transparent(false).build();
let window = builder.decorations(false).transparent(true).build();
match window {
Ok(win) => {

View File

@ -47,11 +47,11 @@ body {
@import "./page.scss";
@import "./font.scss";
@media (prefers-color-scheme: dark) {
:root {
background-color: rgba(18, 18, 18, 1);
}
}
// @media (prefers-color-scheme: dark) {
// :root {
// background-color: rgba(18, 18, 18, 1);
// }
// }
.user-none {
user-select: none;

View File

@ -94,7 +94,7 @@
// position: absolute;
// top: 0px;
// right: 0px;
height: 24px;
height: 36px;
display: flex;
// align-items: center;
justify-content: end;

View File

@ -122,6 +122,14 @@ const Layout = () => {
({ palette }) => ({
bgcolor: palette.background.paper,
}),
OS === "linux"
? {
borderRadius: "8px",
border: "2px solid var(--divider-color)",
width: "calc(100vw - 4px)",
height: "calc(100vh - 4px)",
}
: {},
]}
>
<div className="layout__left" data-tauri-drag-region="true">
@ -148,11 +156,11 @@ const Layout = () => {
</div>
<div className="layout__right">
{OS === "windows" && (
{
<div className="the-bar" data-tauri-drag-region="true">
<LayoutControl />
{OS !== "macos" && <LayoutControl />}
</div>
)}
}
<TransitionGroup className="the-content">
<CSSTransition

View File

@ -4,7 +4,7 @@ const OS = getSystem();
// default theme setting
export const defaultTheme = {
primary_color: "#007AFF",
secondary_color: "#FFCC00",
secondary_color: "#fc9b76",
primary_text: "#000000",
secondary_text: "#3c3c4399",
info_color: "#007AFF",