summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/FontFeaturesDialog.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-01 16:56:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-01 22:00:33 +0200
commit6e09d59a503e98f97dea406bb3c2c703edf92d8e (patch)
tree1c7605ffbfa20c6c8160d1a3b5a33585e8e3db54 /cui/source/dialogs/FontFeaturesDialog.cxx
parent4258f091f06116f4661eb6a1e6206eafcba7866f (diff)
tdf#141333 use a vertical step increment of one row height
for font feature scrolled window Change-Id: I000d53af7128377930644591a096c94366da281b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113465 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/dialogs/FontFeaturesDialog.cxx')
-rw-r--r--cui/source/dialogs/FontFeaturesDialog.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx
index fae448b6a283..04255cb13a6b 100644
--- a/cui/source/dialogs/FontFeaturesDialog.cxx
+++ b/cui/source/dialogs/FontFeaturesDialog.cxx
@@ -73,18 +73,26 @@ void FontFeaturesDialog::initialize()
rFilteredFontFeatures.push_back(rFontFeature);
}
- fillGrid(rFilteredFontFeatures);
+ int nRowHeight = fillGrid(rFilteredFontFeatures);
m_xContentWindow->set_size_request(
-1, std::min(std::max(m_xContentWindow->get_preferred_size().Height(),
m_xContentGrid->get_preferred_size().Height()),
static_cast<tools::Long>(300L)));
+ if (nRowHeight)
+ {
+ // tdf#141333 use row height + the 6 px spacing of contentGrid
+ m_xContentWindow->vadjustment_set_step_increment(nRowHeight + 6);
+ }
+
updateFontPreview();
}
-void FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures)
+int FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures)
{
+ int nRowHeight(0);
+
vcl::font::FeatureParser aParser(m_sFontName);
auto aExistingFeatures = aParser.getFeaturesMap();
@@ -140,8 +148,13 @@ void FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFe
aCurrentItem.m_xCheck->show();
}
+ nRowHeight
+ = std::max<int>(nRowHeight, aCurrentItem.m_xContainer->get_preferred_size().Height());
+
i++;
}
+
+ return nRowHeight;
}
void FontFeaturesDialog::updateFontPreview()