summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-18 16:10:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-18 22:28:54 +0200
commit592ec4b9949818944a471a6d0efe821605957f29 (patch)
tree5160ac1d25aa88922bca6c300b332f1097985cbe /cui
parentc9956772ec0678498515fb60dca41e9a77457f86 (diff)
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@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx18
-rw-r--r--cui/source/customize/SvxToolbarConfigPage.cxx20
2 files changed, 34 insertions, 4 deletions
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 );