From 250818561f3efb260795ed291a5095040dacfc46 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 18 Aug 2025 12:11:43 +0200 Subject: [PATCH] make active segment more visible #2521 --- src/renderer/src/TimelineSeg.tsx | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/TimelineSeg.tsx b/src/renderer/src/TimelineSeg.tsx index 351485a9..bba43da9 100644 --- a/src/renderer/src/TimelineSeg.tsx +++ b/src/renderer/src/TimelineSeg.tsx @@ -95,9 +95,23 @@ function Segment({ const { darkMode } = useUserSettings(); const { name } = seg; - const vertBorder = useMemo(() => { - if (!isActive) return '2px solid transparent'; - return `1.5px solid ${darkMode ? color.desaturate(0.1).lightness(70).string() : color.desaturate(0.2).lightness(40).string()}`; + const border = useMemo(() => { + const horizontalBorderWidth = '1px'; + const verticalBorderWidth = '1.5px'; + + if (!isActive) { + const horizontalColor = darkMode ? color.desaturate(0.1).lightness(60) : color.desaturate(0.2).lightness(40); + const verticalColor = darkMode ? color.desaturate(0.1).lightness(90) : color.desaturate(0.2).lightness(10); + return { + horizontal: `${horizontalBorderWidth} solid ${horizontalColor.string()}`, + vertical: `${verticalBorderWidth} solid ${verticalColor.string()}`, + }; + } + + return { + horizontal: `${horizontalBorderWidth} solid transparent`, + vertical: `${verticalBorderWidth} solid transparent`, + }; }, [darkMode, isActive, color]); const backgroundColor = useMemo(() => { @@ -134,15 +148,18 @@ function Segment({ color: 'white', overflow: 'hidden', - borderLeft: vertBorder, + borderLeft: border.vertical, borderTopLeftRadius: vertBorderRadius, borderBottomLeftRadius: vertBorderRadius, - borderRight: vertBorder, + borderRight: border.vertical, borderTopRightRadius: vertBorderRadius, borderBottomRightRadius: vertBorderRadius, + + borderTop: border.horizontal, + borderBottom: border.horizontal, }; - }, [getTimePercent, seg.end, seg.start, vertBorder]); + }, [getTimePercent, seg.end, seg.start, border]); return (