forked from External/mage
Some more changes to GUI to better support high screen resolutions.
This commit is contained in:
parent
2ce5e00c6d
commit
706d319f81
25 changed files with 376 additions and 229 deletions
|
|
@ -28,6 +28,7 @@
|
|||
package mage.client.game;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
|
@ -55,6 +56,7 @@ import mage.client.dialog.PreferencesDialog;
|
|||
import static mage.client.dialog.PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE;
|
||||
import mage.client.util.FontSizeHelper;
|
||||
import mage.constants.PlayerAction;
|
||||
import mage.view.PlayerView;
|
||||
|
||||
|
|
@ -103,6 +105,8 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
addPopupMenuWatcher();
|
||||
}
|
||||
this.add(popupMenu);
|
||||
setGUISize();
|
||||
|
||||
init(player, bigCard, gameId, priorityTime);
|
||||
update(player);
|
||||
}
|
||||
|
|
@ -137,6 +141,26 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
|
||||
}
|
||||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
battlefieldPanel.changeGUISize();
|
||||
playerPanel.changeGUISize();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
for (Component comp : popupMenu.getComponents()) {
|
||||
if (comp instanceof JMenuItem) {
|
||||
comp.setFont(FontSizeHelper.menuFont);
|
||||
if (comp instanceof JMenu) {
|
||||
comp.setFont(FontSizeHelper.menuFont);
|
||||
for (Component subComp : ((JMenu) comp).getMenuComponents()) {
|
||||
subComp.setFont(FontSizeHelper.menuFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addPopupMenuPlayer(boolean allowRequestToShowHandCards) {
|
||||
|
||||
JMenuItem menuItem;
|
||||
|
|
@ -530,8 +554,6 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0, 0)));
|
||||
playerPanel = new PlayerPanelExt();
|
||||
btnCheat = new javax.swing.JButton();
|
||||
//jScrollPane1 = new javax.swing.JScrollPane();
|
||||
//battlefieldPanel = new mage.client.game.BattlefieldPanel(jScrollPane1);
|
||||
battlefieldPanel = new mage.client.game.BattlefieldPanel();
|
||||
|
||||
btnCheat.setText("Cheat");
|
||||
|
|
@ -542,10 +564,6 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
//jScrollPane1.setViewportView(battlefieldPanel);
|
||||
//Border empty = new EmptyBorder(0,0,0,0);
|
||||
//jScrollPane1.setBorder(empty);
|
||||
//jScrollPane1.setViewportBorder(empty);
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createSequentialGroup()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue