mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-110016 Fixed font for tree cell renderer - so clickable area corresponds to rendered text
This commit is contained in:
@@ -142,6 +142,15 @@ public abstract class ColoredTreeCellRenderer extends SimpleColoredComponent imp
|
||||
super.setOpaque(isOpaque);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Font getFont() {
|
||||
Font font = super.getFont();
|
||||
|
||||
// Cell renderers could have no parent and no explicit set font.
|
||||
// Take tree font in this case.
|
||||
return font != null ? font : getTree().getFont();
|
||||
}
|
||||
|
||||
/**
|
||||
* When the item is selected then we use default tree's selection foreground.
|
||||
* It guaranties readability of selected text in any LAF.
|
||||
|
||||
+2
-3
@@ -37,7 +37,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class CommittedChangeListRenderer extends ColoredTreeCellRenderer {
|
||||
private static final SimpleTextAttributes LINK_ATTRIBUTES = new SimpleTextAttributes(SimpleTextAttributes.STYLE_UNDERLINE, Color.blue);
|
||||
private final IssueLinkRenderer myRenderer;
|
||||
private final List<CommittedChangeListDecorator> myDecorators;
|
||||
private final Project myProject;
|
||||
@@ -153,9 +152,9 @@ public class CommittedChangeListRenderer extends ColoredTreeCellRenderer {
|
||||
myRenderer.appendTextWithLinks(description);
|
||||
if (!StringUtil.isEmpty(description)) {
|
||||
append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
append(moreMarker, LINK_ATTRIBUTES, new CommittedChangesTreeBrowser.MoreLauncher(myProject, changeList));
|
||||
append(moreMarker, SimpleTextAttributes.LINK_ATTRIBUTES, new CommittedChangesTreeBrowser.MoreLauncher(myProject, changeList));
|
||||
} else if (remainingWidth > 0) {
|
||||
append(moreMarker, LINK_ATTRIBUTES, new CommittedChangesTreeBrowser.MoreLauncher(myProject, changeList));
|
||||
append(moreMarker, SimpleTextAttributes.LINK_ATTRIBUTES, new CommittedChangesTreeBrowser.MoreLauncher(myProject, changeList));
|
||||
}
|
||||
// align value is for the latest added piece
|
||||
appendFixedTextFragmentWidth(descMaxWidth);
|
||||
|
||||
Reference in New Issue
Block a user