* GUI: fixed missing horizontal scrollbar in deck editor for small screens, fixed overlapped deck validate panel for small screens (#6881, #6854);

This commit is contained in:
Oleg Agafonov 2020-07-25 15:27:17 +04:00
parent 939bdc292c
commit 24aacaafe8
2 changed files with 129 additions and 51 deletions

View file

@ -19,7 +19,7 @@
<Group type="102" alignment="0" attributes="0">
<Component id="panelLeft" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="panelRight" pref="890" max="32767" attributes="0"/>
<Component id="panelRight" pref="883" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -66,24 +66,17 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelDeck" alignment="1" max="32767" attributes="0"/>
<Component id="bigCard" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="deckLegalityDisplay" min="-2" pref="245" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="panelDeck" max="32767" attributes="0"/>
<Component id="scrollPaneInfo" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="panelDeck" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="62" max="-2" attributes="0"/>
<Component id="deckLegalityDisplay" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="scrollPaneInfo" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -97,8 +90,6 @@
<AuxValue name="JavaCodeGenerator_DeclarationPre" type="java.lang.String" value="private JComponent cardInfoPane;&#xa;/*"/>
</AuxValues>
</Component>
<Component class="mage.client.cards.BigCard" name="bigCard">
</Component>
<Container class="javax.swing.JPanel" name="panelDeck">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
@ -120,7 +111,7 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="lblDeckName" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtDeckName" pref="184" max="32767" attributes="0"/>
<Component id="txtDeckName" pref="205" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -166,7 +157,7 @@
<Component id="btnNew" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnGenDeck" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace pref="49" max="32767" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -223,7 +214,7 @@
<Component id="btnLoad" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnImport" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace pref="49" max="32767" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -280,7 +271,7 @@
<Component id="btnSave" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnExport" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace pref="49" max="32767" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -337,7 +328,7 @@
<Component id="btnSubmit" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnSubmitTimer" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace pref="49" max="32767" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -402,7 +393,7 @@
<Component id="btnAddLand" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnLegality" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace pref="49" max="32767" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -458,7 +449,7 @@
<Component id="btnExit" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtTimeRemaining" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace pref="49" max="32767" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -493,6 +484,52 @@
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="scrollPaneInfo">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="panelInfo">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="bigCard" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="deckLegalityDisplay" min="-2" pref="245" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="deckLegalityDisplay" min="-2" pref="155" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="mage.client.deckeditor.DeckLegalityPanel" name="deckLegalityDisplay">
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@ -507,6 +544,12 @@
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="deckLegalityDisplay.setVisible(false);"/>
</AuxValues>
</Component>
<Component class="mage.client.cards.BigCard" name="bigCard">
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>

View file

@ -172,6 +172,11 @@ public class DeckEditorPanel extends javax.swing.JPanel {
this.mode = mode;
this.btnAddLand.setVisible(false);
// workaround to enable real opaque in scrollbar pane (transparent panel) and remove scroll pane border
scrollPaneInfo.getViewport().setOpaque(false);
scrollPaneInfo.setBorder(BorderFactory.createEmptyBorder());
scrollPaneInfo.setViewportBorder(BorderFactory.createEmptyBorder());
restoreDividerLocationsAndDeckAreaSettings();
switch (mode) {
case LIMITED_BUILDING:
@ -855,7 +860,6 @@ public class DeckEditorPanel extends javax.swing.JPanel {
cardInfoPane = new JLabel();
cardInfoPane.setVisible(false);
}
bigCard = new mage.client.cards.BigCard();
panelDeck = new javax.swing.JPanel();
panelDeckName = new javax.swing.JPanel();
lblDeckName = new javax.swing.JLabel();
@ -878,7 +882,10 @@ public class DeckEditorPanel extends javax.swing.JPanel {
panelDeckExit = new javax.swing.JPanel();
btnExit = new javax.swing.JButton();
txtTimeRemaining = new javax.swing.JTextField();
scrollPaneInfo = new javax.swing.JScrollPane();
panelInfo = new javax.swing.JPanel();
deckLegalityDisplay = new mage.client.deckeditor.DeckLegalityPanel();
bigCard = new mage.client.cards.BigCard();
panelRight.setDividerSize(10);
panelRight.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
@ -905,7 +912,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addContainerGap()
.addComponent(lblDeckName)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtDeckName, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)
.addComponent(txtDeckName, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
.addContainerGap())
);
panelDeckNameLayout.setVerticalGroup(
@ -949,7 +956,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnNew, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnGenDeck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(49, Short.MAX_VALUE))
.addContainerGap(70, Short.MAX_VALUE))
);
panelDeckCreateLayout.setVerticalGroup(
panelDeckCreateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -992,7 +999,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnLoad, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnImport, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(49, Short.MAX_VALUE))
.addContainerGap(70, Short.MAX_VALUE))
);
panelDeckLoadLayout.setVerticalGroup(
panelDeckLoadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1035,7 +1042,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnExport, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(49, Short.MAX_VALUE))
.addContainerGap(70, Short.MAX_VALUE))
);
panelDeckSaveLayout.setVerticalGroup(
panelDeckSaveLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1080,7 +1087,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnSubmit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSubmitTimer, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(49, Short.MAX_VALUE))
.addContainerGap(70, Short.MAX_VALUE))
);
panelDeckDraftLayout.setVerticalGroup(
panelDeckDraftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1126,7 +1133,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnAddLand, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnLegality, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(49, Short.MAX_VALUE))
.addContainerGap(70, Short.MAX_VALUE))
);
panelDeckLandsLayout.setVerticalGroup(
panelDeckLandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1165,7 +1172,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtTimeRemaining, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(49, Short.MAX_VALUE))
.addContainerGap(70, Short.MAX_VALUE))
);
panelDeckExitLayout.setVerticalGroup(
panelDeckExitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1178,30 +1185,56 @@ public class DeckEditorPanel extends javax.swing.JPanel {
panelDeck.add(panelDeckExit);
scrollPaneInfo.setBorder(null);
scrollPaneInfo.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPaneInfo.setOpaque(false);
panelInfo.setOpaque(false);
deckLegalityDisplay.setMaximumSize(new java.awt.Dimension(245, 155));
deckLegalityDisplay.setMinimumSize(new java.awt.Dimension(85, 155));
deckLegalityDisplay.setOpaque(false);
deckLegalityDisplay.setVisible(false);
javax.swing.GroupLayout panelInfoLayout = new javax.swing.GroupLayout(panelInfo);
panelInfo.setLayout(panelInfoLayout);
panelInfoLayout.setHorizontalGroup(
panelInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelInfoLayout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(panelInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(bigCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelInfoLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(deckLegalityDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(15, 15, 15))
);
panelInfoLayout.setVerticalGroup(
panelInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelInfoLayout.createSequentialGroup()
.addContainerGap()
.addComponent(deckLegalityDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
scrollPaneInfo.setViewportView(panelInfo);
javax.swing.GroupLayout panelLeftLayout = new javax.swing.GroupLayout(panelLeft);
panelLeft.setLayout(panelLeftLayout);
panelLeftLayout.setHorizontalGroup(
panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelDeck, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bigCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLeftLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(deckLegalityDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(panelDeck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(scrollPaneInfo)
);
panelLeftLayout.setVerticalGroup(
panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelLeftLayout.createSequentialGroup()
.addComponent(panelDeck, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(62, 62, 62)
.addComponent(deckLegalityDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(63, 63, 63)
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(scrollPaneInfo)
.addContainerGap())
);
@ -1212,7 +1245,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addComponent(panelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(panelRight, javax.swing.GroupLayout.DEFAULT_SIZE, 890, Short.MAX_VALUE))
.addComponent(panelRight, javax.swing.GroupLayout.DEFAULT_SIZE, 883, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1445,8 +1478,10 @@ public class DeckEditorPanel extends javax.swing.JPanel {
private javax.swing.JPanel panelDeckLoad;
private javax.swing.JPanel panelDeckName;
private javax.swing.JPanel panelDeckSave;
private javax.swing.JPanel panelInfo;
private javax.swing.JPanel panelLeft;
private javax.swing.JSplitPane panelRight;
private javax.swing.JScrollPane scrollPaneInfo;
private javax.swing.JTextField txtDeckName;
private javax.swing.JTextField txtTimeRemaining;
// End of variables declaration//GEN-END:variables