Added double click support to All Decks list and fixed hover bug

This commit is contained in:
drdev
2013-07-27 22:50:02 +00:00
parent 412b7501e5
commit 0c9a29000e
2 changed files with 16 additions and 4 deletions

View File

@@ -8,10 +8,14 @@ Forge Beta: 07-##-2013 ver 1.4.4
Release Notes
-------------
-All Decks updates-
Can double click row for deck to open it (in addition to clicking edit icon)
Fixed bug where hover effect didn't work the first time hovering over a row that had just been deselected
-Improvements to color/card Type filters
You can now right-click on a color filter button to show only cards of that color, filtering out all other colors. Similar with card type filter buttons.
In addition, fixed bug where middle and right clicking buttons did the same behavior as left clicking, and fixed bug where clicking multiple buttons quickly (such as filters) while moving the mouse around would result in clicks not registering sometimes.
Fixed bug where middle and right clicking buttons did the same behavior as left clicking, and fixed bug where clicking multiple buttons quickly (such as filters) while moving the mouse around would result in clicks not registering sometimes.
- Card Zoomer -

View File

@@ -276,6 +276,7 @@ public class DeckLister extends JPanel implements ILocalRepaint {
private class RowPanel extends JPanel {
private boolean selected = false;
private boolean hovered = false;
private final Deck deck;
public RowPanel(final Deck d0) {
@@ -289,6 +290,7 @@ public class DeckLister extends JPanel implements ILocalRepaint {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(final MouseEvent e) {
RowPanel.this.hovered = true;
if (!RowPanel.this.selected) {
((RowPanel) e.getSource()).setBackground(DeckLister.this.clrHover);
((RowPanel) e.getSource()).setOpaque(true);
@@ -297,6 +299,7 @@ public class DeckLister extends JPanel implements ILocalRepaint {
@Override
public void mouseExited(final MouseEvent e) {
RowPanel.this.hovered = false;
if (!RowPanel.this.selected) {
((RowPanel) e.getSource()).setBackground(DeckLister.this.clrDefault);
((RowPanel) e.getSource()).setOpaque(false);
@@ -305,15 +308,20 @@ public class DeckLister extends JPanel implements ILocalRepaint {
@Override
public void mousePressed(final MouseEvent e) {
if (e.getClickCount() == 1) {
DeckLister.this.selectHandler((RowPanel) e.getSource());
}
else { //edit deck on double click
DeckLister.this.editDeck(RowPanel.this.deck);
}
}
});
}
public void setSelected(final boolean b0) {
this.selected = b0;
this.setOpaque(b0);
this.setBackground(b0 ? DeckLister.this.clrActive : DeckLister.this.clrHover);
this.setBackground(b0 ? DeckLister.this.clrActive : (this.hovered ? DeckLister.this.clrHover : DeckLister.this.clrDefault));
}
public boolean isSelected() {