Skip to content

Commit c2653cc

Browse files
committed
feature/auto-hide-tab-bar fixed issue of window title bar
1 parent 3223c8d commit c2653cc

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

frontend/app/block/block.scss

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
@use "../mixins.scss";
5+
@use "../tab/tabbar.scss" as tabbar;
6+
7+
.darwin:not(.fullscreen) .block.block-frame-default .block-frame-default-header {
8+
.window-drag.left {
9+
width: tabbar.$darwin-not-fullscreen-indent;
10+
}
11+
}
512

613
.block {
714
display: flex;

frontend/app/block/blockframe.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import clsx from "clsx";
4040
import * as jotai from "jotai";
4141
import * as React from "react";
4242
import { BlockFrameProps } from "./blocktypes";
43+
import { WindowDrag } from "../element/windowdrag";
4344

4445
const NumActiveConnColors = 8;
4546

@@ -184,6 +185,7 @@ const BlockFrame_Header = ({
184185
const prevMagifiedState = React.useRef(magnified);
185186
const manageConnection = util.useAtomValueSafe(viewModel?.manageConnection);
186187
const dragHandleRef = preview ? null : nodeModel.dragHandleRef;
188+
const draggerLeftRef = React.useRef<HTMLDivElement>(null);
187189
const connName = blockData?.meta?.connection;
188190
const connStatus = util.useAtomValueSafe(getConnStatusAtom(connName));
189191
const wshProblem = connName && !connStatus?.wshenabled && connStatus?.status == "connected";
@@ -252,6 +254,7 @@ const BlockFrame_Header = ({
252254

253255
return (
254256
<div className="block-frame-default-header" ref={dragHandleRef} onContextMenu={onContextMenu}>
257+
<WindowDrag ref={draggerLeftRef} className="left" />
255258
{preIconButtonElem}
256259
<div className="block-frame-default-header-iconview">
257260
{viewIconElem}

frontend/app/tab/tabbar.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33

44
@use "./../theme.scss";
55

6+
$darwin-not-fullscreen-indent: 74px;
7+
68
.tab-bar-wrapper {
79
--default-indent: 10px;
8-
--darwin-not-fullscreen-indent: 74px;
910
}
1011

1112
.darwin:not(.fullscreen) .tab-bar-wrapper {
1213
.window-drag.left {
13-
width: var(--darwin-not-fullscreen-indent);
14+
width: $darwin-not-fullscreen-indent;
1415
}
1516
}
1617

0 commit comments

Comments
 (0)