-
Notifications
You must be signed in to change notification settings - Fork 336
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
Autosize of windows is not work properly on different DPI scalings #677
Comments
Thank you for reporting this issue. I will check it. |
Also I managed to scale menubar with different DPI by getting widget size of it. Here is the code within source/gui/widgets/menubar.cpp
.... Also on refresh method
What do you think? Thanks in advance. |
@edgarbernal5 a PR is welcomed. |
Hi @cnjinhao, I want to contribute, I have a commit ready to be pushed but I think I don't have right access: git push --set-upstream origin dpi_scale_issue |
@edgarbernal5 make your push into your own fork of nana https://github.com/edgarbernal5/nana, and from there open a pull request to the original fork. |
Alright, I didn't know that! Thanks @qPCR4vir will do that! |
In order to create the pull request, should I create a branch in my own fork with all in? @qPCR4vir |
I think I know the answer 😀 |
Pull request: #690. |
Thanks, the pull request has been merged. |
Hi ! It looks like a great job. I hope you (@edgarbernal5 ) will keep doing soo. But in your Pull Request you (@edgarbernal5 ) made the same mistake I made some times: there are a lot of unrelated commits that make it very hard to follow what you did. I'm sorry that I did not review that, and only now report it. To fix this I propose that you both go to the previous commit: 7c73095 "fix crash and rectangle errors in pixel_buffer" and make a hard reset of the branch to that. @cnjinhao will need to rewrite that to the repo (force push that branch again). After that one (@edgarbernal5 ) need to do a merge , but using a 'cherry pick' and include only the commit fe75360 "Fixed dpi scale for menu, menubar and combox". In a new Pull request verify only that commit was made. @cnjinhao will then merged and made a new push. This will re-write history. A clean history. There are many ways to do this, just verify before push. If you want I can try to do all of that by myself. We all learn by doing... |
My bad, it was my fault! I want to fix this but I don't know how to do it right! We can do it together if you want @qPCR4vir I got the following message: git reset --hard 7c73095 or doing this: git checkout 7c73095 Probably I am missing something. |
ok... I did what I could.. I hope it is not too bad now. @edgarbernal5 to clean your repo just rename your develop-1.8 to my_dev-1.8 or something and pull a fresh develop-1.8 from this repo. Then create a new branch directly from that fresh pulled develop-1.8 with the name of the feature or fix you want to provide. Checkout that and cherry pick only the commits that you want to merge. Push to your repo in GitHub and from there make a PullRequest to cnjinhao/develop-1.8. Make sure it is a clean PR, with only the needed commits and changes. |
Thanks a million! You saved me @qPCR4vir !! |
Hi, @edgarbernal5 great job!.... |
tip: begin from this :
|
still a lot of problems like this: just set it to 300% for easy detection of problems |
@qPCR4vir Sure, no problem. I could take a look. Would you know what are the repro steps?
Do you mean changing scale and layout on display on Windows Settings? |
Yes, with 300% it is easy to see.... The constructor of |
Unfortunately, the listbox widget is also affected. |
Okey, got it. Maybe we need to do the dpi scale by calling this: |
Well... I wanted to help with this, but I'm afraid I don't understand why we are doing this: |
hmm, #640... |
OK, I suppose that the goal was to "amplify" extreme small fonts and elements to make it readable for dpi > 96. |
Why for font it is |
hmm, no. Windows internally reinterpret all the coordinates, scaling for that % from the windows setting and report the new dpi already "scaled", but your program don't see that - it continue to to use the same old coordinates. We need to know when it was set for a physical monitor or for an 'scaled' monitor. |
Sad... I'm not doing any progress. We need a lot of discipline to fix this. |
OK... as per this issue, we want to adapt to a dpi change: we need DPI_AWARENESS_PER_MONITOR_AWARE (= 2, version 2) OMG... we need to "manually" calculate and scale every single coordinate, size and font? well, windows rectangle not - only set it, but windows give the new coordinate already calculated. |
please see: #697 |
go to: #698 |
The current design is not easy for resizing window of DPI change. We need to design an adaptive coordinating system for the feature, it's complicated. IMO, we can add the event of DPI change to let user control the resize. |
On Win10 when you change scaling factor in settings layouts autosize not work properly. From demo projects here is inputbox pictures for 100%, 125% and 150% scaling:
go to: #698
The text was updated successfully, but these errors were encountered: