cui/source/dialogs/hlinettp.cxx          |    9 +++++++++
 cui/source/inc/hlinettp.hxx              |    1 +
 cui/uiconfig/ui/hyperlinkinternetpage.ui |    3 +++
 3 files changed, 13 insertions(+)

New commits:
commit 48e8dda3f64079d7a1dd7f87b45ed8288779950a
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 13 09:28:10 2019 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat Dec 14 20:34:52 2019 +0100

    size group is ignoring hidden widgets, leading to labels overlapping entries
    
    
https://developer.gnome.org/gtk3/stable/GtkSizeGroup.html#gtk-size-group-set-ignore-hidden
    
    "Measuring the size of hidden widgets ...  they will report a size of 0
    nowadays, and thus, their size will not affect the other size group members"
    
    Which is unfortunate. So before we hide any labels, take the size group 
width
    and set it as explicit preferred size.
    
    Change-Id: If7c0f1ebd9f03914c74fde85b876549de76853c2
    Reviewed-on: https://gerrit.libreoffice.org/85098
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 18df910f6054..fda37be4a3cd 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -40,12 +40,21 @@ 
SvxHyperlinkInternetTp::SvxHyperlinkInternetTp(weld::Container* pParent,
     , m_xRbtLinktypInternet(xBuilder->weld_radio_button("linktyp_internet"))
     , m_xRbtLinktypFTP(xBuilder->weld_radio_button("linktyp_ftp"))
     , m_xCbbTarget(new SvxHyperURLBox(xBuilder->weld_combo_box("target")))
+    , m_xFtTarget(xBuilder->weld_label("target_label"))
     , m_xFtLogin(xBuilder->weld_label("login_label"))
     , m_xEdLogin(xBuilder->weld_entry("login"))
     , m_xFtPassword(xBuilder->weld_label("password_label"))
     , m_xEdPassword(xBuilder->weld_entry("password"))
     , m_xCbAnonymous(xBuilder->weld_check_button("anonymous"))
 {
+    // gtk_size_group_set_ignore_hidden, "Measuring the size of hidden widgets
+    // ...  they will report a size of 0 nowadays, and thus, their size will
+    // not affect the other size group members", which is unfortunate. So here
+    // before we hide the labels, take the size group width and set it as
+    // explicit preferred size on a label that won't be hidden
+    auto nLabelWidth = m_xFtTarget->get_preferred_size().Width();
+    m_xFtTarget->set_size_request(nLabelWidth, -1);
+
     m_xCbbTarget->SetSmartProtocol(INetProtocol::Http);
 
     InitStdControls();
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index 88020df12c54..115e1e428a47 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -39,6 +39,7 @@ private:
     std::unique_ptr<weld::RadioButton> m_xRbtLinktypInternet;
     std::unique_ptr<weld::RadioButton> m_xRbtLinktypFTP;
     std::unique_ptr<SvxHyperURLBox> m_xCbbTarget;
+    std::unique_ptr<weld::Label> m_xFtTarget;
     std::unique_ptr<weld::Label> m_xFtLogin;
     std::unique_ptr<weld::Entry> m_xEdLogin;
     std::unique_ptr<weld::Label> m_xFtPassword;
diff --git a/cui/uiconfig/ui/hyperlinkinternetpage.ui 
b/cui/uiconfig/ui/hyperlinkinternetpage.ui
index e3921b9b2260..8ff149a95e20 100644
--- a/cui/uiconfig/ui/hyperlinkinternetpage.ui
+++ b/cui/uiconfig/ui/hyperlinkinternetpage.ui
@@ -389,6 +389,9 @@
       <widget name="target_label"/>
       <widget name="login_label"/>
       <widget name="password_label"/>
+      <widget name="frame_label"/>
+      <widget name="indication_label"/>
+      <widget name="name_label"/>
     </widgets>
   </object>
 </interface>
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to