Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Dec 1, 2021

On master (4633199) 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:

Screenshot_1638395318

@hebasto
Copy link
Member Author

hebasto commented Dec 1, 2021

cc @icota

@hebasto hebasto added the Android label Dec 1, 2021
if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
{
const auto close_key =
#ifdef Q_OS_ANDROID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the #ifdef. Any way to remap this globally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icota Could you elaborate? I'm not sure about Qt::Key_Back on non-Android platforms.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One point is that this should be done globally rather than just in rpcconsole. In our case Qt::Key_Back and Qt::Key_Escape will always serve the same purpose.

It also should not be an either-or because Android phones can have keyboards hooked up to them and ChromeOS can run APKs as well.

I guess my suggestion would be something like a global macro/function that checks if its escape or back button. If this is truly the only place where we need to check for the back button then if (event->key == Qt::Key_Escape || event->key == Qt::Key_Back) is also cool.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Implemented.

@hebasto
Copy link
Member Author

hebasto commented Dec 2, 2021

Updated fe035a5 -> a56a104 (pr493.01 -> pr493.02).

@icota

I guess my suggestion would be something like a global macro/function that checks if its escape or back button.

Done.

I didn't find other cases when Android back button does not work as expected, but maybe I just missed them.

@hebasto hebasto added the UX All about "how to get things done" label Dec 2, 2021
@icota
Copy link
Contributor

icota commented Dec 4, 2021

utACK a56a104

@hebasto hebasto merged commit ea989de into bitcoin-core:master Dec 5, 2021
@hebasto hebasto deleted the 211201-back branch December 5, 2021 00:46
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 5, 2021
…indow

a56a104 qt: Handle Android back key in the Node window (Hennadii Stepanov)
f045f98 qt, android: Add GUIUtil::IsEscapeOrBack helper (Hennadii Stepanov)

Pull request description:

  On master (4633199) 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:

  ![Screenshot_1638395318](https://user-images.githubusercontent.com/32963518/144320316-af5599ac-0379-40e6-9887-7f5ee30b97ae.png)

ACKs for top commit:
  icota:
    utACK bitcoin-core/gui@a56a104

Tree-SHA512: 379c1ad8c6bffa037e861b88c66eb33872d7f7d54aa2f76289a51c55d79a37a0c16262b20f22d00fda11522c7df1f3561c1ceae34cd7a85da94aee4c6cdcfaaf
RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
…indow

92ebecb qt: Handle Android back key in the Node window (Hennadii Stepanov)
948f896 qt, android: Add GUIUtil::IsEscapeOrBack helper (Hennadii Stepanov)

Pull request description:

  On master (0d88113) 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:

  ![Screenshot_1638395318](https://user-images.githubusercontent.com/32963518/144320316-af5599ac-0379-40e6-9887-7f5ee30b97ae.png)

ACKs for top commit:
  icota:
    utACK bitcoin-core/gui@92ebecb

Tree-SHA512: 379c1ad8c6bffa037e861b88c66eb33872d7f7d54aa2f76289a51c55d79a37a0c16262b20f22d00fda11522c7df1f3561c1ceae34cd7a85da94aee4c6cdcfaaf
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android UX All about "how to get things done"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants