UI DSL: Don't restrict max line length of commentRow

GitOrigin-RevId: 987a8e59f2243c2aa3e686471c66aae29d59ce3f
This commit is contained in:
Dmitry Jemerov
2019-09-04 17:31:07 +00:00
committed by intellij-monorepo-bot
parent c94235eef2
commit 775802f98c
2 changed files with 3 additions and 3 deletions
@@ -282,8 +282,8 @@ public class ComponentPanelBuilder implements GridBagPanelBuilder {
"a:active {color:#" + ColorUtil.toHex(JBUI.CurrentTheme.Link.linkPressedColor()) + ";}\n" +
//"body {background-color:#" + ColorUtil.toHex(JBColor.YELLOW) + ";}\n" + // Left for visual debugging
"</style>\n</head>";
if (commentText.length() > maxLineLength && isCommentBelow) {
int width = component.getFontMetrics(component.getFont()).stringWidth(commentText.substring(0, 70));
if (maxLineLength > 0 && commentText.length() > maxLineLength && isCommentBelow) {
int width = component.getFontMetrics(component.getFont()).stringWidth(commentText.substring(0, maxLineLength));
component.setText(String.format("<html>" + css + "<body><div width=%d>%s</div></body></html>", width, commentText));
}
else {
@@ -62,7 +62,7 @@ interface RowBuilder : BaseBuilder {
}
fun commentRow(text: String) {
createNoteOrCommentRow(ComponentPanelBuilder.createCommentComponent(text, true))
createNoteOrCommentRow(ComponentPanelBuilder.createCommentComponent(text, true, -1))
}
}