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

TabbedPane drag and drop tabs reordering support. #2109

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

AndreiKud
Copy link
Contributor

@AndreiKud AndreiKud commented Feb 25, 2024

Fixes #1212

Same as in #1225 I used an open-source Java Swing components repo as a reference. Specifically DnDTabbedPane component.

Key notes:

  1. Though the original component is heavily modified to fit in Jadx codebase, there are some untouched parts still, so I placed MIT license (added you as copyrighter) at the beginning of every DnD-related file. However, it will override your Apache 2.0 license for these specific files, are you ok with it? I also found other DnDTabbedPane implementations that used the original repo as a source, but didn't bother to license the code.
  2. There are multiple modes for rendering "ghost" tab that we are dragging as described in TabDndGhostType.java. I haven't added UI settings for it, since it is the only one (well, mayby the ghost color as well) modifiable property of tabs behaviour and the setting will look wierdly empty. I suggest adding it with next configurable tabs feature.
  3. Moved all tabs-related classes to separate package.
  4. Tried to supply vague logic with commentaries.
  5. Made an PR to original repo along the way: DnDTabbedPane. Idx for insertion selection fix. aterai/java-swing-tips#24.

@skylot
Copy link
Owner

skylot commented Feb 25, 2024

@AndreiKud looks great! Thank you 👍

it will override your Apache 2.0 license for these specific files, are you ok with it?

I think it is fine as soon as it explicitly stated and MIT is more permissive

There are multiple modes for rendering "ghost" tab

Yeah, setting for this will be nice, because for me this ghost tab is not needed at all, only insertion mark is fine.

Made an PR to original repo along the way

Well done! 🙂

@skylot skylot merged commit d7ec357 into skylot:master Feb 25, 2024
5 checks passed
@AndreiKud AndreiKud deleted the feature/tabs-dnd branch February 25, 2024 19:59
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.

Allow drag and drop reordering of tabs
2 participants