Add popup of recent documents to "Open" action toolbar button
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.
Depends on: