Esc and ctrl+Q decide if quit/hide the app based on config
Signed-off-by: Albert S <mail@quitesimple.org>
Dieser Commit ist enthalten in:
Ursprung
a900fe5b6c
Commit
19114a0b5d
11
window.cpp
11
window.cpp
@ -124,6 +124,11 @@ void Window::populateGrid(const QVector<EntryPushButton *> &list)
|
||||
void Window::buttonClick(const EntryPushButton &config)
|
||||
{
|
||||
QProcess::startDetached(config.getCommand(), config.getArguments());
|
||||
this->closeWindow();
|
||||
}
|
||||
|
||||
void Window::closeWindow()
|
||||
{
|
||||
if(configProvider->singleInstanceMode())
|
||||
{
|
||||
this->lineEdit->setText("");
|
||||
@ -275,10 +280,10 @@ void Window::keyReleaseEvent(QKeyEvent *event)
|
||||
}
|
||||
void Window::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
bool quit = ((event->modifiers() & Qt::ControlModifier && event->key() == Qt::Key_Q) || event->key() == Qt::Key_Escape);
|
||||
if(quit)
|
||||
bool closeWindow = ((event->modifiers() & Qt::ControlModifier && event->key() == Qt::Key_Q) || event->key() == Qt::Key_Escape);
|
||||
if(closeWindow)
|
||||
{
|
||||
qApp->quit();
|
||||
this->closeWindow();
|
||||
}
|
||||
|
||||
if(event->modifiers() & Qt::ControlModifier && buttonsInGrid.count() > 0)
|
||||
|
1
window.h
1
window.h
@ -66,6 +66,7 @@ private:
|
||||
void addCalcResult(const QString & expression);
|
||||
void initTreeWidgets();
|
||||
QStringList generatePATHSuggestions(const QString &text);
|
||||
void closeWindow();
|
||||
private slots:
|
||||
void lineEditReturnPressed();
|
||||
void showCalculationResultContextMenu(const QPoint &point);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren