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 mods that contain selected files in data tab #2179

Merged

Conversation

JonathanFeenstra
Copy link
Contributor

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.

@Holt59
Copy link
Member

Holt59 commented Dec 25, 2024

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 setHighlightedMods function should probably be merged in some way (or actually have one use the other to avoid all that duplicate code).

@JonathanFeenstra JonathanFeenstra force-pushed the highlight-mods-from-datatab branch from 09d6a9a to 357ba32 Compare December 25, 2024 13:50
@JonathanFeenstra
Copy link
Contributor Author

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 setHighlightedMods function.

void PluginListView::activated()
{
// update highlighted mods
selectionModel()->selectionChanged({}, {});
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Contributor Author

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?

@Holt59 Holt59 merged commit f8340e1 into ModOrganizer2:master Jan 2, 2025
2 checks passed
@JonathanFeenstra JonathanFeenstra deleted the highlight-mods-from-datatab branch January 2, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Highlight containing mod of selected files in Data Tab
2 participants