-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve library sidebar UX (right-click and selection after add, rename, delete, duplicate etc.) #11208
Improve library sidebar UX (right-click and selection after add, rename, delete, duplicate etc.) #11208
Conversation
6a6a2c3
to
6fac6a5
Compare
Is this intended to go to 2.4? |
Yup, for 2.4 I already rebased locally and will update this soon. |
6fac6a5
to
cb02631
Compare
This is now ready for testing! |
b607fb8
to
11a3f5e
Compare
I have just tested it and that is an improvement. However, the scrolling is now "broken" when you for instance rename a playlist. |
9b3be3f
to
2b46042
Compare
Everything should now work as expected. TODO: |
d9bbee4
to
a21dc9b
Compare
All done! New features in History:
All skins should now mark the (unselected) right-clicked sidebar item with a border. |
e0d4b93
to
121a87f
Compare
121a87f
to
62a6c03
Compare
don't rely on the right-clicked crate being selected in the feature's main table model, use a fresh temporary model instead
TODO: styled only in LateNight PaleMoon, adjust stylesheets for other skins/themes
Sorry I had to force-push. The code suggestions I commited here changed some variable names which I didn't spot in the diff (or relied on it being correct, i.e. this would built) |
src/library/dao/playlistdao.cpp
Outdated
return true; | ||
} | ||
|
||
bool PlaylistDAO::deleteUnlockedPlaylists(QStringList& idStringList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idStringList
is not const anymore so we can remove the locked playlist ids, without creating another QStringList
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want non const references. I think in this case it would be correct to std::move the idStringList into the function, than it is clear that the caller must not use it afterwards.
bool PlaylistDAO::deleteUnlockedPlaylists(QStringList& idStringList) { | |
bool PlaylistDAO::deleteUnlockedPlaylists(QStringList&& idStringList) { |
src/library/dao/playlistdao.cpp
Outdated
return true; | ||
} | ||
|
||
bool PlaylistDAO::deleteUnlockedPlaylists(QStringList& idStringList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want non const references. I think in this case it would be correct to std::move the idStringList into the function, than it is clear that the caller must not use it afterwards.
bool PlaylistDAO::deleteUnlockedPlaylists(QStringList& idStringList) { | |
bool PlaylistDAO::deleteUnlockedPlaylists(QStringList&& idStringList) { |
Thanks @daschuer! |
I just noticed two regressions:
I'll look into it. |
Okay, done. Fortunately that was easy (I'm not very much into the code anymore.. x) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works good. Thank you.
Oh, thanks! I was just doing intense testing and fixed some minor issues. |
I'd like to fix the last annoyance with the current selection/activation behaviour.
My proposal:
This is now ready for testing!
I'll double-check the implementation and maybe rebase if needed, so please don't spend time on the diff until I give 👍
New features:
¹highlight border like in tracks view, currently only styled in LateNight PaleMoon
TODO
Test cases for selection:
Playlists / Crates / History
selection in sidebar and tracks view should not change when you
a) delete, rename, duplicate or lock it
b) import a playlist file (= append it to the selected playlist / crate) or
c) simply close the context menu without clicking an action
Playlists / Crates / History
⇒ item below or above should be selected and loaded to the tracks view
Playlists / Crates
⇒ sidebar should scroll to new item
⇒ new empty item should not be selected
⇒ tracks view should not change
Playlists / Crates
History
⇒ new setlog will be created and marked with →
⇒ root item remains selected
⇒ current tracks view should be cleared (new setlog)
I hope this can also serve as base for any QML implementation of a sidebar/topbar/whatever feature view we come up with.