diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-14 08:55:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-05-14 11:50:16 +0200 |
commit | 43f81f1ed3e98202d440f17509b8d008fab51ce3 (patch) | |
tree | b3f8680ac0cabcbeabeb0c6a374f99f8d56f7aa5 /vcl | |
parent | 6b58816d17957536a2875cbbed0d270451ff25f7 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 64 |
1 files changed, 42 insertions, 22 deletions
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") { |