From bfce5f8a683f9894f676f68f0e79327c8016cd13 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Wed, 13 Nov 2024 18:32:21 +0000 Subject: [PATCH] fix: highlight current branch in git log pane --- CHANGELOG.md | 1 + generateFlavours/main.ts | 20 ++++++++++++++++++-- generateFlavours/ui.theme.json | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3a4a22..a443fff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - (UI): Removed macOS scrollbar turning yellow on hover. I'm sorry to anyone who liked this behaviour, but it was not supposed to exist in the first place. - (Editor): Search results now show up beside the scrollbar as `blue`. +- (UI): Highlight current branch in git log pane. ### Security diff --git a/generateFlavours/main.ts b/generateFlavours/main.ts index c1b579e..1c69ab5 100755 --- a/generateFlavours/main.ts +++ b/generateFlavours/main.ts @@ -36,7 +36,7 @@ const handlebarsOpacityWithHex = ( return calculateOpacity(color, opacity, context) } -const handlebarsMix = ( +const mix = ( color1: string, color2: string, amount: number, @@ -44,7 +44,22 @@ const handlebarsMix = ( return colormath .mixColor(colormath.hex.toRgb(color1), colormath.hex.toRgb(color2), amount) .hex.toLowerCase() - .replace("#", ""); +}; + +const handlebarsMix = ( + color1: string, + color2: string, + amount: number, +): string => { + return mix(color1, color2, amount).replace("#", ""); +}; + +const handlebarsMixWithHex = ( + color1: string, + color2: string, + amount: number, +): string => { + return mix(color1, color2, amount) }; const capitalize = (str: string): string => { @@ -55,6 +70,7 @@ Handlebars.registerHelper("isLatte", handlebarsIsLatte); Handlebars.registerHelper("opacity", handlebarsOpacity); Handlebars.registerHelper("opacityWithHex", handlebarsOpacityWithHex); Handlebars.registerHelper("mix", handlebarsMix); +Handlebars.registerHelper("mixWithHex", handlebarsMixWithHex); const __dirname = path.dirname(path.fromFileUrl(import.meta.url)); const themePath = path.join(__dirname, "../src/main/resources/themes/"); diff --git a/generateFlavours/ui.theme.json b/generateFlavours/ui.theme.json index 5c506a2..12b8d60 100644 --- a/generateFlavours/ui.theme.json +++ b/generateFlavours/ui.theme.json @@ -472,9 +472,9 @@ }, "Log": { "Commit": { - "currentBranchBackground": "panelBackground", + "currentBranchBackground": "{{mixWithHex mauve mantle 0.05}}", "hoveredBackground": "hoverBackground", - "selectionInactiveBackground": "selectionInactiveBackground" + "selectionInactiveBackground": "hoverBackground" } }, "RefLabel": {