Skip to content

Add popup of recent documents to "Open" action toolbar button

Kai Uwe Broulik requested to merge work/kbroulik/open-action-recent into master

This changes the "Open" action to a KToolBarPopupAction where, when placed in a toolbar, it will turn into a split button with recent documents listed from the accompanying file_open_recent.

This works automatically for all regular KXmlGui applications that have a "Recent Documents" action alongside their "Open" action, such as Kate, KWrite, Kolourpaint, etc.


@teams/vdg @ahmadsamir @ngraham

The split button is only shown when there actually are recent documents and hides when I hit “Forget…” from the menu.

The “Open” entry in the “File” menu remains unchanged as there you have a “Recent documents” entry below it, it’s just a shortcut on the toolbar, where you can either click the arrow, or right-click to access recent documents.

The fact that we now have a KOpenAction (internal, all the outside sees is a QAction, so we can mess about with it however we like) also makes it easier to extend this in the future if we were to add a quick-search or whatever like gedit has it.

Screenshot_20230726_211718

Screenshot_20230726_211457

Screenshot_20230726_211511

Depends on:

Edited by Kai Uwe Broulik

Merge request reports