Add Number of tracks to Tracks label in Library#14552
Conversation
|
Welcome at Mixxx! |
|
Hey, I've signed the agreement :) |
|
This doesn't build if You need to remove the #ifdef ENGINEPRIME around Then it works. |
|
This PR is marked as stale because it has been open 90 days with no activity. |
6f018e2 to
0a9714c
Compare
|
Hi, I have free time if you think there's something I can do related to this PR, would be cool to have my first merge in Mixxx :D Last thing i did was solve the conflicts and do the change requested |
ywwg
left a comment
There was a problem hiding this comment.
looks good, congrats on your first contribution!
ronso0
left a comment
There was a problem hiding this comment.
Thanks. I took another look and like to improve this a bit.
(the repaint nit is just a question)
| if (m_pSidebarWidget) { | ||
| m_pSidebarWidget->repaint(); | ||
| } | ||
| } |
There was a problem hiding this comment.
repaint might be cheap, but is there another way to trigger repaint of just the Tracks item?
|
Oh, and please rebase to give the actual track count commit a meaningful message ("Final commit" is .. not that helpful if you try to guess the change when looking at a git log ; ) |
9a0599b to
0510c0e
Compare
| if (m_pTracksTreeItem && m_pSidebarModel) { | ||
| QModelIndex rootIndex = m_pSidebarModel->getRootIndex(); | ||
| QModelIndex tracksIndex = m_pSidebarModel->index( | ||
| m_pTracksTreeItem->parentRow(), 0, rootIndex); | ||
| m_pSidebarModel->triggerRepaint(tracksIndex); | ||
| } |
There was a problem hiding this comment.
Thanks for the update, and sorry for kind of turning in circles here.
Turns out my performance concern was not relevant in the first place because Qt is smart and only repaints 'dirty' regions, no matter what we request to repaint.
- however, it does repaint the entire view if the changed track count label changes Tracks in a way that the tree width changes (determined by the widest item), which has been is "fixed" by Library sidebar: expand items to full width to maximize click-responsive area -- v2 #15330 btw, but this has not landed in main, yet.
TL;DR
The cleanest update request we can issue is
emit featureIsLoading(this, false /* don't re-select */);
This signal meant to update the sidebar title for Traktor, iTunes and other external features that do dynamic loading.
Btw your current implementation won't work as intended.
TreeItem->parentRow() will return -1 for root items, so tracksIndex is invalid and thereby we'd still request to repaint the entire sidebar.
a7a2e95 to
81741b7
Compare
|
LGTM, thanks! |
#13284