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

Label ordering buttons #3416

Merged
merged 2 commits into from
Sep 18, 2021
Merged

Conversation

HebaruSan
Copy link
Member

Motivation

The labels from #2936 have an implicit ordering that matters if a mod is included in multiple labels, but the user can't control this ordering except by editing a JSON file. Worse, this ordering is hidden in the Edit Labels window, which sorts each group of labels alphabetically by name.

Changes

Now the Edit Labels window shows the labels in their actual ordering rather than alphabetical.

Now when you edit a label, up and down buttons appear to the right of the label tree:

image

Clicking the up button moves the label earlier in the list, and clicking the down button moves it later.

Fixes #3395.

Side fixes

  • The Japanese translation had a lot of duplicate references to resources, which are now removed
  • Support replaced_by property #2671 added two image files that have never been used, GUI/Resources/arrow_forward.png and GUI/Resources/arrow_upward.png, which are now removed

@HebaruSan HebaruSan added Enhancement GUI Issues affecting the interactive GUI Pull request labels Jul 19, 2021
@HebaruSan

This comment has been minimized.

@d-faure
Copy link

d-faure commented Aug 2, 2021

Right-clicking to edit labels is still leading to the same dialog with the selection invite., but selecting a label doesn't lead to anything and no editing is allowed. The Create button is working and allows appending a new label to the list.

@HebaruSan
Copy link
Member Author

Right-clicking to edit labels is still leading to the same dialog with the selection invite., but selecting a label doesn't lead to anything and no editing is allowed. The Create button is working and allows appending a new label to the list.

Thanks for testing and reporting that, I have a guess as to what weird thing Windows is doing to cause that (not setting IsExpanded == True for nodes without children when we call ExpandAll), so I'll make some more changes in a bit that should address it...

@HebaruSan HebaruSan force-pushed the feature/reorder-labels branch 2 times, most recently from b192398 to 891b5f6 Compare August 2, 2021 12:42
@HebaruSan
Copy link
Member Author

@d-faure
Copy link

d-faure commented Aug 2, 2021

Now, that's ok

@DasSkelett
Copy link
Member

Should we move instance groups above the "Global" group, so the more specifics overwrite less specifics? I think that's what you'd typically expect in similar situations.

@HebaruSan
Copy link
Member Author

Makes sense to me. Now the list model object sorts them that way on load (so the change will apply regardless of whether the user opens the editing form), and the editing UI maintains the ordering.

Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works very well now, nice feature!

@HebaruSan HebaruSan merged commit 2d67c29 into KSP-CKAN:master Sep 18, 2021
@HebaruSan HebaruSan deleted the feature/reorder-labels branch September 18, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement GUI Issues affecting the interactive GUI Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Allow ordering of mod labels
3 participants