[KFilePlacesView] Add missing functionality required in order to be used by Dolphin again
AbandonedPublic

Authored by ngraham on Dec 17 2019, 3:34 PM.

Details

Summary

This includes:

  • Rendering hidden items desaturated when in "show all" mode
  • A getter for "show all"
  • Signals for place activation/clicking
  • Signals for middle clicking a place (for e.g. open in a new tab)
  • Possibility to add custom actions to the context menu
  • Possibility to provide own storage teardown procedure
  • Changing view icon size is forwarded to delegates

The delegates are also made somewhat more compact to match Dolphin and spacing inbetween sections increased.

Test Plan

Try with branch broulik/kfileplacesview in Dolphin.

  • Can I remove a Q_PRIVATE_SLOT?
  • Currently when enabling "show all" and clicking a place, "show all" is deactivated again. Dolphin keeps this permanently. Should we change this?

Dolphin (from left to right: current custom view, KFilePlacesView current look, KFilePlacesView more compact new look to match Dolphin)


Open dialog (from left to right: current look, more compact look, imho looks a bit crowded in conjunction with the file dialog :/0

Diff Detail

Repository
R241 KIO
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Dec 17 2019, 3:34 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 17 2019, 3:34 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Dec 17 2019, 3:34 PM

Fantastic. UI-wise, I agree that adopting Dolphin's more narrow paddings between list elements makes the file dialog feel a bit crowded. This is also a (very) minor complaint I have about Dolphin. I wonder if it wouldn't make sense to keep the existing paddings between list items, or reduce them only a tiny bit.

One thing I notice has been lost is the ability to choose the size of the icons. Dolphin currently exposes this in the context menu for places panel headers. The File dialog does something different and automatically resizes the icons according to how much vertical space is available in the dialog. However with this patch and your Dolphin branch, neither one is available and the icon sizes appear to be immutable.

It would be nice to unify the behavior between Dolphin and the file dialog with this patchset. We get bugs about them being different.

I added icon size context menu in dolphin

I'm using your Dolphin branch but I don't see it.


Works fine here. Are both branches up to date and are you clicking an empty area?

ngraham accepted this revision as: VDG.Dec 22 2019, 7:59 PM

Yep, my branches weren't up to date. Works fine now!

meven added a subscriber: meven.Dec 30 2019, 1:30 PM
meven added inline comments.
src/filewidgets/kfileplacesview.h
157

For KF6 ?

Frameworks folks, Dolphin folks, and/or @elvisangelaccio, how is this looking? It would be really nice to be able to use the same backend code for the Places panel in Dolphin and the file dialogs again. :)

elvisangelaccio requested changes to this revision.Jan 19 2020, 9:29 PM

Haven't tried the dolphin branch yet, just a comment on the API for now.
From a quick look the patch looks good though.

src/filewidgets/kfileplacesview.h
68

This seems to be the name of a method that makes all items visible, not the name of a bool getter.

I know we already have setShowAll(), but we can deprecate it and find a better name. How about setAllPlacesVisible() / allPlacesVisible() / allPlacesVisibleChanged() ?

This revision now requires changes to proceed.Jan 19 2020, 9:29 PM
Zren added a subscriber: Zren.Aug 9 2020, 12:01 AM
clel added a subscriber: clel.Aug 9 2020, 4:45 PM

Hopefully this can proceed soon, this seems like a pretty nice step towards better maintainability and consistency to me. Looks like all major work is already done and only some minor things need discussion or changes. @broulik do you have time to look at it again in the near future?

ngraham abandoned this revision.Jan 23 2022, 3:55 AM