GUI, preferences: added theme switch without app restart (for preview only, app must be restarted anyway for full GUI refresh);

This commit is contained in:
Oleg Agafonov 2024-07-03 04:31:07 +04:00
parent e3dee4eac1
commit 64f3df035b
10 changed files with 234 additions and 135 deletions

View file

@ -163,15 +163,6 @@ public final class UI {
}
}
public static void setSystemLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex) {
System.err.println("Error setting look and feel:");
ex.printStackTrace();
}
}
public static void setDefaultFont(Font font) {
for (Object key : Collections.list(UIManager.getDefaults().keys())) {
Object value = UIManager.get(key);

View file

@ -721,7 +721,7 @@ public class CardPluginImpl implements CardPlugin {
LOGGER.info("Symbols download finished");
dialog.dispose();
ManaSymbols.loadImages();
GUISizeHelper.refreshGUIAndCards();
GUISizeHelper.refreshGUIAndCards(false);
}
}
}

View file

@ -713,7 +713,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
enableDialogButtons();
// reset GUI and cards to use new images
GUISizeHelper.refreshGUIAndCards();
GUISizeHelper.refreshGUIAndCards(false);
}
static String convertStreamToString(InputStream is) {