mirror of https://github.com/odrling/Aegisub
Do something with how keyboard and mouse selection in the grid works. This should make behaviour slightly more sensible and even fix #1347. Wooh.
Originally committed to SVN as r5764.
This commit is contained in:
parent
04249816fb
commit
e1427ee08b
|
@ -182,8 +182,9 @@ void BaseGrid::SelectRow(int row, bool addToSelected, bool select) {
|
||||||
if (select != cur) {
|
if (select != cur) {
|
||||||
selMap.at(row) = select;
|
selMap.at(row) = select;
|
||||||
|
|
||||||
if (!addToSelected) Refresh(false);
|
if (!addToSelected) {
|
||||||
|
Refresh(false);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
int w = 0;
|
int w = 0;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
|
@ -664,9 +665,6 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable extending
|
|
||||||
extendRow = -1;
|
|
||||||
|
|
||||||
// Toggle selected
|
// Toggle selected
|
||||||
if (left_up && ctrl && !shift && !alt) {
|
if (left_up && ctrl && !shift && !alt) {
|
||||||
SelectRow(row,true,!IsInSelection(row,0));
|
SelectRow(row,true,!IsInSelection(row,0));
|
||||||
|
@ -679,6 +677,7 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) {
|
||||||
if (click || dclick) {
|
if (click || dclick) {
|
||||||
SelectRow(row,false);
|
SelectRow(row,false);
|
||||||
parentFrame->UpdateToolbar();
|
parentFrame->UpdateToolbar();
|
||||||
|
extendRow = -1;
|
||||||
}
|
}
|
||||||
if (left_up || dclick) {
|
if (left_up || dclick) {
|
||||||
int old = editBox->linen;
|
int old = editBox->linen;
|
||||||
|
@ -703,6 +702,9 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) {
|
||||||
// Block select
|
// Block select
|
||||||
if ((left_up && shift && !alt) || (holding && !ctrl && !alt && !shift)) {
|
if ((left_up && shift && !alt) || (holding && !ctrl && !alt && !shift)) {
|
||||||
if (lastRow != -1) {
|
if (lastRow != -1) {
|
||||||
|
// Keyboard selection continues from where the mouse was last used
|
||||||
|
extendRow = lastRow;
|
||||||
|
|
||||||
// Set boundaries
|
// Set boundaries
|
||||||
int i1 = row;
|
int i1 = row;
|
||||||
int i2 = lastRow;
|
int i2 = lastRow;
|
||||||
|
|
Loading…
Reference in New Issue