vcl/unx/gtk3/gtkinst.cxx | 24 ++++++++++++++++++++---- vcl/unx/gtk4/convert3to4.cxx | 1 + 2 files changed, 21 insertions(+), 4 deletions(-)
New commits: commit 9d777ef254330bb3d6af06e62ba602fe17824db9 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jul 27 13:07:54 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jul 27 15:25:27 2022 +0200 gtk4: don't use an arrow for the gtk3->gtk4 menus this was the clipboard dropdown matches the save one Change-Id: I423aeed097cd22d48aa9efcaf95e0e8d6fd36d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137501 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx index e00009cd1cf7..9032ac4692a7 100644 --- a/vcl/unx/gtk4/convert3to4.cxx +++ b/vcl/unx/gtk4/convert3to4.cxx @@ -973,6 +973,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode // <property name="menu-model"> xChild->appendChild(CreateProperty(xDoc, "menu-model", sId)); + xChild->appendChild(CreateProperty(xDoc, "has-arrow", "False")); xChild->appendChild(CreateProperty(xDoc, "visible", "False")); } } commit 1b517e049001b856e8043c6892a4819709b8efcf Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jul 27 12:56:12 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jul 27 15:25:11 2022 +0200 gtk4: fill in more of this menu related stub Change-Id: Ia646d6f98804ffbec1177d5964550708588ce88f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137500 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 05a0622577c2..0236f1aa9529 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -11285,13 +11285,29 @@ public: gtk_menu_reorder_child(m_pMenu, pItem, pos); #else SAL_WARN("vcl.gtk", "needs to be implemented for gtk4"); - (void)pos; - (void)rId; - (void)rStr; (void)pIconName; (void)pImageSurface; (void)rGraphic; - (void)eCheckRadioFalse; + + if (GMenuModel* pMenuModel = m_pMenu ? gtk_popover_menu_get_menu_model(m_pMenu) : nullptr) + { + auto aSectionAndPos = get_section_and_pos_for(pMenuModel, pos); + GMenu* pMenu = G_MENU(aSectionAndPos.first); + // action with a target value ... the action name and target value are separated by a double + // colon ... For example: "app.action::target" + OUString sActionAndTarget; + if (eCheckRadioFalse == TRISTATE_INDET) + sActionAndTarget = "menu.normal." + rId + "::" + rId; + else + sActionAndTarget = "menu.radio." + rId + "::" + rId; + g_menu_insert(pMenu, aSectionAndPos.second, MapToGtkAccelerator(rStr).getStr(), sActionAndTarget.toUtf8().getStr()); + + assert(eCheckRadioFalse == TRISTATE_INDET); // come back to this later + + // TODO not redo entire group + update_action_group_from_popover_model(); + } + #endif }