Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix main window geometry save/restore #107

Closed
wants to merge 1 commit into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Oct 23, 2020

Fix #104 ?

@hebasto hebasto changed the title qt: Fix main window geometry save/restore Fix main window geometry save/restore Oct 23, 2020
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
}
settings.beginGroup("MainWindow");
resize(settings.value("size", QSize(800, 540)).toSize());
Copy link
Member

Choose a reason for hiding this comment

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

Not sure hard-coding a size in pixels is a good idea. It should auto-size based on what Qt determines is needed when a wallet is loaded (ie, all widgets visible)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a default size that is used only at first run or after -resetguisettings.

Copy link
Member

Choose a reason for hiding this comment

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

I'm aware. But the ideal default size isn't measured in pixels.

Copy link
Member Author

Choose a reason for hiding this comment

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

But the ideal default size isn't measured in pixels.

Correct. The ideal size is set by users and it will be saved in settings. I don't think the default size could be ideal for more than one person :)

Copy link
Member

Choose a reason for hiding this comment

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

Until we removed the default wallet, the default window size was automatically sane for any platform. We just need to go back to that.

Copy link
Member Author

Choose a reason for hiding this comment

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

@luke-jr Do you suggest to revert bitcoin/bitcoin#15454 back or to calculate the default window size as if a wallet is loaded?

Copy link
Member

Choose a reason for hiding this comment

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

The latter of course

Copy link
Member Author

Choose a reason for hiding this comment

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

Reworked in #116.

jonasschnelli added a commit that referenced this pull request Oct 27, 2020
…loaded wallets

7b2e42e qt: Add WalletFrame::sizeHint (Hennadii Stepanov)

Pull request description:

  This PR fixes a bug in master (d67883d) and in 0.20.1 that could be easily reproduced with
  ```
  $ src/qt/bitcoin-qt -regtest -resetguisettings -nowallet
  ```

  ![Screenshot from 2020-10-25 21-21-27](https://user-images.githubusercontent.com/32963518/97117179-b1800100-170a-11eb-87c9-3120d39b9455.png)
  ![Screenshot from 2020-10-25 21-23-32](https://user-images.githubusercontent.com/32963518/97117186-b644b500-170a-11eb-8b5d-234ff7205003.png)

  **With this PR:**

  ![Screenshot from 2020-10-25 21-20-35](https://user-images.githubusercontent.com/32963518/97117226-f441d900-170a-11eb-8d66-98b7718a2bb1.png)
  ![Screenshot from 2020-10-25 21-23-03](https://user-images.githubusercontent.com/32963518/97117232-f99f2380-170a-11eb-85ed-c7b5ece926b2.png)

  ---

  Fix #104
  Fix #113

  This PR is an alternative to #107 without [hard-coding a size in pixels](#107 (comment)).

ACKs for top commit:
  jonasschnelli:
    Tested ACK 7b2e42e - I can confirm this fixes #104 (Ubuntu 20.04 - HiDPI 200%).

Tree-SHA512: eb0692dbeb3befdeecca0e41534c9783eab6637c14cc4f170ee42619235884f9354f8d22a10c20c08cc89dc5340a60b7dfa2523c12e64b3386b3fd2c6d5f934e
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 27, 2020
… window without loaded wallets

7b2e42e qt: Add WalletFrame::sizeHint (Hennadii Stepanov)

Pull request description:

  This PR fixes a bug in master (d67883d) and in 0.20.1 that could be easily reproduced with
  ```
  $ src/qt/bitcoin-qt -regtest -resetguisettings -nowallet
  ```

  ![Screenshot from 2020-10-25 21-21-27](https://user-images.githubusercontent.com/32963518/97117179-b1800100-170a-11eb-87c9-3120d39b9455.png)
  ![Screenshot from 2020-10-25 21-23-32](https://user-images.githubusercontent.com/32963518/97117186-b644b500-170a-11eb-8b5d-234ff7205003.png)

  **With this PR:**

  ![Screenshot from 2020-10-25 21-20-35](https://user-images.githubusercontent.com/32963518/97117226-f441d900-170a-11eb-8d66-98b7718a2bb1.png)
  ![Screenshot from 2020-10-25 21-23-03](https://user-images.githubusercontent.com/32963518/97117232-f99f2380-170a-11eb-85ed-c7b5ece926b2.png)

  ---

  Fix #104
  Fix #113

  This PR is an alternative to #107 without [hard-coding a size in pixels](bitcoin-core/gui#107 (comment)).

ACKs for top commit:
  jonasschnelli:
    Tested ACK 7b2e42e - I can confirm this fixes #104 (Ubuntu 20.04 - HiDPI 200%).

Tree-SHA512: eb0692dbeb3befdeecca0e41534c9783eab6637c14cc4f170ee42619235884f9354f8d22a10c20c08cc89dc5340a60b7dfa2523c12e64b3386b3fd2c6d5f934e
@hebasto hebasto closed this Nov 11, 2020
@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default window size in Ubuntu 200% (HiDPI) mode is wrong
2 participants