From 223c4b3d3f477a1002ab94bba8129159cd06cf17 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 24 May 2021 09:21:12 +0800 Subject: [PATCH] ui: use native titlebar on Electron --- src/electron/electron/core.cljs | 3 +- src/main/frontend/components/theme.css | 113 ------------------------- 2 files changed, 1 insertion(+), 115 deletions(-) diff --git a/src/electron/electron/core.cljs b/src/electron/electron/core.cljs index 0a482578c73..c7491bb3756 100644 --- a/src/electron/electron/core.cljs +++ b/src/electron/electron/core.cljs @@ -28,9 +28,8 @@ win-opts (cond-> {:width (.-width win-state) :height (.-height win-state) - :frame (not mac?) + :frame true :autoHideMenuBar (not mac?) - :titleBarStyle (if mac? "hidden" nil) :webPreferences {:plugins true ; pdf :nodeIntegration false diff --git a/src/main/frontend/components/theme.css b/src/main/frontend/components/theme.css index 42601b2fa06..f90fa8be770 100644 --- a/src/main/frontend/components/theme.css +++ b/src/main/frontend/components/theme.css @@ -92,119 +92,6 @@ html[data-theme='light'] { } } -html.is-electron { - --frame-top-height: 24px; - - .theme-inner { - } - - .cp__header { - height: 2.6rem; - background-color: var(--ls-primary-background-color); - top: 0; - } - - &.is-mac { - .cp__header { - height: calc(2.2rem + var(--frame-top-height)); - padding-top: var(--frame-top-height); - - &-logo { - height: var(--frame-top-height); - } - - &:before { - content: ' '; - position: fixed; - top: 0; - left: 0; - z-index: 8; - -webkit-app-region: drag; - width: 100%; - height: var(--frame-top-height); - } - } - - .cp__right-sidebar { - top: 4rem; - } - - &.is-fullscreen { - .cp__header { - padding-top: 0; - height: 2.6rem; - - &:before { - display: none; - } - } - } - } - - #search { - -webkit-app-region: drag; - - #search-wrapper { - -webkit-app-region: no-drag; - } - } - - .ls-window-frame-title-bar { - background-color: var(--ls-primary-background-color); - position: fixed; - left: 0; - right: 0; - z-index: 9; - height: var(--frame-top-height); - display: flex; - align-items: center; - justify-content: space-between; - user-select: none; - -webkit-app-region: drag; - - & > .l { - display: flex; - } - - & > .r { - & > .inner { - display: flex; - } - } - - & > .c { - font-size: 0.7rem; - } - - a.it { - padding: 0 2px; - cursor: pointer; - -webkit-app-region: no-drag; - - &:hover { - background-color: var(--ls-secondary-background-color); - } - - &:active { - background-color: var(--ls-primary-background-color); - } - - svg { - transform: scale(0.6); - color: var(--ls-primary-text-color); - cursor: pointer; - } - - &.maximize { - svg { - transform: scale(0.5) translateY(2px) translateX(1px); - opacity: 0.7; - } - } - } - } -} - html.locked-scroll { overflow: hidden !important; }