Skip to content

Commit 1b88c91

Browse files
committed
Fixed some drawing issues in controls
1 parent cfb6409 commit 1b88c91

File tree

10 files changed

+52
-44
lines changed

10 files changed

+52
-44
lines changed

src/Couchcoding.Logbert.Gui/Controls/TreeViewEx.cs

-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ public void UseNativeSystemRendering(bool value)
163163
{
164164
CreateHandle();
165165
}
166-
167-
//Win32.SetWindowTheme(Handle, "Explorer", null);
168166
}
169167
}
170168

src/Couchcoding.Logbert.Gui/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("Couchcoding")]
1111
[assembly: AssemblyProduct("Logbert Control Library")]
12-
[assembly: AssemblyCopyright("Copyright © 2021 Couchcoding")]
12+
[assembly: AssemblyCopyright("Copyright © 2022 Couchcoding")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.6.3.1")]
35-
[assembly: AssemblyFileVersion("1.6.3.1")]
34+
[assembly: AssemblyVersion("1.6.3.2")]
35+
[assembly: AssemblyFileVersion("1.6.3.2")]

src/Couchcoding.Logbert.Theme/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("Couchcoding")]
1111
[assembly: AssemblyProduct("Logbert Theme Library")]
12-
[assembly: AssemblyCopyright("Copyright © 2021 Couchcoding")]
12+
[assembly: AssemblyCopyright("Copyright © 2022 Couchcoding")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.6.3.1")]
35-
[assembly: AssemblyFileVersion("1.6.3.1")]
34+
[assembly: AssemblyVersion("1.6.3.2")]
35+
[assembly: AssemblyFileVersion("1.6.3.2")]

src/Logbert/Dialogs/Docking/FrmLogTree.cs

+32-25
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
using System.Drawing;
4343

4444
using Couchcoding.Logbert.Logging.Filter;
45-
using Couchcoding.Logbert.Theme.Palettes;
4645
using Couchcoding.Logbert.Theme.Interfaces;
4746
using Couchcoding.Logbert.Theme;
4847
using Couchcoding.Logbert.Theme.Themes;
@@ -160,7 +159,7 @@ private static void PopulateTreeView(TreeView treeView, string path)
160159

161160
if (lastNode.Parent != null)
162161
{
163-
lastNode.ForeColor = ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForeground;
162+
lastNode.ForeColor = ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForegroundDimmed;
164163
lastNode.Parent.Expand();
165164
}
166165
}
@@ -178,11 +177,13 @@ private static void PopulateTreeView(TreeView treeView, string path)
178177
treeView.SelectedNode = treeView.Nodes[0];
179178
}
180179

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);
186187
}
187188
}
188189

@@ -223,6 +224,24 @@ private static void SetNodeColor(TreeNode startNode, Color nodeColor, Color node
223224
}
224225
}
225226

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+
226245
private void TvLoggerTreeAfterSelect(object sender, TreeViewEventArgs e)
227246
{
228247
if (tvLoggerTree.Nodes.Count == 0)
@@ -232,20 +251,7 @@ private void TvLoggerTreeAfterSelect(object sender, TreeViewEventArgs e)
232251

233252
try
234253
{
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);
249255
}
250256
finally
251257
{
@@ -366,6 +372,10 @@ public void LogMessagesChanged(List<LogMessage> messages, int delta)
366372
finally
367373
{
368374
tvLoggerTree.AfterSelect += TvLoggerTreeAfterSelect;
375+
376+
ReColorNodes(tvLoggerTree.Nodes[0]
377+
, tvLoggerTree.SelectedNode
378+
, tsbFilterRecursive.Checked);
369379
}
370380
}
371381

@@ -486,15 +496,12 @@ private void DrawPlusMinus(DrawTreeNodeEventArgs e)
486496
return;
487497
}
488498

489-
int indent = (e.Node.Level * tvLoggerTree.Indent) + tvLoggerTree.Margin.Size.Width;
490-
int iconLeft = indent + tvLoggerTree.Indent;
491-
492499
Image img = e.Node.IsExpanded
493500
? ThemeManager.CurrentApplicationTheme.Resources.Images["FrmLogTreeNodeExpanded"]
494501
: ThemeManager.CurrentApplicationTheme.Resources.Images["FrmLogTreeNodeCollapsed"];
495502

496503
e.Graphics.DrawImage(img
497-
, iconLeft - img.Width - 2
504+
, e.Node.Bounds.X - img.Width - 2
498505
, (e.Bounds.Y + (e.Bounds.Height >> 1)) - (img.Height >> 1) - 1);
499506
}
500507

src/Logbert/Dialogs/FrmAbout.resx

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<data name="txtLicense.Text" xml:space="preserve">
121121
<value>The MIT License (MIT)
122122

123-
Copyright (c) 2021 Couchcoding
123+
Copyright (c) 2022 Couchcoding
124124

125125
Permission is hereby granted, free of charge, to any person obtaining a copy
126126
of this software and associated documentation files (the "Software"), to deal
@@ -140,4 +140,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
140140
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
141141
SOFTWARE.</value>
142142
</data>
143-
</root>
143+
</root>

src/Logbert/Dialogs/FrmOptions.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ private void LstSettingsSelectedIndexChanged(object sender, System.EventArgs e)
9595
{
9696
// Show the new option panel control.
9797
pnlOptionPanel.Controls.Add((Control)lstSettings.SelectedItem);
98-
pnlOptionPanel.AutoScrollMinSize = pnlOptionPanel.Controls[0].MinimumSize;
99-
grpSettings.Text = ((IOptionPanel)lstSettings.SelectedItem).PanelName;
100-
grpSettings.GroupImage = ((IOptionPanel)lstSettings.SelectedItem).Image;
98+
99+
pnlOptionPanel.AutoScrollMinSize = pnlOptionPanel.Controls[0].MinimumSize;
100+
pnlOptionPanel.AutoScrollPosition = new Point(0, 0);
101+
grpSettings.Text = ((IOptionPanel)lstSettings.SelectedItem).PanelName;
102+
grpSettings.GroupImage = ((IOptionPanel)lstSettings.SelectedItem).Image;
101103

102104
// Initialize the new option panel control.
103105
((IOptionPanel)lstSettings.SelectedItem).AdjustSizeAndLocation(grpSettings);

src/Logbert/Logbert.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@
573573
</EmbeddedResource>
574574
<EmbeddedResource Include="Dialogs\FrmAbout.resx">
575575
<DependentUpon>FrmAbout.cs</DependentUpon>
576+
<SubType>Designer</SubType>
576577
</EmbeddedResource>
577578
<EmbeddedResource Include="Dialogs\FrmNew.resx">
578579
<DependentUpon>FrmNew.cs</DependentUpon>

src/Logbert/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("Couchcoding")]
1212
[assembly: AssemblyProduct("Logbert")]
13-
[assembly: AssemblyCopyright("Copyright © 2021 Couchcoding")]
13+
[assembly: AssemblyCopyright("Copyright © 2022 Couchcoding")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -29,6 +29,6 @@
2929
// Build Number
3030
// Revision
3131
//
32-
[assembly: AssemblyVersion("1.6.3.1")]
33-
[assembly: AssemblyFileVersion("1.6.3.1")]
32+
[assembly: AssemblyVersion("1.6.3.2")]
33+
[assembly: AssemblyFileVersion("1.6.3.2")]
3434
[assembly: NeutralResourcesLanguageAttribute("")]

src/Logbert/Properties/Resources.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Logbert/Properties/Resources.resx

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<value>..\Resources\action_add_16xMD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126126
</data>
127127
<data name="strAboutDlgCopyright" xml:space="preserve">
128-
<value>Copyright 2021 Couchcoding. All Right Reserved.</value>
128+
<value>Copyright 2022 Couchcoding. All Right Reserved.</value>
129129
</data>
130130
<data name="strColumnizerConfigurationEnterColumnNameAndExpression" xml:space="preserve">
131131
<value>Please enter a name and an expression for each configure column.</value>

0 commit comments

Comments
 (0)