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

GUI scaling for hi-dpi displays #5

Open
fishcu opened this issue Nov 21, 2017 · 10 comments

Comments

@fishcu
Copy link
Collaborator

commented Nov 21, 2017

With the current libraries used for GUI display, is it possible to add a setting to scale the GUI by a factor of 1.25, 1.5, ..., 2, etc.? On my screen, under Ubuntu 16.04, everything GUI-related looks tiny and hard to navigate.

Thank you for providing this software!

@fishcu

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 21, 2017

Here's a screenshot. The titlebar of the window and the title look normal size on my display.

goreviewpartner_gui

EDIT: comparing with screenshots on the documentation page, the font size is also wrong (or maybe correct, but it doesn't fit with the overall scaling).

@pnprog

This comment has been minimized.

Copy link
Owner

commented Jan 11, 2018

Hi!
Ok, now I understand why the coordinates appear so big on you screenshot!

There must be a way to tell tkinter to adjust, I will look into it.

@pnprog

This comment has been minimized.

Copy link
Owner

commented Jan 11, 2018

Hi @fishcu,

Would you try this method and tell me if it does the trick?
Edit the file main.py, and below line 36 app = Tk() insert those 3 lines:

dpi_value = app.winfo_fpixels('1i')
log("Screen DPI:",dpi_value)
app.tk.call('tk', 'scaling', '-displayof', '.', dpi_value / 72.0)

Then launch the main.py file with python again.

@fishcu

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 11, 2018

The resulting display is the same (everything looks the same as before).

The reported DPI is:
"Screen DPI: 96.047267356"

I'm on a 14" display, with a 2560x1440 resolution. https://www.sven.de/dpi/ calculates this as around 210 PPI.

@pnprog

This comment has been minimized.

Copy link
Owner

commented Jan 11, 2018

Ok, then the detection of proper DPI does not work.
Then can try replacing those 3 lines by those 2 lines and see if it works for you?

dpi_value = 210
app.tk.call('tk', 'scaling', '-displayof', '.', dpi_value / 72.0)

If that works (of if it improves the interface) then I will make it possible to adjust this values manually in the settings.

@fishcu

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 14, 2018

To avoid doing the same work twice: I'm currently working on a fix for this issue. I might come up with something this week. :)

@pnprog

This comment has been minimized.

Copy link
Owner

commented Jan 15, 2018

Great!

@pnprog

This comment has been minimized.

Copy link
Owner

commented Feb 17, 2018

@fishcu , I just pushed a commit that aims at a better adjusting of the size of marking (A, B, C, 1, 2, 3...) on the Goban. Because I noticed on all your screen-shots that the letters/numbers are bigger than the circles/stones.
I am now making a sort of measurement to get the ratio fontsize/pixel (which appears to be linear) then calculate the font size so that it correspond to 0.7 of one intersection.

Also, the circles containing those letters have width adjusted based on goban size in pixel (same as the 19 lines), so they will appear larger than 1px on high resolution screen like your. And so hopefully more visible.

Could you have a try and let me know if it's working?

@fishcu

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 25, 2018

Hi @pnprog

Got extremely busy the last few weeks. Sorry I didn't hold my promise ;)
I will test your update soon when the chance arises. Thanks for the support!

@fishcu

This comment has been minimized.

Copy link
Collaborator Author

commented May 10, 2018

I noticed that in the current version, while most GUI elements are still very small, the Goban and the coordinates are rendered correctly on hi-dpi screens. Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.