cjcliffe / CubicSDR

Cross-Platform Software-Defined Radio Application
http://www.cubicsdr.com
GNU General Public License v2.0
2.06k stars 253 forks source link

Adds a fix to scale the Frequency dialog. #806

Closed jawatson closed 4 years ago

jawatson commented 4 years ago

The dialog layout uses a sizer to scale the content automatically. The layout wasn't very good using sizers alone as width of the dialog was being set too narrow for the title string. In the event that the initString is too short, the width is set manually to either the [title string width + 35%] or the [content string width +10%], whichever's the greater. If the initString is very long, the sizer defines the width of the box.

This has been tested on Linux (Fedora 32) in both conventional and HiDPI (scale 200%) environments.

This has not been tested in either Windows or Mac environments.

vsonnier commented 4 years ago

Hi @jawatson thank you for the fix, unfortunatly it has several problems:

Improvement suggestions:

Sorry to ask you all this, while I have very little time to investigate myself !

Dantali0n commented 4 years ago

I will try this patch as well (Linux, i3) but can't test the scaling as my window manager simply does not support it (xrandr does though).

Dantali0n commented 4 years ago

Screenshot from 2020-04-12 17-47-43

Looks fine on i3 at 1920x1080 (476mm x 268mm).

vsonnier commented 4 years ago

Hi @jawatson, I pushed on master a fix that seems to work for both Frequency and Edit Label dialogs, based on your code. Thanks for your contribution !

Dantali0n commented 4 years ago

Hi @jawatson, I pushed on master a fix that seems to work for both Frequency and Edit Label dialogs, based on your code. Thanks for your contribution !

Did you know that if you add a Co-authored-by line to your commit message that Github will detect it and attribute as well. Here is an example: https://github.com/openstack/watcher/commit/aa2a084d220614e0db79b15e669fae2c2b3423b7

vsonnier commented 4 years ago

Did you know that if you add a Co-authored-by line to your commit message that Github will detect it and attribute as well. Here is an example: openstack/watcher@aa2a084

Thanks for the tip, however it does not seem to work...

jawatson commented 4 years ago

Thanks for letting me know - I'm glad that the code was of some use. This is my first time doing anything with wxWidgets but I'm keen to learn more.