From dc0a3787291f8f86e9fcedcd22d695b4fb3e1c15 Mon Sep 17 00:00:00 2001 From: tznind Date: Tue, 15 Dec 2020 09:59:54 +0000 Subject: [PATCH] Changed selection rendering to cover whole row --- Terminal.Gui/Views/TreeView.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Terminal.Gui/Views/TreeView.cs b/Terminal.Gui/Views/TreeView.cs index 8d95e067e..4160db3f2 100644 --- a/Terminal.Gui/Views/TreeView.cs +++ b/Terminal.Gui/Views/TreeView.cs @@ -719,6 +719,10 @@ namespace Terminal.Gui { /// public virtual void Draw(ConsoleDriver driver,ColorScheme colorScheme, int y, int availableWidth) { + driver.SetAttribute(tree.SelectedObject == Model ? + colorScheme.HotFocus : + colorScheme.Normal); + // Everything on line before the expansion run and branch text Rune[] prefix = GetLinePrefix(driver).ToArray(); Rune expansion = GetExpandableIcon(driver); @@ -728,23 +732,17 @@ namespace Terminal.Gui { tree.Move(0,y); - driver.SetAttribute(colorScheme.Normal); - foreach(Rune r in prefix) driver.AddRune(r); driver.AddRune(expansion); - driver.SetAttribute(tree.SelectedObject == Model ? - colorScheme.HotFocus : - colorScheme.Normal); - driver.AddStr(lineBody); - driver.SetAttribute(colorScheme.Normal); - if(remainingWidth > 0) driver.AddStr(new string(' ',remainingWidth)); + + driver.SetAttribute(colorScheme.Normal); } ///