Skip to content

Commit

Permalink
ui: use native titlebar on Electron
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed May 24, 2021
1 parent 9cc6e3d commit 223c4b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 115 deletions.
3 changes: 1 addition & 2 deletions src/electron/electron/core.cljs
Expand Up @@ -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
Expand Down
113 changes: 0 additions & 113 deletions src/main/frontend/components/theme.css
Expand Up @@ -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;
}
Expand Down

0 comments on commit 223c4b3

Please sign in to comment.