1
1
<script lang="ts" setup>
2
2
import { useMaximized , useMinimized } from ' ../compositions/frame'
3
+ import { useSettings } from ' ../compositions/settings'
3
4
import VisualIcon from ' ./basic/VisualIcon.vue'
4
5
5
6
let isMaximized = $ (useMaximized ())
@@ -8,6 +9,11 @@ let isMinimized = $(useMinimized())
8
9
const platform = process .platform
9
10
const isCustomControlEnabled = ! [' darwin' , ' win32' ].includes (platform )
10
11
12
+ const settings = useSettings ()
13
+ const isInteractive = $computed (() => {
14
+ return settings [' terminal.view.tabListPosition' ] === ' top'
15
+ })
16
+
11
17
function minimize() {
12
18
isMinimized = ! isMinimized
13
19
}
@@ -22,7 +28,7 @@ function close() {
22
28
</script >
23
29
24
30
<template >
25
- <div :class =" ['window-control', platform, { 'is-custom': isCustomControlEnabled }]" >
31
+ <div :class =" ['window-control', platform, { 'is-custom': isCustomControlEnabled, 'is-interactive': isInteractive }]" >
26
32
<template v-if =" isCustomControlEnabled " >
27
33
<div class =" minimize button" @click =" minimize" >
28
34
<VisualIcon name =" lucide-minus" />
@@ -38,12 +44,19 @@ function close() {
38
44
</template >
39
45
40
46
<style lang="scss" scoped>
47
+ @use ' sass:math' ;
48
+
41
49
.window-control {
42
50
display : flex ;
43
51
gap : 8px ;
44
52
// TODO: get the min size on win32
45
53
& .darwin :not (.is-custom ) {
46
- width : #{12px * 2 + 56px } ;
54
+ $--traffic-light-width : 12px * 2 + 56px ;
55
+ $--traffic-light-offset : math .div ((36px + 8px * 2 ) - 36px , 2 );
56
+ width : $--traffic-light-width ;
57
+ & .is-interactive {
58
+ width : #{$--traffic-light-width + $--traffic-light-offset } ;
59
+ }
47
60
}
48
61
}
49
62
.button {
0 commit comments