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

Scale bottom and left panel buttons according to font size #4031

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

10110111
Copy link
Contributor

Description

This is a continuation of the scalable GUI series. Currently the dialogs are scaled according to font size, but not the panels. This PR makes the panels, namely bottom and left one also scale. The Oculars plugin's panel (are there others?) remains unaffected, this will be fixed in a subsequent PR.

Screenshots:

13px font, old

stellarium-011

13px font, new

stellarium-014

19px font, old

stellarium-012

19px font, new

stellarium-015

40px font, old

stellarium-013

40px font, new

stellarium-016

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • Housekeeping

How Has This Been Tested?

Test Configuration:

  • Operating system: Ubuntu 20.04
  • Graphics Card: Intel UHD Graphics 620

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

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 the subsystem: gui The issue is related to GUI subsystem of planetarium... label Dec 29, 2024
@alex-w alex-w added this to the 25.1 milestone Dec 29, 2024
@alex-w
Copy link
Member

alex-w commented Dec 29, 2024

Hmm… but you followed screen font size, not a GUI font size.

@10110111
Copy link
Contributor Author

Yes, it's consistent with the fact that panels follow it.

@gzotti
Copy link
Member

gzotti commented Dec 29, 2024

The last example shows the danger, though - running out of screen space. Maybe thre should e an option to scale the buttons separate from screen font size. Yes, the bottom bar has a few issues still with placing the strings. IIRC these are currently placed on fixed locations, but those may depend on what's on their left side. (Long or short location name.) Only the time is right-adjusted. There may be sub-FullHD screens where users may accept smallish buttons mixed with their eyes' need for larger font. (Try on a 1280x720 window.) In this case maybe they may want to e.g. easily configure away FPS display to utilize the screenspace.
It seems we need another tab "GUI" where we add yet a few more options, those now found in extras (activate various buttons) and tools (fonts, ...), and bottom menu options currently still only available by manual edits in config.ini.

@alex-w
Copy link
Member

alex-w commented Dec 29, 2024

It seems we need another tab "GUI" where we add yet a few more options, those now found in extras (activate various buttons) and tools (fonts, ...), and bottom menu options currently still only available by manual edits in config.ini.

Good idea, but that’s for separate PR

@10110111
Copy link
Contributor Author

The last example shows the danger, though - running out of screen space.

This danger already realizes on 800×600 screens with v24.4. And 1024×768 barely fits the bottom panel. Moreover, depending on the number of plugins enabled you can overflow it in 1024×768 case too.

Maybe thre should e an option to scale the buttons separate from screen font size.

Maybe this could be added later, but currently the behavior is more or less the same as with high-DPI scaling, but with a saner handling of mouse clicks and positioning. (And this is the final goal: force Qt scale factor to 100% while scaling everything by the factor requested by the OS.)

There may be sub-FullHD screens where users may accept smallish buttons mixed with their eyes' need for larger font.

If it's hard for someone to read text, it will be just as hard to discern the icons. Again, high-DPI scaling was introduced just because of this: one needs to enlarge everything, not just fonts.

Now, for those with very small screens there already exist many problems with the GUI of their DEs. I remember having such issues with some DE (I guess it was KDE?..) that had too high dialogs for my 1024×600 EEEPC 1015PN. But on Linux/X11 I could just move the dialog with Alt+leftMouseDrag and resize the window to fit contents with Alt+rightMouseDrag. This will work for Stellarium too.

I don't think anyone would use such screens with modern Windows though (and the old versions of it are gonna be obsoleted soon by our dropping of Qt5).

We could later add some support for, say, scrolling of the bottom panel, but it's not for this PR anyways.

@gzotti
Copy link
Member

gzotti commented Dec 29, 2024

Yes, on Windows 800x600 was no longer usable, therefore our min requirements (1024x768). On Ubuntu (18?) I found xrandr can scale down screens (SUG 2.1.1). And we introduced the configurable buttons to remedy the width problem.
OK, I won't object this, but there remains room for improvement later.

@10110111 10110111 merged commit 4994932 into Stellarium:master Dec 29, 2024
16 checks passed
@10110111 10110111 deleted the scalable-panels branch December 29, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: gui The issue is related to GUI subsystem of planetarium...
Development

Successfully merging this pull request may close these issues.

3 participants