Skip to content

Reduce length of recent file menu item text and limit the number of files shown in menu

Alvin Wong requested to merge alvinwong/krita:alvin/recent-files-menu into master

https://bugs.kde.org/show_bug.cgi?id=447332

Note that we only hide excessive items in the menu but not the list on the welcome screen. The welcome screen has a scroll bar for the recent files list so it is at least manageable.

The way I limit the items is to hide the QAction in KRecentFilesAction instead of outright removing them, because the model for the welcome screen still depends on the state of KRecentFilesAction. This also means the file icons are still loaded regardless of whether the item is visible on-screen (but this is not a regression).

In the future, we can add a "More Recent Files..." action to show a pop-up with the full recent files listing and a text box for searching from the list. (Inspiration from VSCode but I'm sure there are other software with similar features.)

Test Plan

(Tell us how to test the changes you made.)

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • n/a I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports