diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-02-20 10:08:55 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2018-03-09 05:20:32 +0100 |
commit | 1bf5ced5335e110f5e402d292e6c31bac617a655 (patch) | |
tree | c240b877f53d3f143ea69f20d89cb27d820fb937 /cui | |
parent | 5dcd176ef96b1deef57f98a9a81ce121a0a5bb68 (diff) |
tdf#115015: make crypto settings better fit allocated space
Oh dear how much do I dislike fixed size dialogs. Everytime they
are enlarged to fit new content (esp. gtk3 is rather space-greedy
there) someone starts to whine the dialog is now too large
Doing what e6d7d7375221 does is not really an option, since there
are some 30+ tabpages to try and test for optimal size here.
And two more squashed commits:
tdf#1155015: Make sure checkbox text really wraps
for :wrap property to be effective, a reasonable height request is
needed so the text is not forced into single line again
tdf#115994: Extensions' option pages need fixed pref. size
as they are fixed size .xdl-based dialogs mostly
But because of tdf#115015 calculate this preferred size as approx.
14 text edits + some padding to make sure crypto settings will fit
the allocated space
Change-Id: I3ffb2d794f76781eb62186093b928289593585cf
Reviewed-on: https://gerrit.libreoffice.org/50596
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgenrl.cxx | 14 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 7 | ||||
-rw-r--r-- | cui/uiconfig/ui/optuserpage.ui | 7 |
3 files changed, 25 insertions, 3 deletions
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 0816a8c49821..eca06bb66f6a 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -302,7 +302,7 @@ void SvxGeneralTabPage::InitCryptography() { #if HAVE_FEATURE_GPGME m_pCryptoFrame->Show(); - // unused yet, I just wanted to see if this delivers the desired results + uno::Reference< xml::crypto::XSEInitializer > xSEInitializer; try { @@ -321,6 +321,18 @@ void SvxGeneralTabPage::InitCryptography() m_pEncryptionKeyLB->InsertEntry( xCert->getIssuerName()); } } + + //tdf#115015: wrap checkbox text and listboxes if necessary + Size aPrefSize(m_pEncryptToSelfCB->get_preferred_size()); + Size aSize(m_pEncryptToSelfCB->CalcMinimumSize(40*approximate_char_width())); + if (aPrefSize.Width() > aSize.Width()) + { + m_pSigningKeyLB->set_width_request(aSize.Width()); + m_pEncryptionKeyLB->set_width_request(aSize.Width()); + m_pEncryptToSelfCB->set_width_request(aSize.Width()); + m_pEncryptToSelfCB->set_height_request(aSize.Height()); + } + } } catch ( uno::Exception const & ) diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 076a000d86b2..fccf0c14df59 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -19,6 +19,7 @@ #include <memory> #include <config_features.h> +#include <config_gpgme.h> #include <svx/dialogs.hrc> @@ -490,9 +491,15 @@ void OfaTreeOptionsDialog::InitWidgets() get(pTabBox, "box"); Size aSize(pTabBox->LogicToPixel(Size(278, 259), MapMode(MapUnit::MapAppFont))); pTabBox->set_width_request(aSize.Width()); +#if HAVE_FEATURE_GPGME + // tdf#115015: make enough space for crypto settings (approx. 14 text edits + padding) + pTabBox->set_height_request((Edit::GetMinimumEditSize().Height() + 6) * 14); +#else pTabBox->set_height_request(aSize.Height() - get_action_area()->get_preferred_size().Height()); +#endif pTreeLB->set_width_request(pTreeLB->approximate_char_width() * 25); pTreeLB->set_height_request(pTabBox->get_height_request()); + } // Ctor() with Frame ----------------------------------------------------- diff --git a/cui/uiconfig/ui/optuserpage.ui b/cui/uiconfig/ui/optuserpage.ui index 96c0a77cfad0..ac080f43b32c 100644 --- a/cui/uiconfig/ui/optuserpage.ui +++ b/cui/uiconfig/ui/optuserpage.ui @@ -883,8 +883,9 @@ </child> <child> <object class="GtkComboBox" id="encryptionkey"> - <property name="can_focus">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="model">liststore1</property> </object> <packing> @@ -896,6 +897,7 @@ <object class="GtkComboBox" id="signingkey"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="model">liststore1</property> </object> <packing> @@ -904,10 +906,11 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="encrypttoself"> + <object class="GtkCheckButton" id="encrypttoself:wrap"> <property name="label" translatable="yes" context="optuserpage|encrypttoself">When encrypting documents, always encrypt to self</property> <property name="can_focus">True</property> <property name="visible">True</property> + <property name="xalign">0</property> <property name="receives_default">False</property> <property name="draw_indicator">True</property> </object> |