JaGoLi / ytdl-gui

A simple-to-use, cross-platform graphical interface for youtube-dl.
GNU General Public License v3.0
253 stars 23 forks source link

Window Size Issue: Pop Os #50

Closed SmokeShine closed 3 years ago

SmokeShine commented 3 years ago

Pop OS 21.04. Installed flatpak from Pop Shop Screenshot from 2021-08-17 01-32-55

knghtbrd commented 3 years ago

I see something similar (not quite as bad) on Debian. Do you have your fonts scaled at all? HiDPI? Looks like Qt itself is scaling the UI components, but the size of the frame those components are being crammed into was hardcoded. in.

marklabrecque commented 3 years ago

I am also seeing the same on Pop_OS! 21.04. My display is scaled to 200%. It would be great to fix this as it's not usable for me right now. The application looks great though! Thanks for making it

JaGoLi commented 3 years ago

I will look into it. Has anyone tried setting the QT_SCALE_FACTOR variable to 2 in /etc/environment or in your shell's profile when using the application?

JaGoLi commented 3 years ago

When I try it on the commandline on my computer it seems to work. 2021-08-19-102258_1366x768_scrot

SmokeShine commented 3 years ago
(base) ubuntu@pop-os:~$ QT_SCALE_FACTOR=2 youtubedl-gui
youtubedl-gui: command not found
(base) ubuntu@pop-os:~$ youtubedl-gui
youtubedl-gui: command not found

From terminal, application is not launching.

marklabrecque commented 3 years ago
(base) ubuntu@pop-os:~$ QT_SCALE_FACTOR=2 youtubedl-gui
youtubedl-gui: command not found
(base) ubuntu@pop-os:~$ youtubedl-gui
youtubedl-gui: command not found

From terminal, application is not launching.

You mentioned installing it as a flatpak, right? You will need to run it using the flatpak binary

marklabrecque commented 3 years ago

I tried this env var with both the flatpak and the native package, but neither seemed to work in my case.

youtube-dl-scaling-issue

JaGoLi commented 3 years ago

Thank you @marklabrecque so it's not just the scaling factor. I will check for other possible causes.

marklabrecque commented 3 years ago

Thanks for your hard work on this, @JaGoLi !

SmokeShine commented 3 years ago

I am not sure how to run the flatpak binary.
@marklabrecque can you tell the process?

marklabrecque commented 3 years ago

I am not sure how to run the flatpak binary. @marklabrecque can you tell the process?

Sure, so you need to know the flatpak Application ID, which you can find by running flatpak list. Then you can run flatpak run APP_ID - In this case, the command was flatpak run io.github.JaGoLi.ytdl_gui

Does that make sense?

knghtbrd commented 3 years ago

ytdl-gui-scaled

It's still broken, it's just now bigly broken. 😃

knghtbrd commented 3 years ago

FWIW, I do have Cinnamon set to scale fonts by 1.6 on account of blind as a bat.

JaGoLi commented 3 years ago

After doing a lot of work to make the application scalable manually. I finally found the answer: you need to set the variable QT_AUTO_SCREEN_SCALE_FACTOR=1. In Pop OS, the simplest way to do this is to add the line export QT_AUTO_SCREEN_SCALE_FACTOR=1 to the .profile file in your home directory. Logout and log back in, it should work now.

knghtbrd commented 3 years ago

I appreciate you looking into this, however I cannot call disabling HiDPI/text scaling more than a workaround, since Qt DOES support these things and failure to support 4k screens and accessibility in 2021 is ought to be considered bugs.

knghtbrd commented 3 years ago

Specifically, citing https://doc.qt.io/qt-5/highdpi.html, I see:

In the long term, the application should be adapted to run unmodified:

  • Always use the qreal versions of the QPainter drawing API.
  • Size windows and dialogs in relation to the corresponding screen size.
  • Replace hard-coded sizes in layouts and drawing code with values calculated from font metrics or screen size.

I think the last of these is what's actually needed to resolve the issue long-term. Your .ui file is written using an assumed 96 DPI. You can scale those metrics in your code by the screen DPI / 96 to resize them.

JaGoLi commented 3 years ago

@iKarith With all due respect, if you actually try to run the application on an HiDPI display with the variable I mention, it does not disable scaling. Rather, it enables it. Everything is handled by the Qt Framework and the app looks great. I can personally attest to this.

JaGoLi commented 3 years ago

Added instructions on how to fix the issues in the readme.