Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
fix(unfocusEffect): 🐛 Fix unfocusEffect on titlebar
Browse files Browse the repository at this point in the history
241, 247
  • Loading branch information
AlexTorresDev committed Jan 15, 2024
1 parent 6d36009 commit 45c6917
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/titlebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export class CustomTitlebar extends ThemeBar {
maximize: 'Maximize',
minimize: 'Minimize',
restoreDown: 'Restore Down'
}
},
unfocusEffect: true
}

private platformIcons: { [key: string]: string }
Expand Down Expand Up @@ -373,7 +374,7 @@ export class CustomTitlebar extends ThemeBar {
removeClass(this.titlebar, 'inactive')
}

const backgroundColor = this.isInactive
const backgroundColor = this.isInactive && this.currentOptions.unfocusEffect
? this.currentOptions.backgroundColor?.lighten(0.12)
: this.currentOptions.backgroundColor

Expand All @@ -386,13 +387,13 @@ export class CustomTitlebar extends ThemeBar {
if (backgroundColor?.isLighter()) {
addClass(this.titlebar, 'light')

foregroundColor = this.isInactive
foregroundColor = this.isInactive && this.currentOptions.unfocusEffect
? INACTIVE_FOREGROUND_DARK
: ACTIVE_FOREGROUND_DARK
} else {
removeClass(this.titlebar, 'light')

foregroundColor = this.isInactive
foregroundColor = this.isInactive && this.currentOptions.unfocusEffect
? INACTIVE_FOREGROUND
: ACTIVE_FOREGROUND
}
Expand Down
7 changes: 6 additions & 1 deletion src/titlebar/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@ export interface TitleBarOptions extends MenuBarOptions {
* **The default is "Close"**
*/
close?: string
}
},
/**
* Enables or disables the blur option in titlebar.
* *The default is true*
*/
unfocusEffect?: boolean;
}

0 comments on commit 45c6917

Please sign in to comment.