center the filter checkbox like the normal one
Change-Id: I7954430640fe9788c650f5fe7b103426731204cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99716 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -2630,8 +2630,17 @@ void DbFilterField::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect)
|
||||
switch (m_nControlClass)
|
||||
{
|
||||
case FormComponentType::CHECKBOX:
|
||||
DbCellControl::PaintCell( rDev, rRect );
|
||||
{
|
||||
// center the checkbox within the space available
|
||||
CheckBoxControl* pControl = static_cast<CheckBoxControl*>(m_pPainter.get());
|
||||
Size aBoxSize = pControl->GetBox().get_preferred_size();
|
||||
tools::Rectangle aRect(Point(rRect.Left() + ((rRect.GetWidth() - aBoxSize.Width()) / 2),
|
||||
rRect.Top() + ((rRect.GetHeight() - aBoxSize.Height()) / 2)),
|
||||
aBoxSize);
|
||||
|
||||
DbCellControl::PaintCell(rDev, aRect);
|
||||
break;
|
||||
}
|
||||
case FormComponentType::LISTBOX:
|
||||
rDev.DrawText(rRect, static_cast<ListBoxControl*>(m_pWindow.get())->get_widget().get_active_text(), nStyle);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user