Skip to content

Commit

Permalink
fix: highlight current branch in git log pane (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham authored Nov 13, 2024
1 parent e057003 commit 14cffe1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 18 additions & 2 deletions generateFlavours/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,30 @@ const handlebarsOpacityWithHex = (
return calculateOpacity(color, opacity, context)
}

const handlebarsMix = (
const mix = (
color1: string,
color2: string,
amount: number,
): string => {
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 => {
Expand All @@ -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/");
Expand Down
4 changes: 2 additions & 2 deletions generateFlavours/ui.theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,9 @@
},
"Log": {
"Commit": {
"currentBranchBackground": "panelBackground",
"currentBranchBackground": "{{mixWithHex mauve mantle 0.05}}",
"hoveredBackground": "hoverBackground",
"selectionInactiveBackground": "selectionInactiveBackground"
"selectionInactiveBackground": "hoverBackground"
}
},
"RefLabel": {
Expand Down

0 comments on commit 14cffe1

Please sign in to comment.