Skip to content

Commit da33d71

Browse files
author
Nikolaos Protopapas
committed
feat: unfocused highlight for TreeControl selected item
1 parent f5ae5b2 commit da33d71

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

SharpConsoleUI/Controls/TreeControl/TreeControl.Rendering.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ public override void PaintDOM(CharacterBuffer buffer, LayoutRect bounds, LayoutR
235235
textColor = HighlightForegroundColor;
236236
nodeBgColor = selectionBg;
237237
}
238+
else if (i == selectedIndex && !HasFocus)
239+
{
240+
// Unfocused highlight - dimmer version of selection
241+
var theme = Container?.GetConsoleWindowSystem?.Theme;
242+
textColor = theme?.ListUnfocusedHighlightForegroundColor ?? Color.Grey;
243+
nodeBgColor = theme?.ListUnfocusedHighlightBackgroundColor ?? Color.Grey23;
244+
}
238245
else
239246
{
240247
textColor = node.TextColor ?? fgColor;

0 commit comments

Comments
 (0)