try to fix tooltip scaling

This commit is contained in:
Ben Fry
2017-04-22 11:34:35 -04:00
parent 319af9514c
commit 8ab0ea949e
2 changed files with 16 additions and 12 deletions
+10 -10
View File
@@ -131,7 +131,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
protected CopyAsHtmlAction copyAsHtmlAction;
protected PasteAction pasteAction;
/** Menu Actions updated on the opening of the edit menu. */
protected List<UpdatableAction> editMenuUpdatable = new ArrayList<UpdatableAction>();
protected List<UpdatableAction> editMenuUpdatable = new ArrayList<>();
/** The currently selected tab's undo manager */
private UndoManager undo;
@@ -144,8 +144,8 @@ public abstract class Editor extends JFrame implements RunnerListener {
// true if inserting text, false if removing text
private boolean isInserting;
// maintain caret position during undo operations
private final Stack<Integer> caretUndoStack = new Stack<Integer>();
private final Stack<Integer> caretRedoStack = new Stack<Integer>();
private final Stack<Integer> caretUndoStack = new Stack<>();
private final Stack<Integer> caretRedoStack = new Stack<>();
private FindReplace find;
JMenu toolsMenu;
@@ -1069,7 +1069,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
sketchMenu.addMenuListener(new MenuListener() {
// Menu Listener that populates the menu only when the menu is opened
List<JMenuItem> menuList = new ArrayList<JMenuItem>();
List<JMenuItem> menuList = new ArrayList<>();
@Override
public void menuSelected(MenuEvent event) {
@@ -3162,14 +3162,14 @@ public abstract class Editor extends JFrame implements RunnerListener {
bgColorError = mode.getColor("errors.selection.error.bgcolor");
}
Color bgColor = error ? //text.startsWith(Language.text("editor.status.error")) ?
bgColorError : bgColorWarning;
String content = "<html>" +
"<div style='margin: -3 -3 -3 -3; padding: 3 3 3 3; " +
Color bgColor = error ? bgColorError : bgColorWarning;
String css =
"margin: -3 -3 -3 -3; padding: 3 3 3 3; " +
"background: #" + PApplet.hex(bgColor.getRGB(), 8).substring(2) + ";" +
"font-family: " + font.getFontName() + ", sans-serif;" +
"font-size: " + font.getSize() + "px;'>" + message + "</div></html>";
//System.out.println(content);
"font-size: " + Toolkit.zoom(font.getSize()) + "px;";
String content =
"<html> <div style='" + css + "'>" + message + "</div> </html>";
comp.setToolTipText(content);
}
+6 -2
View File
@@ -8,9 +8,9 @@ X https://github.com/processing/processing/issues/4997
X Gap between tab headers and text area at 125% and 150% scaling on Windows
X https://github.com/processing/processing/issues/4902
X Math.ceil() helps
_ Small tooltip text on high-dpi screens
X Small tooltip text on high-dpi screens
_ https://github.com/processing/processing/issues/4914
_ some line heights are wrong on hidpi
_ https://github.com/processing/processing/issues/4936
_ mode list does not update after changing sketchbook folder
@@ -52,6 +52,10 @@ X https://github.com/processing/processing/issues/4668
_ redo console handling to not use Timer, fixing freeze-up problems
_ https://github.com/processing/processing/pull/4935
_ https://github.com/processing/processing/issues/4825
_ Make the change detector not reload the sketch
_ https://github.com/processing/processing/pull/5021
_ https://github.com/processing/processing/issues/4713
X https://github.com/processing/processing/pull/4849
awaiting confirmation (fixed in 3.3)
X visual artifacts on Windows 10 when using menus