Skip to content
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

Highlight crates/playlists that a track is in #7606

Closed
mixxxbot opened this issue Aug 22, 2022 · 10 comments
Closed

Highlight crates/playlists that a track is in #7606

mixxxbot opened this issue Aug 22, 2022 · 10 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: naught101
Date: 2014-10-13T04:48:21Z
Status: Fix Released
Importance: Wishlist
Launchpad Issue: lp1380467
Tags: library


It would be good to be able to see which playlists/crates a track is in. So, if you have a track selected in the library, all of the visible crates/playlists/hisotories that it is in have a different background colour or similar.

Zotero does a similar thing with citations - if you select a citation, and hold 'alt', the collections that contain it are highlighted.

Not sure how this should work with tracks in decks, but perhaps the playlists/crates could be highlighted if the deck is moused-over?

@mixxxbot
Copy link
Collaborator Author

Commented by: mk42
Date: 2015-05-19T22:18:11Z


I would like to work on this - if it isn't too complicated.
I'm new to mixxx development and have little experience with QT.

Any hints on how to implement this?

@mixxxbot
Copy link
Collaborator Author

Commented by: mk42
Date: 2015-05-20T09:31:27Z


What I got so far:

I can use sql to get the crates a specific trackId is in:
Select crate_id from crate_tracks where track_id = [track_id]

I think highlighting itself can only be done by TreeItemModel::data.
That means the TreeItemModel needs to know the Items which need to be highlighted. The data_path of the TreeItems stores the crate_id for crates so it would be sufficient to store some "QList<QString> highlightItemsDataPath" in TreeItemModel.

What I need:
1) some signal on selection change in the library-Table-View which gives the selected crateIds as QList<QString> or sth.
2) a new member highlightItemsDataPath in TreeItemModel which is a QList<QString> and stores the data_path's of TreeItems to be highlighted
3) a condition in TreeItemModel::data for role = QBackgroundRole to change the background (or something else) for the TreeItems with data_path in highlightItemsDataPath
4) a slot in TreeItemModel to set highlightItemsDataPath
5) some way to connect the signal of selection change (1) to the slot(4)

@mixxxbot
Copy link
Collaborator Author

Commented by: mk42
Date: 2015-05-20T19:11:32Z


Actually it would be better to also highlight playlists in which the selected track is included. So maybe that way:

  1. some signal on selection change in the library-Table-View which gives the selected trackId
  2. a new member highlightTrackId in TreeItemModel which stores the id of the track to be highlighted
  3. a condition in TreeItemModel::data for role = QBackgroundRole to change the background (or something else) for the TreeItems whose child-models contain highlightTrackId
  4. a slot in TreeItemModel to set highlightTrackId
  5. some way to connect the signal of selection change (1) to the slot(4)

@mixxxbot
Copy link
Collaborator Author

Commented by: mk42
Date: 2015-05-25T10:04:43Z


The libraryFeature has a signal trackSelected that could be used.

The TreeItem is aware of it's feature, so we could use

TreeItemModel::data for role = QBackgroundRole
to ask for the items 'highlightState' which would itself ask his feature if it should highlight. But the problem is, if I return Qt::red for role == QBackgroundRole, nothing happens. So the Background color isn't respected. I need another way to highlight those Items

@mixxxbot
Copy link
Collaborator Author

Commented by: mk42
Date: 2015-05-28T19:29:15Z


#598

@mixxxbot
Copy link
Collaborator Author

Commented by: mk42
Date: 2015-06-11T13:18:57Z


#617

@mixxxbot
Copy link
Collaborator Author

Commented by: naught101
Date: 2015-08-03T04:38:32Z


Thanks heaps for this MK - it's very useful.

However, at the moment (with the Latenight skin at least), crate names are just bolded, and that's not very easy to notice, unless you're really looking for it. It would be much better if the crate's background was highlighted, perhaps in a similar way to when the mouse hovers over it (maybe a different colour though). I don't know if this is a problem with the skin itself, or this fix in particular. There may be other ways - even bold-italic would be good.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-08-03T05:44:25Z


Hi naught101,
would you mind to file a new bug, since this one is already "Fix Committed".
Thank you.

@mixxxbot
Copy link
Collaborator Author

Commented by: naught101
Date: 2015-08-03T23:44:34Z


ok, now at https://bugs.launchpad.net/mixxx/+bug/1481113

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.1.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant