Fixed clicks in the mod lists's empty space that toggled last selected row's checkbox ( kartoFlane/Slipstream-Mod-Manager@1333914 )
This commit is contained in:
parent
80ff1f447c
commit
ccff62d261
1 changed files with 6 additions and 6 deletions
|
@ -330,24 +330,24 @@ public class ManagerFrame extends JFrame implements ActionListener, ModsScanObse
|
||||||
|
|
||||||
// Reset on first click and when no longer on that row.
|
// Reset on first click and when no longer on that row.
|
||||||
if ( e.getClickCount() == 1 ) prevRow = -1;
|
if ( e.getClickCount() == 1 ) prevRow = -1;
|
||||||
if ( thisRow != prevRow ) {
|
if ( thisRow != prevRow || thisRow == -1 ) {
|
||||||
streak = 1;
|
streak = 1;
|
||||||
prevRow = thisRow;
|
prevRow = thisRow;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
streak++;
|
streak++;
|
||||||
}
|
}
|
||||||
if ( streak % 2 != 0 ) return; // Respond to click pairs.
|
if ( streak % 2 != 0 ) return; // Respond only to click pairs.
|
||||||
|
|
||||||
// Don't further toggle a multi-clicked checkbox.
|
// Don't further toggle a multi-clicked checkbox.
|
||||||
int viewCol = localModsTable.columnAtPoint( e.getPoint() );
|
int viewCol = localModsTable.columnAtPoint( e.getPoint() );
|
||||||
int modelCol = localModsTable.getColumnModel().getColumn(viewCol).getModelIndex();
|
int modelCol = localModsTable.getColumnModel().getColumn(viewCol).getModelIndex();
|
||||||
if ( modelCol == 0 ) return;
|
if ( modelCol == 0 ) return;
|
||||||
|
|
||||||
int row = localModsTable.getSelectedRow();
|
int selRow = localModsTable.getSelectedRow();
|
||||||
if ( row != -1 ) {
|
if ( selRow != -1 ) {
|
||||||
boolean selected = localModsTableModel.isSelected( row );
|
boolean selected = localModsTableModel.isSelected( selRow );
|
||||||
localModsTableModel.setSelected( row, !selected );
|
localModsTableModel.setSelected( selRow, !selected );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue