GUI enchancements (themes, sound notification, deck validation) (#6755)

GUI enchancements (themes, sound notification, deck validation)
This commit is contained in:
18ths 2020-07-17 19:15:02 +02:00 committed by GitHub
parent 8c4c2728d6
commit 99d5eafc8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
128 changed files with 1988 additions and 11320 deletions

View file

@ -200,9 +200,17 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
TConfig config = TConfig.current();
config.setArchiveDetector(new TArchiveDetector("zip"));
config.setAccessPreference(FsAccessOption.STORE, true);
try {
UIManager.put("desktop", new Color(0, 0, 0, 0));
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.put("nimbusBlueGrey", PreferencesDialog.getCurrentTheme().getNimbusBlueGrey()); // buttons, scrollbar background, disabled inputs
UIManager.put("control", PreferencesDialog.getCurrentTheme().getControl()); // window bg
UIManager.put("nimbusLightBackground", PreferencesDialog.getCurrentTheme().getNimbusLightBackground()); // inputs, table rows
UIManager.put("info", PreferencesDialog.getCurrentTheme().getInfo()); // tooltips
UIManager.put("nimbusBase", PreferencesDialog.getCurrentTheme().getNimbusBase()); // title bars, scrollbar foreground
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// stop JSplitPane from eating F6 and F8 or any other function keys
{
@ -445,16 +453,19 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}
}
// Sets background for login screen
private void setBackground() {
if (liteMode || grayMode) {
return;
}
String filename = "/background.jpg";
try {
if (Plugins.instance.isThemePluginLoaded()) {
// If user has custom background, use that, otherwise, use theme background
if (Plugins.instance.isThemePluginLoaded() &&
!PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BACKGROUND_IMAGE_DEFAULT, "true").equals("true")) {
backgroundPane = (ImagePanel) Plugins.instance.updateTablePanel(new HashMap<>());
} else {
InputStream is = this.getClass().getResourceAsStream(filename);
InputStream is = this.getClass().getResourceAsStream(PreferencesDialog.getCurrentTheme().getLoginBackgroundPath());
BufferedImage background = ImageIO.read(is);
backgroundPane = new ImagePanel(background, ImagePanelStyle.SCALED);
}
@ -1020,6 +1031,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE))
);
if (PreferencesDialog.getCurrentTheme().getMageToolbar() != null) {
mageToolbar.getParent().setBackground(PreferencesDialog.getCurrentTheme().getMageToolbar());
}
pack();
}// </editor-fold>//GEN-END:initComponents