sc/source/ui/view/gridwin.cxx | 11 ++++++++--- svx/source/tbxctrls/tbcontrl.cxx | 1 + 2 files changed, 9 insertions(+), 3 deletions(-)
New commits: commit b5c22a9371e22162ff7305ffaa393ed908eee610 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 17 17:07:49 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Nov 17 20:49:59 2021 +0100 use ListBoxPreview size for the color shown in autofilter color list it's used for a similar case in the color button, GetToolbarIconSizePixel is relatively narrow and we have a hectare of space available here. Draw a border around the color as we do for the similar color button case. Change-Id: If0b24a142d47038d02a977ed88281b2de0b529fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125418 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 3530e9d69d5a..acd2973075c1 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -950,10 +950,15 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) } else { + // ColorListBox::ShowPreview is similar ScopedVclPtr<VirtualDevice> xDev(pPopupParent->create_virtual_device()); - xDev->SetOutputSize(Application::GetSettings().GetStyleSettings().GetToolbarIconSizePixel()); - xDev->SetBackground(rColor); - xDev->Erase(); + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + Size aImageSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize()); + xDev->SetOutputSize(aImageSize); + const tools::Rectangle aRect(Point(0, 0), aImageSize); + xDev->SetFillColor(rColor); + xDev->SetLineColor(rStyleSettings.GetDisableColor()); + xDev->DrawRect(aRect); xColorMenu->insert(-1, OUString::number(i), OUString(), nullptr, xDev.get(), nullptr, TRISTATE_TRUE); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5a1239bdea77..04ae3e0ec4fa 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4021,6 +4021,7 @@ void ColorListBox::LockWidthRequest() void ColorListBox::ShowPreview(const NamedColor &rColor) { + // ScGridWindow::UpdateAutoFilterFromMenu is similar const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); Size aImageSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize());