mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
GUI enchancements (themes, sound notification, deck validation) (#6755)
GUI enchancements (themes, sound notification, deck validation)
This commit is contained in:
parent
8c4c2728d6
commit
99d5eafc8a
128 changed files with 1988 additions and 11320 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue