@@ -11,42 +11,40 @@ type Props = {
11
11
isVisible ?: boolean ;
12
12
} ;
13
13
14
- // See: https://github.com/electron/electron/issues/5678
15
- // Visible all the time in the app
16
- const ThinFixForNotBeingAbleToDragWindow = styled . div `
14
+ const FixForNotBeingAbleToDragWindow = styled . div `
17
15
-webkit-app-region: drag;
18
- height: 16px;
16
+ pointer-events: none;
17
+ height: 64px;
19
18
position: fixed;
20
19
z-index: ${ zIndices . windowControls } ;
21
20
top: 0;
22
21
left: 0;
23
22
width: 100%;
24
23
` ;
25
24
26
- // Visible below content (but visible in the sidebar)
27
- const ThickFixForNotBeingAbleToDragWindow = styled ( ThinFixForNotBeingAbleToDragWindow ) `
28
- height: 64px;
29
- z-index: unset;
30
- ` ;
31
-
32
25
const Container = styled . div < { $offset : number } > `
33
26
${ ( { $offset } ) => `padding-top: ${ $offset } px;` }
34
27
width: 100%;
35
28
height: 100%;
36
29
` ;
37
30
31
+ // See: https://github.com/electron/electron/issues/5678
32
+ // Visible all the time in the app
33
+ export const TrafficLightDraggableWindowHeader = ( { children, isVisible = true } : Props ) => {
34
+ const isMac = isMacOs ( ) ;
35
+ const isDesktopApp = isDesktop ( ) ;
36
+
37
+ if ( ! isVisible || ! isMac || ! isDesktopApp ) return children ;
38
+
39
+ return < FixForNotBeingAbleToDragWindow /> ;
40
+ } ;
41
+
38
42
// on Mac in desktop app we don't use window bar and close/maximize/minimize icons are positioned directly in the app
39
43
export const TrafficLightOffset = ( { children, offset = 35 , isVisible = true } : Props ) => {
40
44
const isMac = isMacOs ( ) ;
41
45
const isDesktopApp = isDesktop ( ) ;
42
46
43
47
if ( ! isVisible || ! isMac || ! isDesktopApp ) return children ;
44
48
45
- return (
46
- < >
47
- < ThinFixForNotBeingAbleToDragWindow />
48
- < ThickFixForNotBeingAbleToDragWindow />
49
- < Container $offset = { offset } > { children } </ Container >
50
- </ >
51
- ) ;
49
+ return < Container $offset = { offset } > { children } </ Container > ;
52
50
} ;
0 commit comments