Skip to content

Commit 9bd9d37

Browse files
committed
fix: top tab list
1 parent b29b101 commit 9bd9d37

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/renderer/components/TitleBar.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ const isUsingLeftControl = process.platform === 'darwin'
5454
display: grid;
5555
flex: none;
5656
grid-template-columns: 1fr auto 1fr;
57+
gap: 8px;
5758
height: env(titlebar-area-height, 36px);
5859
padding: 0 16px;
5960
line-height: env(titlebar-area-height, 36px);
6061
-webkit-app-region: drag;
6162
&:has(.tab-list) {
63+
display: flex;
6264
height: #{36px + 2 * 8px}; // var(--min-tab-height) + 2 * 8px
6365
line-height: 1;
6466
}
@@ -103,6 +105,7 @@ const isUsingLeftControl = process.platform === 'darwin'
103105
}
104106
.title-wrapper {
105107
display: flex;
108+
flex: auto;
106109
&:has(.terminal-title) {
107110
justify-content: center;
108111
}

src/renderer/components/WindowControl.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts" setup>
22
import { useMaximized, useMinimized } from '../compositions/frame'
3+
import { useSettings } from '../compositions/settings'
34
import VisualIcon from './basic/VisualIcon.vue'
45
56
let isMaximized = $(useMaximized())
@@ -8,6 +9,11 @@ let isMinimized = $(useMinimized())
89
const platform = process.platform
910
const isCustomControlEnabled = !['darwin', 'win32'].includes(platform)
1011
12+
const settings = useSettings()
13+
const isInteractive = $computed(() => {
14+
return settings['terminal.view.tabListPosition'] === 'top'
15+
})
16+
1117
function minimize() {
1218
isMinimized = !isMinimized
1319
}
@@ -22,7 +28,7 @@ function close() {
2228
</script>
2329

2430
<template>
25-
<div :class="['window-control', platform, { 'is-custom': isCustomControlEnabled }]">
31+
<div :class="['window-control', platform, { 'is-custom': isCustomControlEnabled, 'is-interactive': isInteractive }]">
2632
<template v-if="isCustomControlEnabled">
2733
<div class="minimize button" @click="minimize">
2834
<VisualIcon name="lucide-minus" />
@@ -38,12 +44,19 @@ function close() {
3844
</template>
3945

4046
<style lang="scss" scoped>
47+
@use 'sass:math';
48+
4149
.window-control {
4250
display: flex;
4351
gap: 8px;
4452
// TODO: get the min size on win32
4553
&.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+
}
4760
}
4861
}
4962
.button {

0 commit comments

Comments
 (0)