mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
fixes for Windows
This commit is contained in:
@ -77,7 +77,7 @@ class ScalingTracker:
|
|||||||
|
|
||||||
DPI100pc = 96 # DPI 96 is 100% scaling
|
DPI100pc = 96 # DPI 96 is 100% scaling
|
||||||
DPI_type = 0 # MDT_EFFECTIVE_DPI = 0, MDT_ANGULAR_DPI = 1, MDT_RAW_DPI = 2
|
DPI_type = 0 # MDT_EFFECTIVE_DPI = 0, MDT_ANGULAR_DPI = 1, MDT_RAW_DPI = 2
|
||||||
window_hwnd = wintypes.HWND(window)
|
window_hwnd = wintypes.HWND(window.winfo_id())
|
||||||
monitor_handle = windll.user32.MonitorFromWindow(window_hwnd, wintypes.DWORD(2)) # MONITOR_DEFAULTTONEAREST = 2
|
monitor_handle = windll.user32.MonitorFromWindow(window_hwnd, wintypes.DWORD(2)) # MONITOR_DEFAULTTONEAREST = 2
|
||||||
x_dpi, y_dpi = wintypes.UINT(), wintypes.UINT()
|
x_dpi, y_dpi = wintypes.UINT(), wintypes.UINT()
|
||||||
windll.shcore.GetDpiForMonitor(monitor_handle, DPI_type, pointer(x_dpi), pointer(y_dpi))
|
windll.shcore.GetDpiForMonitor(monitor_handle, DPI_type, pointer(x_dpi), pointer(y_dpi))
|
||||||
|
@ -12,7 +12,6 @@ class CTkCanvas(tkinter.Canvas):
|
|||||||
self.aa_circle_canvas_ids = set()
|
self.aa_circle_canvas_ids = set()
|
||||||
|
|
||||||
def get_char_from_radius(self, radius):
|
def get_char_from_radius(self, radius):
|
||||||
if CTkSettings.scaling_factor == 1:
|
|
||||||
if radius >= 20:
|
if radius >= 20:
|
||||||
return "A"
|
return "A"
|
||||||
else:
|
else:
|
||||||
|
@ -4,7 +4,7 @@ import customtkinter # <- import the CustomTkinter module
|
|||||||
customtkinter.set_appearance_mode("dark") # Modes: "System" (standard), "Dark", "Light"
|
customtkinter.set_appearance_mode("dark") # Modes: "System" (standard), "Dark", "Light"
|
||||||
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
|
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
|
||||||
|
|
||||||
customtkinter.ScalingTracker.set_user_scaling(0.9)
|
customtkinter.ScalingTracker.set_user_scaling(1.5)
|
||||||
|
|
||||||
root_tk = customtkinter.CTk() # create CTk window like you do with the Tk window (you can also use normal tkinter.Tk window)
|
root_tk = customtkinter.CTk() # create CTk window like you do with the Tk window (you can also use normal tkinter.Tk window)
|
||||||
root_tk.geometry("400x480")
|
root_tk.geometry("400x480")
|
||||||
|
Reference in New Issue
Block a user