summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-17 17:07:49 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-17 20:49:59 +0100
commitb5c22a9371e22162ff7305ffaa393ed908eee610 (patch)
tree9d17e3b7197315efba01b3ea75761c47ff815cfa /sc/source/ui
parentc3c526e0192b9cf429d326b129ce9e94ec9e346b (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/view/gridwin.cxx11
1 files changed, 8 insertions, 3 deletions
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);