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

Implemented "View In List" #719

Merged
merged 7 commits into from
May 7, 2024

Conversation

WeaverSong
Copy link
Contributor

Adds a "View In List" option when right-clicking a handle. This will scroll the tag list so that the selected tag is at the top of the view. If the selected handle is an inner command, the scroll will be offset based on its position, such that the first inner command will have the selected tag at the top of the view.

@MewPurPur
Copy link
Owner

MewPurPur commented May 6, 2024

The new option should only be shown when you've right-clicked a handle, not when you've right-clicked a tag editor. I suggest making it so if you right-click on a handle, it passes some context to the Indications.gd method, for example "viewport", which is then checked against to decide if the option should be there.

If the selected handle is an inner command, the scroll will be offset based on its position, such that the first inner command will have the selected tag at the top of the view.

I'd say, we should have a fixed offset for where the selected tag would be, for example 20% of the tag container's height. The metric you've mentioned here can be user-defined, for example with a lot of unrecognized tags, to the point where the path command can end up outside of the screen.


if context == SELECTION_CONTEXT.VIEWPORT:
btn_arr.append(Utils.create_btn(TranslationServer.translate("View In List"),
view_in_list.bind(selected_tids[0]), false, load("res://visual/icons/ViewInList.svg")))
Copy link
Owner

Choose a reason for hiding this comment

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

There's a bit of oddness in doing this with selected_tids[0] when you have a multiselection, but it's not that important. I'll squash this eventually.

@@ -456,8 +463,12 @@ func insert_inner_after_selection(new_command: String) -> void:
path_attrib.insert_command(last_selection + 1, new_command)
normal_select(semi_selected_tid, last_selection + 1)

enum SELECTION_CONTEXT {
Copy link
Owner

Choose a reason for hiding this comment

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

The name of the enum must be PascalCase.

@MewPurPur
Copy link
Owner

You need to run the update_translations.gd script to add the new string.

@MewPurPur
Copy link
Owner

Thanks!

@MewPurPur MewPurPur merged commit 150ce0e into MewPurPur:main May 7, 2024
@WeaverSong WeaverSong deleted the implement-view-in-list branch May 7, 2024 17:44
MewPurPur pushed a commit that referenced this pull request Jun 1, 2024
MewPurPur pushed a commit that referenced this pull request Jun 1, 2024
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.

2 participants