UI broken, possibly due to screen DPI #7

Open
opened 3 months ago by stasiana · 5 comments

I use 4K screens on Debian 12. The UI shows poorly, with options off-screen. See the attachment.

I use 4K screens on Debian 12. The UI shows poorly, with options off-screen. See the attachment.
stasiana changed title from UI broken, possibly due to PDI to UI broken, possibly due to screen DPI 3 months ago
josch commented 3 months ago
Owner

Thank you for your report! Are you able to test a patch if I send you one here?

Thank you for your report! Are you able to test a patch if I send you one here?
Poster

Thank you for your report! Are you able to test a patch if I send you one here?

Sure thing.

> Thank you for your report! Are you able to test a patch if I send you one here? Sure thing.
josch commented 3 months ago
Owner

What happens if you change this number:

--- a/plakativ.py
+++ b/plakativ.py
@@ -942,7 +942,7 @@ class VerticalScrolledFrame(tkinter.Frame):
             borderwidth=0,
             highlightthickness=0,
             yscrollcommand=vscrollbar.set,
-            width=240 * parent.winfo_fpixels("1i") / 96.0,
+            width=440 * parent.winfo_fpixels("1i") / 96.0,
         )
         canvas.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=tkinter.TRUE)
         vscrollbar.config(command=canvas.yview)

It would also be interesting to see what your system prints for this command:

python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))'

Thanks!

What happens if you change this number: ```patch --- a/plakativ.py +++ b/plakativ.py @@ -942,7 +942,7 @@ class VerticalScrolledFrame(tkinter.Frame): borderwidth=0, highlightthickness=0, yscrollcommand=vscrollbar.set, - width=240 * parent.winfo_fpixels("1i") / 96.0, + width=440 * parent.winfo_fpixels("1i") / 96.0, ) canvas.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=tkinter.TRUE) vscrollbar.config(command=canvas.yview) ``` It would also be interesting to see what your system prints for this command: python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))' Thanks!
Poster

Great, that worked. Fatter bar makes all the options visible.

$ python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))'
96.0
Great, that worked. Fatter bar makes all the options visible. ``` $ python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))' 96.0 ```
josch commented 3 months ago
Owner

Okay, then we also have the culprit there. Tk thinks that your monitor dpi is 96 which is the same value that Tk presents for my monitor. If you have a 4k screen, that dpi value should probably be far larger. In that case, this is not a plakativ bug, but a bug in tk or elsewhere which feeds wrong data to plakativ which is using the dpi value to compute the correct size of the right-hand-side bar.

Okay, then we also have the culprit there. Tk thinks that your monitor dpi is 96 which is the same value that Tk presents for my monitor. If you have a 4k screen, that dpi value should probably be far larger. In that case, this is not a plakativ bug, but a bug in tk or elsewhere which feeds wrong data to plakativ which is using the dpi value to compute the correct size of the right-hand-side bar.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: josch/plakativ#7
Loading…
There is no content yet.