Corregge icona Esci HighDPI con CTkImage (main 1.0.4)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import tkinter as tk
|
||||
import unittest
|
||||
import warnings
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
from unittest.mock import Mock, patch
|
||||
@@ -98,11 +99,18 @@ class InventoryLauncherTests(unittest.TestCase):
|
||||
from main import Launcher
|
||||
from user_session import UserSession
|
||||
session = UserSession(1, "TEST", "Test operator")
|
||||
with patch.object(Launcher, "_apply_dynamic_geometry"), patch.object(Launcher, "lift"), \
|
||||
patch.object(Launcher, "focus_force"), patch.object(Launcher, "_make_exit_icon", return_value=None):
|
||||
with warnings.catch_warnings(), patch.object(Launcher, "_apply_dynamic_geometry"), \
|
||||
patch.object(Launcher, "lift"), patch.object(Launcher, "focus_force"):
|
||||
warnings.simplefilter("error", UserWarning)
|
||||
root = Launcher(session, Mock())
|
||||
root.withdraw()
|
||||
try:
|
||||
self.assertIsInstance(root._exit_icon, ctk.CTkImage)
|
||||
self.assertEqual(root._exit_icon.cget("size"), (14, 14))
|
||||
for mode in ("light", "dark"):
|
||||
for scale in (1, 2):
|
||||
photo = root._exit_icon.create_scaled_photo_image(scale, mode)
|
||||
self.assertEqual((photo.width(), photo.height()), (14 * scale, 14 * scale))
|
||||
def widgets(widget):
|
||||
for child in widget.winfo_children():
|
||||
yield child
|
||||
|
||||
Reference in New Issue
Block a user