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

Remove fixed sizes from Config dialog .ui file #3489

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

10110111
Copy link
Contributor

@10110111 10110111 commented Nov 1, 2023

Most of the sizes are replaced with normal QLayout-based positioning, and a few more essential ones are moved into normalStyle.css for greater flexibility in customization.

This change is required to make it possible to resize the whole GUI when font size changes. Such scaling will let us go away from the Qt's kludge of virtual pixels, whose problem is not only that it's a kludge leading to inconsistencies in the code, but also that it leads to some blurring of text in particular situations and coarsening of mouse input events.

I tried to preserve the look of the dialog as much as possible, with one exception: the sizes of scriptListWidget are configured similarly to those of pluginsListWidget, so that the split between the list and the description panels is not in the middle, but on the left side, see the screenshots below.

I'm going to change some other dialogs in a similar way, and add a function that will multiply all pixel-based sizes in normalStyle.css by a scale factor. To make it all work, I propose some rules that will help maintain scalability of the GUI:

  • Whenever you want to align some widgets, don't set fixed/minimum/maximum sizes — use QLayout classes, in particular, QGridLayout is quite good for this;
  • If you must set a size in pixels (like for the pluginsListWidget), do it via normalStyle.css. This will keep these values accessible to the code that will be able to adjust them as required.

Old Scripts tab

6a

New Scripts tab

6b

Most of the sizes are replaced with normal QLayout-based positioning,
and a few more essential ones are moved into normalStyle.css for greater
flexibility in customization.
Copy link

github-actions bot commented Nov 1, 2023

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

@alex-w alex-w added this to the 23.4 milestone Nov 2, 2023
Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Thanks!

@10110111 10110111 merged commit 5cced37 into Stellarium:master Nov 2, 2023
12 checks passed
@10110111 10110111 deleted the free-size-config-dialog branch November 2, 2023 08:05
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Nov 5, 2023
Copy link

github-actions bot commented Nov 5, 2023

Hello @10110111!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Dec 23, 2023
Copy link

Hello @10110111!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants