-
Notifications
You must be signed in to change notification settings - Fork 168
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 mods that contain selected files in data tab #2179
Highlight mods that contain selected files in data tab #2179
Conversation
Thanks for the PR. I think this can get confusing because the highlighting persists through tab switch (between Plugins and Data) so you will see highlights from the Data tab when on the Plugins tab, maybe that should be handled in some way, like, use a separate color or set highlights based on the selected tab. Also the two |
09d6a9a
to
357ba32
Compare
I thought the persisting highlights after switching tabs were okay since they're updated the next time the selection changes, but I can see how that could lead to confusion. I changed it so the highlights in the mod list are now updated when you switch between the plugins and data tabs and I removed the old |
void PluginListView::activated() | ||
{ | ||
// update highlighted mods | ||
selectionModel()->selectionChanged({}, {}); |
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.
I have not tested that but I don't think that's great because it will clear previous selections from the list.
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.
It doesn't clear the previous selections because both selected
and deselected
are empty, so there's no actual change. I agree that it's not the cleanest solution, but I couldn't move the lambda expression in the connect
to its own updateHighlightedMods
function because then I lose access to mwui->modList
. Do you have any ideas for a better approach?
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.
If it does not clear the selection that's fine, but I'm not really fan of that activated
, isn't there a way to "deduce" that from a Qt signal or something? Also, why isn't there something similar for the data tab?
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.
The data tab already had an activated
function, I also added ui.tree->selectionModel()->selectionChanged({}, {});
there. Both are called in MainWindow::on_tabWidget_currentChanged
. It could probably also be done by emitting a signal there and listening for that in both the plugins and data tabs. Should I try that instead?
The highlight color is the same as when highlighting mods from selected plugins in the plugins tab, so I updated the description of that color in the color table accordingly. This includes the name of the setting in ModOrganizer.ini, so if the user changed that color before updating, they'll probably need to set it again. Resolves #1530.