-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Improve AssetPanelItem #420
Improve AssetPanelItem #420
Conversation
- Aligned asset name to center - Made sure the buttonPanel is always the same size - When asset name is to large, the buttonPanel will be shown on top - Made clicking the AssetPanelItem easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I agree with all changes except for the text alignment (mentioned in the suggestion above).
textField.setLineWrap(true); | ||
textField.setColumns(10); | ||
SimpleAttributeSet attributes = new SimpleAttributeSet(); | ||
StyleConstants.setAlignment(attributes, StyleConstants.ALIGN_CENTER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StyleConstants.setAlignment(attributes, StyleConstants.ALIGN_CENTER); | |
StyleConstants.setAlignment(attributes, StyleConstants.ALIGN_JUSTIFIED); |
I'd prefer justified alignment over centered text. The last line of multiline text should not be centered in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using justify will more or less look exaclty the same as the not aligned text before.
I'll remove the alignment and go back to a JTextArea, which is easier to use without the alignment styling.
I'll keep the 2 lines and button size changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't center the text if it is a single line, which is still desirable in my opinion. Though I generally dislike the idea of using a JTextPane
to display the filename as it is quite heavy. Maybe we can use a JLabel
with html content and have the rename action sit inside a context menu with a separate popup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused imports
Removed the center alignment and returned to JTextArea instead of JTextPane
Ungrouped imports
Made sure the buttonPanel is always the same size
( see Cosmetic improvments to the AssetPanelItem #419 )
When asset name is to large, the buttonPanel will be shown on top
![image](https://user-images.githubusercontent.com/3458701/131215782-f206f007-123b-4fdd-a13e-57d436c45405.png)
![image](https://user-images.githubusercontent.com/3458701/131215787-4b961af0-f744-4506-89b7-7400f7aad77a.png)
Made clicking the AssetPanelItem easier
When clicking an asset, I had the issue that one out of three clicks didn't seem to register. The cause of this was a slight movement of my pointer during the click. Therefore I added the mouseRelease as well, beside the mouseClick, so it registers more actions.
Any feedback/remarks welcome.