From 0f137632d56b0e2c7a441fb16ce79d8e8e7ef60b Mon Sep 17 00:00:00 2001 From: Lacy Morrow Date: Sat, 16 May 2026 00:35:01 -0400 Subject: [PATCH] fix: resetting bg color now also resets foreground/accent color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When appBgColor is cleared/reset, the appHighlightColor was left set, making buttons invisible against the default background. Now the highlight color is tied to the bg color — clearing bg also clears highlight. Closes #3 Co-Authored-By: Paperclip --- CHANGELOG.md | 3 +++ src/main/crossover.js | 17 +++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de00c57..7f8e107a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 2026-05-16 +- fix: resetting bg color now also resets foreground/accent color ([LAC-1313](https://github.com/lacymorrow/xover/issues/3)) + ### 2024-12-19 - Feature: SVG circle demo crosshair added - Improvements: Enhanced crosshair rendering and positioning diff --git a/src/main/crossover.js b/src/main/crossover.js index 1a55ce2f..32f70039 100644 --- a/src/main/crossover.js +++ b/src/main/crossover.js @@ -347,17 +347,22 @@ const syncSettings = ( options = preferences.preferences ) => { '--circle-thickness': options.crosshair.circleThickness, } - // App color is set + // App colors — highlight only applies when bg is also set; resetting bg resets highlight too - if ( options.app.appHighlightColor.charAt( 0 ) === '#' ) { + if ( options.app.appBgColor.charAt( 0 ) === '#' ) { - properties['--app-highlight-color'] = options.app.appHighlightColor + properties['--app-bg-color'] = hexToRgbA( options.app.appBgColor, APP_BACKGROUND_OPACITY ) - } + if ( options.app.appHighlightColor.charAt( 0 ) === '#' ) { - if ( options.app.appBgColor.charAt( 0 ) === '#' ) { + properties['--app-highlight-color'] = options.app.appHighlightColor - properties['--app-bg-color'] = hexToRgbA( options.app.appBgColor, APP_BACKGROUND_OPACITY ) + } + + } else if ( options.app.appHighlightColor !== 'unset' ) { + + // bg was reset to default — clear orphaned highlight color so buttons stay visible + preferences.value( 'app.appHighlightColor', 'unset' ) }