42
42
using System . Drawing ;
43
43
44
44
using Couchcoding . Logbert . Logging . Filter ;
45
- using Couchcoding . Logbert . Theme . Palettes ;
46
45
using Couchcoding . Logbert . Theme . Interfaces ;
47
46
using Couchcoding . Logbert . Theme ;
48
47
using Couchcoding . Logbert . Theme . Themes ;
@@ -160,7 +159,7 @@ private static void PopulateTreeView(TreeView treeView, string path)
160
159
161
160
if ( lastNode . Parent != null )
162
161
{
163
- lastNode . ForeColor = ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForeground ;
162
+ lastNode . ForeColor = ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForegroundDimmed ;
164
163
lastNode . Parent . Expand ( ) ;
165
164
}
166
165
}
@@ -178,11 +177,13 @@ private static void PopulateTreeView(TreeView treeView, string path)
178
177
treeView . SelectedNode = treeView . Nodes [ 0 ] ;
179
178
}
180
179
181
- SetNodeColor ( treeView . Nodes [ 0 ]
182
- , ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForeground
183
- , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForeground
184
- , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForegroundFocused
185
- , false ) ;
180
+ //ReColorNodes(treeView.Nodes[0], treeView.SelectedNode, false);
181
+
182
+ //SetNodeColor(treeView.Nodes[0]
183
+ // , ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForeground
184
+ // , ThemeManager.CurrentApplicationTheme.ColorPalette.SelectionForeground
185
+ // , ThemeManager.CurrentApplicationTheme.ColorPalette.SelectionForegroundFocused
186
+ // , false);
186
187
}
187
188
}
188
189
@@ -223,6 +224,24 @@ private static void SetNodeColor(TreeNode startNode, Color nodeColor, Color node
223
224
}
224
225
}
225
226
227
+ private static void ReColorNodes ( TreeNode rootNode , TreeNode node , bool recursive )
228
+ {
229
+ SetNodeColor ( rootNode
230
+ , ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForegroundDimmed
231
+ , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForeground
232
+ , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForegroundFocused
233
+ , true ) ;
234
+
235
+ if ( node != null )
236
+ {
237
+ SetNodeColor ( node
238
+ , ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForeground
239
+ , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForeground
240
+ , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForegroundFocused
241
+ , recursive ) ;
242
+ }
243
+ }
244
+
226
245
private void TvLoggerTreeAfterSelect ( object sender , TreeViewEventArgs e )
227
246
{
228
247
if ( tvLoggerTree . Nodes . Count == 0 )
@@ -232,20 +251,7 @@ private void TvLoggerTreeAfterSelect(object sender, TreeViewEventArgs e)
232
251
233
252
try
234
253
{
235
- SetNodeColor ( tvLoggerTree . Nodes [ 0 ]
236
- , ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForegroundDimmed
237
- , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForeground
238
- , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForegroundFocused
239
- , true ) ;
240
-
241
- if ( e . Node != null )
242
- {
243
- SetNodeColor ( e . Node
244
- , ThemeManager . CurrentApplicationTheme . ColorPalette . ContentForeground
245
- , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForeground
246
- , ThemeManager . CurrentApplicationTheme . ColorPalette . SelectionForegroundFocused
247
- , tsbFilterRecursive . Checked ) ;
248
- }
254
+ ReColorNodes ( tvLoggerTree . Nodes [ 0 ] , e . Node , tsbFilterRecursive . Checked ) ;
249
255
}
250
256
finally
251
257
{
@@ -366,6 +372,10 @@ public void LogMessagesChanged(List<LogMessage> messages, int delta)
366
372
finally
367
373
{
368
374
tvLoggerTree . AfterSelect += TvLoggerTreeAfterSelect ;
375
+
376
+ ReColorNodes ( tvLoggerTree . Nodes [ 0 ]
377
+ , tvLoggerTree . SelectedNode
378
+ , tsbFilterRecursive . Checked ) ;
369
379
}
370
380
}
371
381
@@ -486,15 +496,12 @@ private void DrawPlusMinus(DrawTreeNodeEventArgs e)
486
496
return ;
487
497
}
488
498
489
- int indent = ( e . Node . Level * tvLoggerTree . Indent ) + tvLoggerTree . Margin . Size . Width ;
490
- int iconLeft = indent + tvLoggerTree . Indent ;
491
-
492
499
Image img = e . Node . IsExpanded
493
500
? ThemeManager . CurrentApplicationTheme . Resources . Images [ "FrmLogTreeNodeExpanded" ]
494
501
: ThemeManager . CurrentApplicationTheme . Resources . Images [ "FrmLogTreeNodeCollapsed" ] ;
495
502
496
503
e . Graphics . DrawImage ( img
497
- , iconLeft - img . Width - 2
504
+ , e . Node . Bounds . X - img . Width - 2
498
505
, ( e . Bounds . Y + ( e . Bounds . Height >> 1 ) ) - ( img . Height >> 1 ) - 1 ) ;
499
506
}
500
507
0 commit comments