forked from External/mage
- added GUI scale support for dialog titles; - added GUI scale support for hints tool; - fixed broken font in chat and game logs on settings change; - fixed wrong size of pick choice dialog in some use cases;
This commit is contained in:
parent
1578ab7946
commit
8186b35dfb
9 changed files with 56 additions and 26 deletions
|
|
@ -24,6 +24,7 @@ public class ColorPane extends MageEditorPane {
|
|||
* @param color
|
||||
*/
|
||||
public void setExtBackgroundColor(Color color) {
|
||||
// TODO: research, maybe no needs in good opaque + background settings
|
||||
setBackground(new Color(0, 0, 0, 0));
|
||||
JPanel jPanel = new JPanel();
|
||||
jPanel.setBackground(color);
|
||||
|
|
@ -32,6 +33,7 @@ public class ColorPane extends MageEditorPane {
|
|||
}
|
||||
|
||||
public void setExtBackgroundColor(BackgroundPainter backgroundPainter) {
|
||||
// TODO: research, maybe no needs in good opaque + background settings
|
||||
setBackground(new Color(0, 0, 0, 0));
|
||||
JXPanel jPanel = new JXPanel();
|
||||
jPanel.setBackgroundPainter(backgroundPainter);
|
||||
|
|
@ -46,6 +48,7 @@ public class ColorPane extends MageEditorPane {
|
|||
*/
|
||||
@Override
|
||||
public void paintChildren(Graphics g) {
|
||||
// TODO: research, maybe no needs in good opaque + background settings
|
||||
super.paintComponent(g);
|
||||
}
|
||||
|
||||
|
|
@ -56,6 +59,7 @@ public class ColorPane extends MageEditorPane {
|
|||
*/
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
// TODO: research, maybe no needs in good opaque + background settings
|
||||
super.paintChildren(g);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ import mage.view.PlaneView;
|
|||
import javax.swing.*;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import javax.swing.text.*;
|
||||
import javax.swing.text.html.*;
|
||||
import javax.swing.text.html.CSS;
|
||||
import javax.swing.text.html.HTML;
|
||||
import javax.swing.text.html.HTMLDocument;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
|
@ -52,6 +55,19 @@ public class MageEditorPane extends JEditorPane {
|
|||
|
||||
// improved style: browser's url style with underline on mouse over and hand cursor
|
||||
kit.getStyleSheet().addRule(" a { text-decoration: none; } ");
|
||||
|
||||
changeGUISize(this.getFont());
|
||||
}
|
||||
|
||||
public void changeGUISize(Font font) {
|
||||
this.setFont(font);
|
||||
|
||||
// workaround to change editor's font at runtime
|
||||
String bodyRule = "body { "
|
||||
+ " font-family: " + font.getFamily() + "; "
|
||||
+ " font-size: " + font.getSize() + "pt; "
|
||||
+ "}";
|
||||
kit.getStyleSheet().addRule(bodyRule);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -264,6 +280,4 @@ public class MageEditorPane extends JEditorPane {
|
|||
hyperlinkEnabled = true;
|
||||
addHyperlinkHandlers();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue