Skip to content

Commit

Permalink
Fix #9 missing checkboxes in Configure Columns window
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Łaputa authored and Krzysztof Łaputa committed Jul 1, 2019
1 parent e4ff229 commit d005f7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions KeeTheme/Decorators/ListViewDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Windows.Forms;
using KeePass;
using KeeTheme.Theme;
using CheckBoxState = System.Windows.Forms.VisualStyles.CheckBoxState;

namespace KeeTheme.Decorators
{
Expand Down Expand Up @@ -252,6 +253,16 @@ private void HandleListViewDrawSubItem(object sender, DrawListViewSubItemEventAr
text = text.Remove(0, 1);
}

var listView = (ListView)sender;
if (listView.CheckBoxes && e.ColumnIndex == 0)
{
var state = e.Item.Checked ? CheckBoxState.CheckedNormal : CheckBoxState.UncheckedNormal;
CheckBoxRenderer.DrawCheckBox(e.Graphics, new Point(e.Bounds.X + 4, e.Bounds.Y + 1), state);

textBounds.Inflate(-CheckBoxRenderer.GetGlyphSize(e.Graphics, state).Width - 4 - 2, 0);
text = text.Remove(0, 1);
}

TextRenderer.DrawText(e.Graphics, text, font, textBounds, color, flags);

using (var pen = new Pen(_theme.ListView.ColumnBorderColor))
Expand Down
4 changes: 2 additions & 2 deletions KeeTheme/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.2.0")]
[assembly: AssemblyFileVersion("0.5.2.0")]
[assembly: AssemblyVersion("0.5.3.0")]
[assembly: AssemblyFileVersion("0.5.3.0")]

0 comments on commit d005f7e

Please sign in to comment.