Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Console Interpreter: Changed how console splitter size are reused on show #3016

Merged
merged 3 commits into from
Apr 6, 2022

Conversation

iLLiCiTiT
Copy link
Member

Brief description

Use stored splitter sizes as relative ratio rather then absolute size.

Description

Restored sizes are now set explicitly on initialization but the size of window is not yet known so the bottom part is squeezed and when sizes would be set as absolute size of first show it may cause issues when machine has more displays with different resolution. The best solution seems to be se restore size of window before first show and change splitter sizes after showing up.

Testing notes:

  1. Open tray > Admin > Console
  2. Change sizes of window and splitter parts
  3. Restart tray
  4. Open tray > Admin > Console again
  5. Size of window and splitter parts should be the same, or more close then were before this PR

@iLLiCiTiT iLLiCiTiT self-assigned this Apr 5, 2022
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Apr 5, 2022
@iLLiCiTiT iLLiCiTiT requested review from 64qam and kalisp April 5, 2022 16:57
Comment on lines +643 to +644
splitter_size_ratio = self._splitter_size_ratio
self._splitter_size_ratio = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

It does seem weird that we're storing this value to self just so it's used this one time on first show and only then. I understand the init_from_registry() takes all settings from registry but nonetheless this feels odd.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does seem weird that we're storing this value to self just so it's used this one time on first show and only then.

I agree but at the same time loading the data from registry twice is weirder. Since splitter sizes must be set after show and window resize must happen before show, it's just decision.

@iLLiCiTiT iLLiCiTiT merged commit 0b7917e into develop Apr 6, 2022
@iLLiCiTiT iLLiCiTiT deleted the bugfix/console_interpreter_reinit_sizes branch April 6, 2022 12:03
@mkolar mkolar added this to the 3.9.3 milestone Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants