Skip to content

Arduino IDE on High DPI (take 2) #4376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Feb 9, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
08d3510
Add scaling for themed fonts and graphics (hires displays) (Paul Stof…
cmaglie Dec 29, 2015
5637130
Converted toolbar icons to png
cmaglie Dec 30, 2015
f1fc862
Added hi-res toolbar images
cmaglie Dec 30, 2015
f239f5b
Moving getLibImage and getThemeImage into Theme class
cmaglie Dec 30, 2015
967153f
Factored out scaling formula into an helper method
cmaglie Dec 30, 2015
e2fec88
Added some missing Theme.scale(..)
cmaglie Jan 2, 2016
b1964bc
Added Batik 1.8 java library
cmaglie Jan 3, 2016
ce3679d
Added vectorial version of toolbars icons
cmaglie Jan 3, 2016
d920c06
Now the IDE use vectorial images whenever possible
cmaglie Jan 3, 2016
3928b6a
Fixed a small mess in EditorHeader
cmaglie Jan 3, 2016
08ad600
Fix for some font rendering problems on linux
cmaglie Jan 3, 2016
409f316
Added GUI scaling in preference panel.
cmaglie Jan 6, 2016
2f0b0db
Set maximum scale to 400%
cmaglie Jan 12, 2016
9215c06
Installers windows are now correctly scaled.
cmaglie Jan 16, 2016
885a517
Fixed the "double" splash screen with high-DPI monitors.
cmaglie Jan 16, 2016
f235774
Split pane is now sized correctly
cmaglie Jan 16, 2016
59ec660
Fixed minimum size for a bunch of GUI elements
cmaglie Jan 17, 2016
4659c6f
Auto-scale editor and console fonts as well
cmaglie Jan 17, 2016
57c6d09
Notification pop-up is now correctly scaled
cmaglie Jan 17, 2016
328d3b6
Added hi-resolution "about" image
cmaglie Jan 26, 2016
639d991
Some small cosmetics
cmaglie Jan 17, 2016
5642c29
Fixed default initial editor size
cmaglie Jan 17, 2016
8e4ce4c
Serial monitor font is scaled too
cmaglie Feb 1, 2016
b02ce54
Removed leftover stub for testing NotificationPopup dialog
cmaglie Feb 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Installers windows are now correctly scaled.
  • Loading branch information
cmaglie committed Jan 26, 2016
commit 9215c066760ee5c475d3f4b9636786969e85326f
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import cc.arduino.contributions.libraries.ContributedLibrary;
import cc.arduino.contributions.ui.InstallerTableCell;
import processing.app.Base;
import processing.app.Theme;

public class ContributedLibraryTableCellJPanel extends JPanel {

Expand All @@ -39,7 +40,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
final JLabel statusLabel;

public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
boolean isSelected) {
boolean isSelected) {
super();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

Expand Down Expand Up @@ -217,10 +218,10 @@ private JTextPane makeNewDescription() {
Document doc = description.getDocument();
if (doc instanceof HTMLDocument) {
HTMLDocument html = (HTMLDocument) doc;
StyleSheet stylesheet = html.getStyleSheet();
stylesheet.addRule("body { margin: 0; padding: 0;"
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
+ "font-size: 100%;" + "font-size: 0.95em; }");
StyleSheet s = html.getStyleSheet();
s.addRule("body { margin: 0; padding: 0;"
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
+ "font-size: " + 10 * Theme.getScale() / 100 + "; }");
}
description.setOpaque(false);
description.setBorder(new EmptyBorder(4, 7, 7, 7));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import cc.arduino.contributions.packages.ContributedPlatform;
import cc.arduino.contributions.ui.InstallerTableCell;
import processing.app.Base;
import processing.app.Theme;

@SuppressWarnings("serial")
public class ContributedPlatformTableCellJPanel extends JPanel {
Expand Down Expand Up @@ -259,10 +260,10 @@ private JTextPane makeNewDescription() {
Document doc = description.getDocument();
if (doc instanceof HTMLDocument) {
HTMLDocument html = (HTMLDocument) doc;
StyleSheet stylesheet = html.getStyleSheet();
stylesheet.addRule("body { margin: 0; padding: 0;"
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
+ "font-size: 100%;" + "font-size: 0.95em; }");
StyleSheet s = html.getStyleSheet();
s.addRule("body { margin: 0; padding: 0;"
+ "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"
+ "font-size: " + 10 * Theme.getScale() / 100 + "; }");
}
description.setOpaque(false);
description.setBorder(new EmptyBorder(4, 7, 7, 7));
Expand Down
3 changes: 2 additions & 1 deletion app/src/cc/arduino/contributions/ui/InstallerJDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
package cc.arduino.contributions.ui;

import static processing.app.I18n.tr;
import static processing.app.Theme.scale;

import java.awt.BorderLayout;
import java.awt.Color;
Expand Down Expand Up @@ -227,7 +228,7 @@ public void keyReleased(KeyEvent keyEvent) {
}
setProgressVisible(false, "");

setMinimumSize(new Dimension(800, 450));
setMinimumSize(scale(new Dimension(800, 450)));

setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

Expand Down
5 changes: 5 additions & 0 deletions app/src/processing/app/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
Expand Down Expand Up @@ -127,6 +128,10 @@ static public int scale(int size) {
return size * getScale() / 100;
}

static public Dimension scale(Dimension dim) {
return new Dimension(scale(dim.width), scale(dim.height));
}

static public Color getColorCycleColor(String name, int i) {
int cycleSize = getInteger(name + ".size");
name = String.format("%s.%02d", name, i % cycleSize);
Expand Down