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

Small UI fixes. #415

Merged
merged 5 commits into from
Apr 20, 2022
Merged

Small UI fixes. #415

merged 5 commits into from
Apr 20, 2022

Conversation

GraxCode
Copy link
Contributor

  • Better looking tab close button.
  • Make theme changes also affect components that are not in UI tree.

(Had to merge master as i forgot to update my repo, but it should work)

# Conflicts:
#	src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java
#	src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java
#	src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java
#	src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java
Comment on lines 184 to 188
LafManager.registerInitTask((t, p) -> SwingUtilities.invokeLater(() -> {
for (Component component : components)
SwingUtilities.updateComponentTreeUI(component);
}));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to use

for (var comp : components) {
    UIUpdater.registerComponent(comp);
}

instead. The fact that you have to run the ui update logic in invokeLater comes from the fact that when the init task is called the complete Laf hasn't been yet installed completely. It also has the advantage of not preventing the component from being garbage collected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I was looking for that, but couldn't find any documentation.

@Konloch Konloch merged commit c93d2b5 into Konloch:master Apr 20, 2022
@Konloch
Copy link
Owner

Konloch commented Apr 20, 2022

Thank you! 😄

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.

3 participants