forked from External/mage
Some more changes to GUI to better support high screen resolutions.
This commit is contained in:
parent
1c2faaadde
commit
7ef0a0a7f0
31 changed files with 745 additions and 518 deletions
|
|
@ -115,11 +115,12 @@ import mage.client.remote.CallbackClientImpl;
|
|||
import mage.client.table.TablesPane;
|
||||
import mage.client.tournament.TournamentPane;
|
||||
import mage.client.util.EDTExceptionHandler;
|
||||
import mage.client.util.FontSizeHelper;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.SettingsManager;
|
||||
import mage.client.util.SystemUtil;
|
||||
import mage.client.util.audio.MusicPlayer;
|
||||
import mage.client.util.gui.ArrowBuilder;
|
||||
import mage.client.util.gui.countryBox.CountryUtil;
|
||||
import mage.client.util.stats.UpdateMemUsageTask;
|
||||
import mage.components.ImagePanel;
|
||||
import mage.interfaces.MageClient;
|
||||
|
|
@ -238,11 +239,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
try {
|
||||
UIManager.put("desktop", new Color(0, 0, 0, 0));
|
||||
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
|
||||
FontSizeHelper.calculateGUISizes();
|
||||
// Change default font and row size for JTables
|
||||
Font font = FontSizeHelper.getTableFont();
|
||||
UIManager.put("Table.font", font);
|
||||
UIManager.put("Table.rowHeight", FontSizeHelper.tableRowHeight);
|
||||
GUISizeHelper.calculateGUISizes();
|
||||
// UIManager.put("Table.rowHeight", GUISizeHelper.tableRowHeight);
|
||||
} catch (Exception ex) {
|
||||
LOGGER.fatal(null, ex);
|
||||
}
|
||||
|
|
@ -532,7 +530,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
MagePane window = (MagePane) windows[i];
|
||||
if (window.isVisible()) {
|
||||
menuItem = new MagePaneMenuItem(window);
|
||||
menuItem.setFont(FontSizeHelper.getToolbarFont());
|
||||
menuItem.setFont(GUISizeHelper.getToolbarFont());
|
||||
menuItem.setState(i == 0);
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
|
@ -1070,11 +1068,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
if (setActive) {
|
||||
setActive(tablesPane);
|
||||
} else // if other panel was already shown, mamke sure it's topmost again
|
||||
{
|
||||
if (topPanebefore != null) {
|
||||
if (topPanebefore != null) {
|
||||
setActive(topPanebefore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void hideGames() {
|
||||
|
|
@ -1407,6 +1403,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
|
||||
CountryUtil.changeGUISize();
|
||||
for (Component component : desktopPane.getComponents()) {
|
||||
if (component instanceof MageDialog) {
|
||||
((MageDialog) component).changeGUISize();
|
||||
|
|
@ -1415,16 +1413,15 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
((MagePane) component).changeGUISize();
|
||||
}
|
||||
}
|
||||
Font font = FontSizeHelper.getChatFont();
|
||||
for (ChatPanelBasic chatPanel : getChatPanels().values()) {
|
||||
chatPanel.changeGUISize(font);
|
||||
chatPanel.changeGUISize(GUISizeHelper.chatFont);
|
||||
}
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
Font font = FontSizeHelper.getToolbarFont();
|
||||
Font font = GUISizeHelper.getToolbarFont();
|
||||
mageToolbar.setFont(font);
|
||||
int newHeight = font.getSize() + 6;
|
||||
Dimension mageToolbarDimension = mageToolbar.getPreferredSize();
|
||||
|
|
@ -1448,7 +1445,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
component.setMaximumSize(d);
|
||||
}
|
||||
}
|
||||
balloonTip.setFont(FontSizeHelper.tooltipFont);
|
||||
balloonTip.setFont(GUISizeHelper.tooltipFont);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue