Skip to content

Commit

Permalink
feat: style on window blur
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Dec 4, 2024
1 parent 0fb5958 commit 6576710
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/renderer/components/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import { useWindowFocus } from '@vueuse/core'
import { webUtils } from 'electron'
import { onMounted } from 'vue'
import { ipcRenderer } from '@commas/electron-ipc'
Expand Down Expand Up @@ -52,6 +53,8 @@ const hasHorizontalTabList = $computed(() => {
return position === 'top' || position === 'bottom'
})
const isWindowFocused = $(useWindowFocus())
const slots = commas.proxy.context.getCollection('terminal.ui-slot')
loadAddons()
Expand Down Expand Up @@ -118,7 +121,7 @@ function dropFile(event: DragEvent) {

<template>
<div
:class="['app', { 'is-opaque': isFullscreen, 'is-vibrant': theme.vibrancy }]"
:class="['app', { 'is-opaque': isFullscreen, 'is-vibrant': theme.vibrancy, 'is-window-focused': isWindowFocused }]"
@dragover.prevent="dragFileOver"
@drop="dropFile"
>
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/TabItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ function close() {
&.active {
background: var(--design-active-background);
box-shadow: var(--design-element-shadow);
.app:not(.is-window-focused) & {
background: color-mix(in oklab, var(--design-active-background) 50%, transparent);
}
}
&.focused:not(.standalone) {
outline: 2px solid rgb(var(--system-accent));
Expand Down

0 comments on commit 6576710

Please sign in to comment.