Skip to content

Commit 330d276

Browse files
committed
fix: exclude Text and Listbox height from DPI scaling
1 parent a24eac1 commit 330d276

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tests/test_dpi.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,12 +2617,17 @@ def test_patch_widget_constructors(self):
26172617

26182618
with patch.object(manager, '_apply_standard_widget_patch') as mock_apply_patch:
26192619
with patch.object(manager, '_patch_button_constructor') as mock_button:
2620-
manager._patch_widget_constructors(2.0)
2621-
2622-
# Verify that _apply_standard_widget_patch was called for all widgets
2623-
expected_calls = 17 # Number of standard tk and ttk widgets (updated count)
2624-
assert mock_apply_patch.call_count == expected_calls
2625-
mock_button.assert_called_once_with(2.0)
2620+
with patch.object(manager, '_patch_text_constructor') as mock_text:
2621+
with patch.object(manager, '_patch_listbox_constructor') as mock_listbox:
2622+
manager._patch_widget_constructors(2.0)
2623+
2624+
# Verify that _apply_standard_widget_patch was called for all widgets
2625+
# Text and Listbox are excluded (have special handling)
2626+
expected_calls = 15 # Number of standard tk and ttk widgets (Text and Listbox excluded)
2627+
assert mock_apply_patch.call_count == expected_calls
2628+
mock_button.assert_called_once_with(2.0)
2629+
mock_text.assert_called_once_with(2.0)
2630+
mock_listbox.assert_called_once_with(2.0)
26262631

26272632
def test_patch_standard_tk_widgets(self):
26282633
"""Test _apply_standard_widget_patch method."""

0 commit comments

Comments
 (0)