Skip to content

Commit 9bc39e6

Browse files
committed
try to fix tooltip scaling
1 parent cd16342 commit 9bc39e6

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

app/src/processing/app/ui/Editor.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
131131
protected CopyAsHtmlAction copyAsHtmlAction;
132132
protected PasteAction pasteAction;
133133
/** Menu Actions updated on the opening of the edit menu. */
134-
protected List<UpdatableAction> editMenuUpdatable = new ArrayList<UpdatableAction>();
134+
protected List<UpdatableAction> editMenuUpdatable = new ArrayList<>();
135135

136136
/** The currently selected tab's undo manager */
137137
private UndoManager undo;
@@ -144,8 +144,8 @@ public abstract class Editor extends JFrame implements RunnerListener {
144144
// true if inserting text, false if removing text
145145
private boolean isInserting;
146146
// maintain caret position during undo operations
147-
private final Stack<Integer> caretUndoStack = new Stack<Integer>();
148-
private final Stack<Integer> caretRedoStack = new Stack<Integer>();
147+
private final Stack<Integer> caretUndoStack = new Stack<>();
148+
private final Stack<Integer> caretRedoStack = new Stack<>();
149149

150150
private FindReplace find;
151151
JMenu toolsMenu;
@@ -1069,7 +1069,7 @@ public void actionPerformed(ActionEvent e) {
10691069

10701070
sketchMenu.addMenuListener(new MenuListener() {
10711071
// Menu Listener that populates the menu only when the menu is opened
1072-
List<JMenuItem> menuList = new ArrayList<JMenuItem>();
1072+
List<JMenuItem> menuList = new ArrayList<>();
10731073

10741074
@Override
10751075
public void menuSelected(MenuEvent event) {
@@ -3162,14 +3162,14 @@ public void statusToolTip(JComponent comp, String message, boolean error) {
31623162
bgColorError = mode.getColor("errors.selection.error.bgcolor");
31633163
}
31643164

3165-
Color bgColor = error ? //text.startsWith(Language.text("editor.status.error")) ?
3166-
bgColorError : bgColorWarning;
3167-
String content = "<html>" +
3168-
"<div style='margin: -3 -3 -3 -3; padding: 3 3 3 3; " +
3165+
Color bgColor = error ? bgColorError : bgColorWarning;
3166+
String css =
3167+
"margin: -3 -3 -3 -3; padding: 3 3 3 3; " +
31693168
"background: #" + PApplet.hex(bgColor.getRGB(), 8).substring(2) + ";" +
31703169
"font-family: " + font.getFontName() + ", sans-serif;" +
3171-
"font-size: " + font.getSize() + "px;'>" + message + "</div></html>";
3172-
//System.out.println(content);
3170+
"font-size: " + Toolkit.zoom(font.getSize()) + "px;";
3171+
String content =
3172+
"<html> <div style='" + css + "'>" + message + "</div> </html>";
31733173
comp.setToolTipText(content);
31743174
}
31753175

todo.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ X https://github.com/processing/processing/issues/4997
88
X Gap between tab headers and text area at 125% and 150% scaling on Windows
99
X https://github.com/processing/processing/issues/4902
1010
X Math.ceil() helps
11-
12-
_ Small tooltip text on high-dpi screens
11+
X Small tooltip text on high-dpi screens
1312
_ https://github.com/processing/processing/issues/4914
13+
1414
_ some line heights are wrong on hidpi
1515
_ https://github.com/processing/processing/issues/4936
1616
_ mode list does not update after changing sketchbook folder
@@ -52,6 +52,10 @@ X https://github.com/processing/processing/issues/4668
5252
_ redo console handling to not use Timer, fixing freeze-up problems
5353
_ https://github.com/processing/processing/pull/4935
5454
_ https://github.com/processing/processing/issues/4825
55+
_ Make the change detector not reload the sketch
56+
_ https://github.com/processing/processing/pull/5021
57+
_ https://github.com/processing/processing/issues/4713
58+
X https://github.com/processing/processing/pull/4849
5559

5660
awaiting confirmation (fixed in 3.3)
5761
X visual artifacts on Windows 10 when using menus

0 commit comments

Comments
 (0)