Skip to content

Commit

Permalink
Fixes an issue with checkbox label sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Carson-Shook committed Dec 14, 2021
1 parent 5d3f5a3 commit 6b2e953
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Controls/Checkbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bool Controls::Checkbox::Create()
int finalWidth = 0;
int finalHeight = 0;

int checkboxWidth = GetCheckboxWidth();
int checkboxWidth = GetCheckboxWidth() + (GetCheckboxBorderWidth() * 2);

if (AutoSize)
{
Expand Down Expand Up @@ -63,3 +63,8 @@ int Controls::Checkbox::GetCheckboxWidth()
// Will return 0 if not found
return GetSystemMetrics(SM_CXMENUCHECK);
}

int Controls::Checkbox::GetCheckboxBorderWidth()
{
return GetSystemMetrics(SM_CXEDGE);
}
1 change: 1 addition & 0 deletions Controls/Checkbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ namespace Controls
Checkbox();
Checkbox(HWND hWnd, UINT_PTR id, HINSTANCE hInstance);
int GetCheckboxWidth();
int GetCheckboxBorderWidth();
};
}

0 comments on commit 6b2e953

Please sign in to comment.