[pim/itinerary] src/app: Add dirty workaround for zero-sized export menus

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c820c7b4b93b40f712376a33a1bbf868c734daae by Volker Krause.
Committed on 10/08/2026 at 15:19.
Pushed by vkrause into branch 'master'.

Add dirty workaround for zero-sized export menus

Those seem to predominantly occur on individiual public transport entries,
not on trip groups or hotels etc. The cause seems to be the the weird
binding hack in Kirigami.Dialog onContentItemChanged, without that
everything works fine.

M  +7    -1    src/app/ExportMenuDialog.qml

https://invent.kde.org/pim/itinerary/-/commit/c820c7b4b93b40f712376a33a1bbf868c734daae

diff --git a/src/app/ExportMenuDialog.qml b/src/app/ExportMenuDialog.qml
index a833ee5df..330976ae7 100644
--- a/src/app/ExportMenuDialog.qml
+++ b/src/app/ExportMenuDialog.qml
@@ -64,8 +64,14 @@ Kirigami.MenuDialog {
         }
     }
     onVisibleChanged: {
-        if (root.visible)
+        if (root.visible) {
             deviceModel.refresh();
+            // HACK work around zero-sized menus caused by the weird hack in Kirigami.Dialog onContentItemChanged
+            if (contentItem.implicitHeight <= 0) {
+                console.log("fixing broken Kirigami.MenuDialog height!");
+                contentItem.preferredHeight = _actions.length * (Kirigami.Units.gridUnit + 2 * Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing)
+            }
+        }
     }
 
     FileDialog {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.