mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-08 03:59:18 +02:00
Merge bitcoin-core/gui#493: qt: Handle Android back key in the Node window
a56a1049380b0acb532681484fbb675c3b2ff365 qt: Handle Android back key in the Node window (Hennadii Stepanov)
f045f987171c3960c12813538b9f19a54a50b4f8 qt, android: Add GUIUtil::IsEscapeOrBack helper (Hennadii Stepanov)
Pull request description:
On master (4633199cc8a466b8a2cfa14ba9d7793dd4c469f4) there are no means to return from the Node window to the main one on Android.
This PR assigns this functionality to the Android back key:

ACKs for top commit:
icota:
utACK a56a104938
Tree-SHA512: 379c1ad8c6bffa037e861b88c66eb33872d7f7d54aa2f76289a51c55d79a37a0c16262b20f22d00fda11522c7df1f3561c1ceae34cd7a85da94aee4c6cdcfaaf
This commit is contained in:
commit
ea989deecc
@ -428,6 +428,15 @@ namespace GUIUtil
|
||||
*/
|
||||
void ShowModalDialogAndDeleteOnClose(QDialog* dialog);
|
||||
|
||||
inline bool IsEscapeOrBack(int key)
|
||||
{
|
||||
if (key == Qt::Key_Escape) return true;
|
||||
#ifdef Q_OS_ANDROID
|
||||
if (key == Qt::Key_Back) return true;
|
||||
#endif // Q_OS_ANDROID
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace GUIUtil
|
||||
|
||||
#endif // BITCOIN_QT_GUIUTIL_H
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <netbase.h>
|
||||
#include <qt/bantablemodel.h>
|
||||
#include <qt/clientmodel.h>
|
||||
#include <qt/guiutil.h>
|
||||
#include <qt/peertablesortproxy.h>
|
||||
#include <qt/platformstyle.h>
|
||||
#include <qt/walletmodel.h>
|
||||
@ -910,8 +911,7 @@ void RPCConsole::clear(bool keep_prompt)
|
||||
|
||||
void RPCConsole::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
|
||||
{
|
||||
if (windowType() != Qt::Widget && GUIUtil::IsEscapeOrBack(event->key())) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user