mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
EditDialog: Better behaviour when pressing escape key in dock mode
See issue #441.
This commit is contained in:
@@ -63,6 +63,18 @@ void EditDialog::showEvent(QShowEvent*)
|
||||
}
|
||||
}
|
||||
|
||||
void EditDialog::reject()
|
||||
{
|
||||
// This is called when pressing the cancel button or hitting the escape key
|
||||
|
||||
// If we're in dock mode, move the cursor back to the table view.
|
||||
// If we're in window mode, call the default implementation to just close the window normally.
|
||||
if(useInDock)
|
||||
emit goingAway();
|
||||
else
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
void EditDialog::loadText(const QByteArray& data, int row, int col)
|
||||
{
|
||||
curRow = row;
|
||||
|
||||
@@ -24,6 +24,7 @@ public slots:
|
||||
virtual void reset();
|
||||
virtual void loadText(const QByteArray& data, int row, int col);
|
||||
virtual void setFocus();
|
||||
virtual void reject();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent* ev);
|
||||
|
||||
@@ -751,6 +751,7 @@ void MainWindow::editWinAway()
|
||||
|
||||
// Update main window
|
||||
activateWindow();
|
||||
ui->dataTable->setFocus();
|
||||
ui->dataTable->setCurrentIndex(ui->dataTable->currentIndex().sibling(sendingEditDialog->getCurrentRow(), sendingEditDialog->getCurrentCol()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user