vcl/unx/gtk3/gtkinst.cxx | 64 ++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 22 deletions(-)
New commits: commit 43f81f1ed3e98202d440f17509b8d008fab51ce3 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri May 14 08:55:42 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri May 14 11:50:16 2021 +0200 gtk4: vexpand internal dialog vbox child Change-Id: I9c08fa885ddfb22e154909a66e6a70d8293879d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115583 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 960ad2bc0519..77b2bec9fc53 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -17584,7 +17584,23 @@ void ConvertTree(const Reference<css::xml::dom::XNode>& xNode) } else if (xChild->getNodeName() == "child") { - if (!sBorderWidth.isEmpty()) + bool bContentArea = false; + + css::uno::Reference<css::xml::dom::XNamedNodeMap> xMap = xChild->getAttributes(); + css::uno::Reference<css::xml::dom::XNode> xName = xMap->getNamedItem("internal-child"); + if (xName) + { + OUString sName(xName->getNodeValue()); + if (sName == "vbox") + { + xName->setNodeValue("content_area"); + bContentArea = true; + } + else if (sName == "accessible") + xRemoveList.push_back(xChild); // Yikes!, what's the replacement for this going to be + } + + if (bContentArea || !sBorderWidth.isEmpty()) { for (css::uno::Reference<css::xml::dom::XNode> xObjectCandidate = xChild->getFirstChild(); xObjectCandidate.is(); @@ -17593,33 +17609,37 @@ void ConvertTree(const Reference<css::xml::dom::XNode>& xNode) if (xObjectCandidate->getNodeName() == "object") { auto xDoc = xChild->getOwnerDocument(); - auto xMarginEnd = CreateProperty(xDoc, "margin-end", sBorderWidth); - - auto xFirstChild = xObjectCandidate->getFirstChild(); - if (xFirstChild.is()) - xObjectCandidate->insertBefore(xMarginEnd, xFirstChild); - else - xObjectCandidate->appendChild(xMarginEnd); - xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-top", sBorderWidth), xMarginEnd); - xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-bottom", sBorderWidth), xMarginEnd); - xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-start", sBorderWidth), xMarginEnd); + if (bContentArea) + { + auto xVExpand = CreateProperty(xDoc, "vexpand", "True"); + + auto xFirstChild = xObjectCandidate->getFirstChild(); + if (xFirstChild.is()) + xObjectCandidate->insertBefore(xVExpand, xFirstChild); + else + xObjectCandidate->appendChild(xVExpand); + } + + if (!sBorderWidth.isEmpty()) + { + auto xMarginEnd = CreateProperty(xDoc, "margin-end", sBorderWidth); + + auto xFirstChild = xObjectCandidate->getFirstChild(); + if (xFirstChild.is()) + xObjectCandidate->insertBefore(xMarginEnd, xFirstChild); + else + xObjectCandidate->appendChild(xMarginEnd); + + xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-top", sBorderWidth), xMarginEnd); + xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-bottom", sBorderWidth), xMarginEnd); + xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-start", sBorderWidth), xMarginEnd); + } break; } } sBorderWidth.clear(); } - - css::uno::Reference<css::xml::dom::XNamedNodeMap> xMap = xChild->getAttributes(); - css::uno::Reference<css::xml::dom::XNode> xName = xMap->getNamedItem("internal-child"); - if (xName) - { - OUString sName(xName->getNodeValue()); - if (sName == "vbox") - xName->setNodeValue("content_area"); - else if (sName == "accessible") - xRemoveList.push_back(xChild); // Yikes!, what's the replacement for this going to be - } } else if (xChild->getNodeName() == "object") { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits