mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UI DSL: Don't restrict max line length of commentRow
GitOrigin-RevId: 987a8e59f2243c2aa3e686471c66aae29d59ce3f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c94235eef2
commit
775802f98c
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user