mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
also scale the gap around tooltips (#4914)
This commit is contained in:
@@ -3156,18 +3156,20 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
|
||||
public void statusToolTip(JComponent comp, String message, boolean error) {
|
||||
if (font == null) {
|
||||
font = Toolkit.getSansFont(9, Font.PLAIN);
|
||||
font = Toolkit.getSansFont(Toolkit.zoom(9), Font.PLAIN);
|
||||
textColor = mode.getColor("errors.selection.fgcolor");
|
||||
bgColorWarning = mode.getColor("errors.selection.warning.bgcolor");
|
||||
bgColorError = mode.getColor("errors.selection.error.bgcolor");
|
||||
}
|
||||
|
||||
Color bgColor = error ? bgColorError : bgColorWarning;
|
||||
int m = Toolkit.zoom(3);
|
||||
String css =
|
||||
"margin: -3 -3 -3 -3; padding: 3 3 3 3; " +
|
||||
String.format("margin: %d %d %d %d; ", -m, -m, -m, -m) +
|
||||
String.format("padding: %d %d %d %d; ", m, m, m, m) +
|
||||
"background: #" + PApplet.hex(bgColor.getRGB(), 8).substring(2) + ";" +
|
||||
"font-family: " + font.getFontName() + ", sans-serif;" +
|
||||
"font-size: " + Toolkit.zoom(font.getSize()) + "px;";
|
||||
"font-size: " + font.getSize() + "px;";
|
||||
String content =
|
||||
"<html> <div style='" + css + "'>" + message + "</div> </html>";
|
||||
comp.setToolTipText(content);
|
||||
|
||||
Reference in New Issue
Block a user