Lokalize: Fix inconsistent menubar ordering across tabs

Right now the menubar in Lokalize doesn’t behave like a steady frame around the app. When you switch between tabs (Editor, Project Overview, Translation Memory, etc) the Edit, Go, and Sync menus can jump around or disappear completely. That breaks muscle memory and doesn’t match what users expect from a KDE application, where top level menus should stay put.

After digging into it, I found that this comes from how KXMLGUI merges multiple RC files: the main window RC plus the RC file for the currently active tab. Because there was no explicit ordering, the final layout depended on which RC got merged last. Some tabs also simply didn’t define certain menus at all, which caused the whole menubar to change when switching views.

To fix this, I standardized the menu structure and left the content distributed: I gave every top level menu a fixed slot by adding index attributes in the RC files: File(1), Edit(2), Go(3), Project(4), Sync(5), Tools(6), Settings(7).

For tabs that don’t actually use some of these menus (for example TM or Search), I added empty menus with the correct index and a inside. KXMLGUI then does the right thing and shows only the menu header instead of dropping them entirely. Each tab still owns its own actions and contributes them via its own RC file; only the overall frame is now defined once and reused everywhere.

Files touched:

  • src/lokalizemainwindowui.rc: define the full skeleton with fixed indices and placeholder Edit/Go/Sync menus (v10 -> v11)
  • src/project/projectmanagerui.rc: reorder menus to match the skeleton, add Sync placeholder (v5 -> v6)
  • src/tm/translationmemoryrui.rc: add Edit/Go/Sync placeholders with the right indices (v3 -> v4)
  • src/filesearch/filesearchtabui.rc: same as above for the Search tab (v0 -> v1)
  • src/editorui.rc: Added missing actions to Edit menu (v15->v16)
Edited by Finley Watson

Merge request reports

Loading