include/vcl/settings.hxx | 1 + vcl/source/app/settings.cxx | 14 ++++++++++++++ vcl/source/window/menu.cxx | 6 ++++-- 3 files changed, 19 insertions(+), 2 deletions(-)
New commits: commit 5b01ad53aba40956a164500c4267990f7d2d8dd7 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Tue May 11 09:28:12 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Tue May 11 10:28:32 2021 +0200 tdf#76258 Use correct icon size for color filter popup colors Change-Id: Icda5ee2cc4c02d6da5cc3f45c30416ad503eaa20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115378 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 3130f22ed205..0159e08fb7a4 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -536,6 +536,7 @@ public: void SetToolbarIconSize( ToolbarIconSize nSize ); ToolbarIconSize GetToolbarIconSize() const; + Size GetToolbarIconSizePixel() const; /** Set the icon theme to use. */ void SetIconTheme(const OUString&); diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 423e3eed679c..0e64a4269e35 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2070,6 +2070,20 @@ StyleSettings::GetToolbarIconSize() const return mxData->mnToolbarIconSize; } +Size StyleSettings::GetToolbarIconSizePixel() const +{ + switch (GetToolbarIconSize()) + { + case ToolbarIconSize::Large: + return Size(24, 24); + case ToolbarIconSize::Size32: + return Size(32, 32); + case ToolbarIconSize::Small: + default: + return Size(16, 16); + } +} + const DialogStyle& StyleSettings::GetDialogStyle() const { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 128bc4bbcbd1..8f4019dd9d52 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1025,10 +1025,12 @@ OUString Menu::GetItemText( sal_uInt16 nItemId ) const void Menu::SetItemColor(sal_uInt16 nItemId, const Color& rColor) { - Bitmap aBmp(Size(50, 50), vcl::PixelFormat::N24_BPP); + StyleSettings aSettings = Application::GetSettings().GetStyleSettings(); + auto iconSize = aSettings.GetToolbarIconSizePixel(); + Bitmap aBmp(iconSize, vcl::PixelFormat::N24_BPP); BitmapWriteAccess aBmpAccess(aBmp); aBmpAccess.SetFillColor(rColor); - aBmpAccess.FillRect(tools::Rectangle(0, 0, 49, 49)); + aBmpAccess.FillRect(tools::Rectangle(0, 0, iconSize.Width() - 1, iconSize.Height() - 1)); BitmapEx aBmpEx(aBmp); Image aImage(aBmpEx); SetItemImage(nItemId, aImage); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits