mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Installers windows are now correctly scaled.
This commit is contained in:
parent
2f0b0db5ba
commit
9215c06676
@ -26,6 +26,7 @@ import cc.arduino.contributions.DownloadableContributionVersionComparator;
|
||||
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 {
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -217,10 +218,10 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
|
||||
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));
|
||||
|
@ -57,6 +57,7 @@ import cc.arduino.contributions.packages.ContributedHelp;
|
||||
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 {
|
||||
@ -259,10 +260,10 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
|
||||
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));
|
||||
|
@ -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;
|
||||
@ -227,7 +228,7 @@ public abstract class InstallerJDialog<T> extends JDialog {
|
||||
}
|
||||
setProgressVisible(false, "");
|
||||
|
||||
setMinimumSize(new Dimension(800, 450));
|
||||
setMinimumSize(scale(new Dimension(800, 450)));
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
|
@ -25,6 +25,7 @@ import static processing.app.I18n.tr;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
@ -127,6 +128,10 @@ public class Theme {
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user