mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
set text style properly for Contribution Manager error message
This commit is contained in:
@@ -30,7 +30,6 @@ import java.util.*;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.*;
|
import javax.swing.event.*;
|
||||||
import javax.swing.text.*;
|
|
||||||
|
|
||||||
import processing.app.*;
|
import processing.app.*;
|
||||||
import processing.app.ui.Editor;
|
import processing.app.ui.Editor;
|
||||||
@@ -200,21 +199,24 @@ public class ContributionTab extends JPanel {
|
|||||||
layout.setAutoCreateGaps(true);
|
layout.setAutoCreateGaps(true);
|
||||||
layout.setAutoCreateContainerGaps(true);
|
layout.setAutoCreateContainerGaps(true);
|
||||||
errorPanel.setLayout(layout);
|
errorPanel.setLayout(layout);
|
||||||
// errorPanel.setBorder(BorderFactory.createMatteBorder(2, 0, 0, 0, Color.BLACK));
|
|
||||||
errorMessage = new JTextPane();
|
errorMessage = new JTextPane();
|
||||||
errorMessage.setEditable(false);
|
errorMessage.setEditable(false);
|
||||||
errorMessage.setContentType("text/html");
|
errorMessage.setContentType("text/html");
|
||||||
errorMessage.setText("<html><body>Could not connect to the Processing server.<br>"
|
errorMessage.setText("<html><body><center>Could not connect to the Processing server.<br>"
|
||||||
+ "Contributions cannot be installed or updated without an Internet connection.<br>"
|
+ "Contributions cannot be installed or updated without an Internet connection.<br>"
|
||||||
+ "Please verify your network connection again, then try connecting again.</body></html>");
|
+ "Please verify your network connection again, then try connecting again.</center></body></html>");
|
||||||
errorMessage.setFont(Toolkit.getSansFont(14, Font.PLAIN));
|
DetailPanel.setTextStyle(errorMessage, "1em");
|
||||||
errorMessage.setMaximumSize(new Dimension(550, 50));
|
Dimension dim = new Dimension(550, 60);
|
||||||
|
errorMessage.setMaximumSize(dim);
|
||||||
|
errorMessage.setMinimumSize(dim);
|
||||||
errorMessage.setOpaque(false);
|
errorMessage.setOpaque(false);
|
||||||
|
|
||||||
|
/*
|
||||||
StyledDocument doc = errorMessage.getStyledDocument();
|
StyledDocument doc = errorMessage.getStyledDocument();
|
||||||
SimpleAttributeSet center = new SimpleAttributeSet();
|
SimpleAttributeSet center = new SimpleAttributeSet();
|
||||||
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
|
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
|
||||||
doc.setParagraphAttributes(0, doc.getLength(), center, false);
|
doc.setParagraphAttributes(0, doc.getLength(), center, false);
|
||||||
|
*/
|
||||||
|
|
||||||
closeButton = Toolkit.createIconButton("manager/close");
|
closeButton = Toolkit.createIconButton("manager/close");
|
||||||
closeButton.setContentAreaFilled(false);
|
closeButton.setContentAreaFilled(false);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class DetailPanel extends JPanel {
|
|||||||
margin.bottom = 0;
|
margin.bottom = 0;
|
||||||
descriptionPane.setMargin(margin);
|
descriptionPane.setMargin(margin);
|
||||||
descriptionPane.setContentType("text/html");
|
descriptionPane.setContentType("text/html");
|
||||||
setTextStyle(descriptionPane);
|
setTextStyle(descriptionPane, "0.95em");
|
||||||
descriptionPane.setOpaque(false);
|
descriptionPane.setOpaque(false);
|
||||||
if (UIManager.getLookAndFeel().getID().equals("Nimbus")) {
|
if (UIManager.getLookAndFeel().getID().equals("Nimbus")) {
|
||||||
descriptionPane.setBackground(new Color(0, 0, 0, 0));
|
descriptionPane.setBackground(new Color(0, 0, 0, 0));
|
||||||
@@ -714,7 +714,7 @@ class DetailPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void setTextStyle(JTextPane textPane) {
|
static void setTextStyle(JTextPane textPane, String fontSize) {
|
||||||
Document doc = textPane.getDocument();
|
Document doc = textPane.getDocument();
|
||||||
if (doc instanceof HTMLDocument) {
|
if (doc instanceof HTMLDocument) {
|
||||||
HTMLDocument html = (HTMLDocument) doc;
|
HTMLDocument html = (HTMLDocument) doc;
|
||||||
@@ -722,7 +722,7 @@ class DetailPanel extends JPanel {
|
|||||||
stylesheet.addRule("body { " +
|
stylesheet.addRule("body { " +
|
||||||
" margin: 0; padding: 0;" +
|
" margin: 0; padding: 0;" +
|
||||||
" font-family: " + Toolkit.getSansFontName() + ", Arial, Helvetica, sans-serif;" +
|
" font-family: " + Toolkit.getSansFontName() + ", Arial, Helvetica, sans-serif;" +
|
||||||
" font-size: 100%;" + "font-size: 0.95em; " +
|
" font-size: 100%;" + "font-size: " + fontSize + "; " +
|
||||||
"}");
|
"}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
0256 (3.2.4 or 3.3)
|
0256 (3.2.4 or 3.3)
|
||||||
|
X only require reference.zip (and internet connection) when building dist
|
||||||
|
X set text style properly for Contribution Manager error message
|
||||||
|
|
||||||
|
|
||||||
_ fix appbundler problems due to rollback
|
_ fix appbundler problems due to rollback
|
||||||
|
|||||||
Reference in New Issue
Block a user