From 307fff7a5323bfe7444ff83944b55aa950837386 Mon Sep 17 00:00:00 2001 From: reya <123083837+reyamir@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:28:38 +0700 Subject: [PATCH] fix: titlebar on windows --- src-tauri/src/main.rs | 3 - src/app.css | 160 +++++++++++++++++++---------------- src/routes/$account.lazy.tsx | 17 ++-- 3 files changed, 96 insertions(+), 84 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index cf709e3b..88c90337 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -174,9 +174,6 @@ fn main() { if let tauri::WindowEvent::ThemeChanged(_) = event { win.set_traffic_lights_inset(8.0, 16.0).unwrap(); } - if let tauri::WindowEvent::Resized(_) = event { - win.set_traffic_lights_inset(8.0, 16.0).unwrap(); - } }); // Create data folder if not exist diff --git a/src/app.css b/src/app.css index fec12321..be9821ef 100644 --- a/src/app.css +++ b/src/app.css @@ -3,25 +3,25 @@ @tailwind components; @layer utilities { - .content-break { - word-break: break-word; - word-wrap: break-word; - overflow-wrap: break-word; - } + .content-break { + word-break: break-word; + word-wrap: break-word; + overflow-wrap: break-word; + } - .shadow-toolbar { - box-shadow: - 0 0 #0000, - 0 0 #0000, - 0 8px 24px 0 rgba(0, 0, 0, 0.2), - 0 2px 8px 0 rgba(0, 0, 0, 0.08), - inset 0 0 0 1px rgba(0, 0, 0, 0.2), - inset 0 0 0 2px hsla(0, 0%, 100%, 0.14); - } + .shadow-toolbar { + box-shadow: + 0 0 #0000, + 0 0 #0000, + 0 8px 24px 0 rgba(0, 0, 0, 0.2), + 0 2px 8px 0 rgba(0, 0, 0, 0.08), + inset 0 0 0 1px rgba(0, 0, 0, 0.2), + inset 0 0 0 2px hsla(0, 0%, 100%, 0.14); + } - .shadow-primary { - box-shadow: 0px 0px 4px rgba(66, 65, 73, 0.14); - } + .shadow-primary { + box-shadow: 0px 0px 4px rgba(66, 65, 73, 0.14); + } } /* @@ -29,82 +29,94 @@ */ html { - font-size: 14px; + font-size: 14px; } a { - @apply cursor-default no-underline !important; + @apply cursor-default no-underline !important; } button { - @apply cursor-default focus:outline-none; + @apply cursor-default focus:outline-none; } input::-ms-reveal, input::-ms-clear { - display: none; + display: none; } ::-webkit-input-placeholder { - line-height: normal; + line-height: normal; +} + +div[data-tauri-decorum-tb] { + @apply h-11; } .spinner-leaf { - position: absolute; - top: 0; - left: calc(50% - 12.5% / 2); - width: 12.5%; - height: 100%; - animation: spinner-leaf-fade 800ms linear infinite; + position: absolute; + top: 0; + left: calc(50% - 12.5% / 2); + width: 12.5%; + height: 100%; + animation: spinner-leaf-fade 800ms linear infinite; - &::before { - content: ""; - display: block; - width: 100%; - height: 30%; - background-color: currentColor; - @apply rounded; - } + &::before { + content: ""; + display: block; + width: 100%; + height: 30%; + background-color: currentColor; + @apply rounded; + } - &:where(:nth-child(1)) { - transform: rotate(0deg); - animation-delay: -800ms; - } - &:where(:nth-child(2)) { - transform: rotate(45deg); - animation-delay: -700ms; - } - &:where(:nth-child(3)) { - transform: rotate(90deg); - animation-delay: -600ms; - } - &:where(:nth-child(4)) { - transform: rotate(135deg); - animation-delay: -500ms; - } - &:where(:nth-child(5)) { - transform: rotate(180deg); - animation-delay: -400ms; - } - &:where(:nth-child(6)) { - transform: rotate(225deg); - animation-delay: -300ms; - } - &:where(:nth-child(7)) { - transform: rotate(270deg); - animation-delay: -200ms; - } - &:where(:nth-child(8)) { - transform: rotate(315deg); - animation-delay: -100ms; - } + &:where(:nth-child(1)) { + transform: rotate(0deg); + animation-delay: -800ms; + } + + &:where(:nth-child(2)) { + transform: rotate(45deg); + animation-delay: -700ms; + } + + &:where(:nth-child(3)) { + transform: rotate(90deg); + animation-delay: -600ms; + } + + &:where(:nth-child(4)) { + transform: rotate(135deg); + animation-delay: -500ms; + } + + &:where(:nth-child(5)) { + transform: rotate(180deg); + animation-delay: -400ms; + } + + &:where(:nth-child(6)) { + transform: rotate(225deg); + animation-delay: -300ms; + } + + &:where(:nth-child(7)) { + transform: rotate(270deg); + animation-delay: -200ms; + } + + &:where(:nth-child(8)) { + transform: rotate(315deg); + animation-delay: -100ms; + } } @keyframes spinner-leaf-fade { - from { - opacity: 1; - } - to { - opacity: 0.25; - } + from { + opacity: 1; + } + + to { + opacity: 0.25; + } } diff --git a/src/routes/$account.lazy.tsx b/src/routes/$account.lazy.tsx index b72b0fa6..b39d0952 100644 --- a/src/routes/$account.lazy.tsx +++ b/src/routes/$account.lazy.tsx @@ -35,14 +35,14 @@ function Screen() {