summaryrefslogtreecommitdiff
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
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>
-rw-r--r--cui/source/dialogs/FontFeaturesDialog.cxx17
-rw-r--r--cui/source/inc/FontFeaturesDialog.hxx3
-rw-r--r--cui/uiconfig/ui/fontfeaturesdialog.ui1
-rw-r--r--cui/uiconfig/ui/fontfragment.ui2
4 files changed, 19 insertions, 4 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()
diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx
index 6fd8b9de037e..337014bd8c0d 100644
--- a/cui/source/inc/FontFeaturesDialog.hxx
+++ b/cui/source/inc/FontFeaturesDialog.hxx
@@ -55,7 +55,8 @@ private:
void initialize();
OUString createFontNameWithFeatures();
- void fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures);
+ // returns the max height of a row
+ int fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures);
DECL_LINK(ComboBoxSelectedHdl, weld::ComboBox&, void);
DECL_LINK(CheckBoxToggledHdl, weld::ToggleButton&, void);
diff --git a/cui/uiconfig/ui/fontfeaturesdialog.ui b/cui/uiconfig/ui/fontfeaturesdialog.ui
index fa36d66ff476..585d3760311a 100644
--- a/cui/uiconfig/ui/fontfeaturesdialog.ui
+++ b/cui/uiconfig/ui/fontfeaturesdialog.ui
@@ -96,6 +96,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
+ <property name="row-homogeneous">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<property name="margin">6</property>
diff --git a/cui/uiconfig/ui/fontfragment.ui b/cui/uiconfig/ui/fontfragment.ui
index 140083b9687e..e66cd71b7ba6 100644
--- a/cui/uiconfig/ui/fontfragment.ui
+++ b/cui/uiconfig/ui/fontfragment.ui
@@ -7,7 +7,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
- <property name="valign">start</property>
+ <property name="valign">center</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="column_spacing">6</property>