CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Visual Bugs with HiDPI on Gnome 45.3

Open rainyskye opened this issue 1 year ago • 3 comments

Hi,

I'm coming across a bug when using CustomTkinter on my Thinkpad (3840x2400 @ 14" - Kind of require scaling)

Using the scaling built into Gnome (Settings > Displays > Scale @ 200%), it appears that CustomTkinter breaks, similar to #1130 - I'll attach screenshots of the complex demo, at both 100% and 200% as a display of how it looks.

Any ideas on how to resolve this would be appreciated, I've tried using set_widget_scaling and set_window_scaling, but they appear to just increase the size even more, and still have the same visual bugs.

Thanks :)

100% - Native display @ 3840x2400 gnome_100

200% - Scaled @ 3840x2400 gnome_200

rainyskye avatar Feb 09 '24 14:02 rainyskye

What are the values that you have set for: set_widget_scaling and set_window_scaling ?

AshhadDevLab avatar Feb 19 '24 10:02 AshhadDevLab

I have the same bug. Gnome 45.4 in 200% scaling (Gnome settings). I get the exact same corner bug. This code reproduces the bug on a button.

#!/usr/bin/env python3

import customtkinter as ctk

# window
window = ctk.CTk()
window.title("Custom Tkinter app")
window.geometry("600x400")

button1 = ctk.CTkButton(
    window,
    text="A CTk Button",
    corner_radius=5,
    border_width=1,
)
button1.pack()

window.mainloop()

image

nekkz avatar Mar 14 '24 03:03 nekkz

I found the rounded corner bug, __draw_rounded_rect_with_border_font_shapes set the coordinates of the corners using the radius as offset instead of the diameter. Is the project still active? I see a s**tload of unmerged pull requests dating back from october 2023... The font size is related to another issue.

image

nekkz avatar Mar 14 '24 04:03 nekkz