Skip to content

Commit

Permalink
pcorlessGH-272 Makes AnnotationSummaryBox font size not modify underl…
Browse files Browse the repository at this point in the history
…ying annotation font size, retrieve annotation font size on popup init
  • Loading branch information
Guillaume Tâche committed Oct 19, 2023
1 parent fa6bd74 commit 01e3701
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ private void buildGUI() {
String contents = annotation.getParent() != null ?
annotation.getParent().getContents() : "";
textArea = new JTextArea(contents != null ? contents : "");
textArea.setFont(new JLabel().getFont());
textArea.setFont(new JLabel().getFont().deriveFont(annotation.getTextAreaFontsize()));
textArea.setWrapStyleWord(true);
textArea.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(PopupAnnotation.BORDER_COLOR),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
Expand All @@ -381,11 +381,13 @@ private void buildGUI() {

// creation date
creationLabel = new JLabel();
creationLabel.setFont(new JLabel().getFont().deriveFont(annotation.getHeaderLabelsFontSize()));
refreshCreationLabel();
// title, user name.
String title = selectedMarkupAnnotation != null ?
selectedMarkupAnnotation.getFormattedTitleText() : "";
titleLabel = new JLabel(title);
titleLabel.setFont(new JLabel().getFont().deriveFont(annotation.getHeaderLabelsFontSize()));

// main layout panel
GridBagLayout layout = new GridBagLayout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ public String getDebuggable() {

@Override
public void setFontSize(final int size) {
super.setFontSize(size);
titleLabel.setFont(titleLabel.getFont().deriveFont(size));
creationLabel.setFont(titleLabel.getFont().deriveFont(size));
textArea.setFont(titleLabel.getFont().deriveFont(size));
}

@Override
Expand Down

0 comments on commit 01e3701

Please sign in to comment.