forked from External/mage
Added tooltip to window titel bar to show longer titels of windows at least as tooltip.
This commit is contained in:
parent
baedfd54bf
commit
facfc6f1ce
4 changed files with 26 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ public class ExileZoneDialog extends MageDialog {
|
||||||
|
|
||||||
public void loadCards(ExileView exile, BigCard bigCard, UUID gameId) {
|
public void loadCards(ExileView exile, BigCard bigCard, UUID gameId) {
|
||||||
this.title = exile.getName();
|
this.title = exile.getName();
|
||||||
|
this.setTitelBarToolTip(exile.getName());
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
changed = cards.loadCards(exile, bigCard, gameId);
|
changed = cards.loadCards(exile, bigCard, gameId);
|
||||||
if (exile.size() > 0) {
|
if (exile.size() > 0) {
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,29 @@ public class MageDialog extends javax.swing.JInternalFrame {
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTitelBarToolTip(final String text) {
|
||||||
|
desktopIcon.setToolTipText(text); //tooltip on icon
|
||||||
|
Component[] children = desktopIcon.getComponents();
|
||||||
|
// if (children != null) {
|
||||||
|
// for(int i = 0; i < children.length; i++) {
|
||||||
|
// if (children[i] instanceof JButton){
|
||||||
|
// ((JButton)children[i]).setToolTipText(text);//tooltip on icon button
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
children = getComponents();
|
||||||
|
if (children != null) {
|
||||||
|
for(int i = 0; i < children.length; i++) {
|
||||||
|
if (children[i].getClass().getName().equalsIgnoreCase(
|
||||||
|
"javax.swing.plaf.synth.SynthInternalFrameTitlePane")){
|
||||||
|
((JComponent)children[i]).setToolTipText(text);//tooltip on title bar
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
* initialize the form.
|
* initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
|
||||||
public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map<String, Serializable> options) {
|
public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map<String, Serializable> options) {
|
||||||
this.reloaded = true;
|
this.reloaded = true;
|
||||||
this.title = name;
|
this.title = name;
|
||||||
|
this.setTitelBarToolTip(name);
|
||||||
cardArea.loadCards(showCards, bigCard, dimension, gameId, this);
|
cardArea.loadCards(showCards, bigCard, dimension, gameId, this);
|
||||||
if (options != null) {
|
if (options != null) {
|
||||||
if (options.containsKey("chosen")) {
|
if (options.containsKey("chosen")) {
|
||||||
|
|
|
||||||
|
|
@ -539,7 +539,7 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
ShowCardsDialog newReveal = new ShowCardsDialog();
|
ShowCardsDialog newReveal = new ShowCardsDialog();
|
||||||
lookedAt.put(looked.getName(), newReveal);
|
lookedAt.put(looked.getName(), newReveal);
|
||||||
}
|
}
|
||||||
lookedAt.get(looked.getName()).loadCards("LookedAt by " + looked.getName(), looked.getCards(), bigCard, Config.dimensions, gameId, false);
|
lookedAt.get(looked.getName()).loadCards("Looked at by " + looked.getName(), looked.getCards(), bigCard, Config.dimensions, gameId, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue