Determine correct checkbox size when using theme.
This commit is contained in:
@@ -1152,9 +1152,7 @@ bool wxDataViewToggleRenderer::WXActivateCell(const wxRect& WXUNUSED(cellRect),
|
|||||||
|
|
||||||
wxSize wxDataViewToggleRenderer::GetSize() const
|
wxSize wxDataViewToggleRenderer::GetSize() const
|
||||||
{
|
{
|
||||||
// the window parameter is not used by GetCheckBoxSize() so it's
|
return wxRendererNative::Get().GetCheckBoxSize(GetView());
|
||||||
// safe to pass NULL
|
|
||||||
return wxRendererNative::Get().GetCheckBoxSize(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
|
@@ -712,9 +712,9 @@ wxRendererGeneric::DrawCheckBox(wxWindow *WXUNUSED(win),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxRendererGeneric::GetCheckBoxSize(wxWindow *WXUNUSED(win))
|
wxSize wxRendererGeneric::GetCheckBoxSize(wxWindow *win)
|
||||||
{
|
{
|
||||||
return wxSize(16, 16);
|
return win->FromDIP(wxSize(16, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -327,6 +327,8 @@ public:
|
|||||||
wxTitleBarButton button,
|
wxTitleBarButton button,
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
|
||||||
|
virtual wxSize GetCheckBoxSize(wxWindow *win);
|
||||||
|
|
||||||
virtual void DrawGauge(wxWindow* win,
|
virtual void DrawGauge(wxWindow* win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -902,6 +904,21 @@ wxRendererXP::DrawTitleBarBitmap(wxWindow *win,
|
|||||||
DoDrawButtonLike(hTheme, part, dc, rect, flags);
|
DoDrawButtonLike(hTheme, part, dc, rect, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxRendererXP::GetCheckBoxSize(wxWindow* win)
|
||||||
|
{
|
||||||
|
wxUxThemeHandle hTheme(win, L"BUTTON");
|
||||||
|
wxUxThemeEngine* const te = wxUxThemeEngine::Get();
|
||||||
|
|
||||||
|
if (te->IsThemePartDefined(hTheme, BP_CHECKBOX, 0))
|
||||||
|
{
|
||||||
|
SIZE checkSize;
|
||||||
|
te->GetThemePartSize(hTheme, NULL, BP_CHECKBOX, CBS_UNCHECKEDNORMAL, NULL, TS_DRAW, &checkSize);
|
||||||
|
return wxSize(checkSize.cx, checkSize.cy);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return m_rendererNative.GetCheckBoxSize(win);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
wxRendererXP::DrawCollapseButton(wxWindow *win,
|
wxRendererXP::DrawCollapseButton(wxWindow *win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
|
Reference in New Issue
Block a user