[Libreoffice-commits] core.git: cui/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 18 20:30:39 UTC 2019
cui/source/customize/SvxMenuConfigPage.cxx | 18 ++++++++++++++++--
cui/source/customize/SvxToolbarConfigPage.cxx | 20 ++++++++++++++++++--
2 files changed, 34 insertions(+), 4 deletions(-)
New commits:
commit 592ec4b9949818944a471a6d0efe821605957f29
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Apr 18 16:10:44 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Apr 18 22:28:54 2019 +0200
Related: tdf#124809 cannot assume that icon size is same as checkbox size
cause can be using large icon size
Change-Id: I4661199b658ff0d2013a7bbd7159b1c134ade043
Reviewed-on: https://gerrit.libreoffice.org/70942
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index f87cbd085906..b92a3d3121db 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -165,9 +165,23 @@ IMPL_LINK(SvxMenuConfigPage, MenuEntriesSizeAllocHdl, const Size&, rSize, void)
{
weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
std::vector<int> aWidths;
- int nImageColWidth = rTreeView.get_checkbox_column_width();
+
+ int nExpectedSize = 16;
+
+ int nStandardImageColWidth = rTreeView.get_checkbox_column_width();
+ int nMargin = nStandardImageColWidth - nExpectedSize;
+ if (nMargin < 16)
+ nMargin = 16;
+
+ if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_LARGE)
+ nExpectedSize = 24;
+ else if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_32)
+ nExpectedSize = 32;
+
+ int nImageColWidth = nExpectedSize + nMargin;
+
aWidths.push_back(nImageColWidth);
- aWidths.push_back(rSize.Width() - 2 * nImageColWidth);
+ aWidths.push_back(rSize.Width() - (nImageColWidth + nStandardImageColWidth));
rTreeView.set_column_fixed_widths(aWidths);
}
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index 046a3d84b315..49b693f91cae 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -104,9 +104,25 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(TabPageParent pParent, const SfxItemS
weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
Size aSize(m_xFunctions->get_size_request());
rTreeView.set_size_request(aSize.Width(), aSize.Height());
- aWidths.push_back(rTreeView.get_checkbox_column_width());
- aWidths.push_back(rTreeView.get_checkbox_column_width());
+
+ int nExpectedSize = 16;
+
+ int nStandardImageColWidth = rTreeView.get_checkbox_column_width();
+ int nMargin = nStandardImageColWidth - nExpectedSize;
+ if (nMargin < 16)
+ nMargin = 16;
+
+ if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_LARGE)
+ nExpectedSize = 24;
+ else if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_32)
+ nExpectedSize = 32;
+
+ int nImageColWidth = nExpectedSize + nMargin;
+
+ aWidths.push_back(nStandardImageColWidth);
+ aWidths.push_back(nImageColWidth);
rTreeView.set_column_fixed_widths(aWidths);
+
rTreeView.set_hexpand(true);
rTreeView.set_vexpand(true);
rTreeView.set_help_id( HID_SVX_CONFIG_TOOLBAR_CONTENTS );
More information about the Libreoffice-commits
mailing list