-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into wm-cleanup
- Loading branch information
Showing
34 changed files
with
355 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ __pycache__/ | |
*$py.class | ||
|
||
# C extensions | ||
# *.so | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pillow>=9.3.0 | ||
screeninfo>=0.8 | ||
libtukaan-win==0.1.3; sys_platform == "win32" | ||
libtukaan-mac==0.1.3; sys_platform == "darwin" | ||
libtukaan-unix==0.1.3; sys_platform == "linux" | ||
libtukaan-win==0.1.4; sys_platform == "win32" | ||
libtukaan-mac==0.1.4; sys_platform == "darwin" | ||
libtukaan-unix==0.1.4; sys_platform == "linux" | ||
typing_extensions>=4.3.0; python_version < "3.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`move_cursor`, `watch_cursor`, `move_cursor.cur` and `watch_cursor.ani`: The Suru icon theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import sys | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
import tukaan | ||
from tests.base import TESTS_DIRECTORY, with_app_context | ||
from tukaan import CursorFile | ||
from tukaan.enums import Cursor, LegacyX11Cursor | ||
from libtukaan import Xcursor | ||
|
||
|
||
@with_app_context | ||
def test_cursor_convert(app, window): | ||
label = tukaan.Label(window, cursor=Cursor.Blank) | ||
assert label.cursor is Cursor.Blank | ||
|
||
for cursor in Cursor: | ||
label.cursor = cursor | ||
assert label.cursor == cursor | ||
|
||
for cursor in LegacyX11Cursor: | ||
label.cursor = cursor | ||
assert label.cursor == cursor | ||
|
||
|
||
def test_legacy_x11_cursor_naming(): | ||
for cursor in LegacyX11Cursor: | ||
if cursor.name == "X": | ||
continue | ||
assert cursor.name.lower() == cursor.value.replace("_", "") | ||
|
||
|
||
@pytest.mark.skipif(sys.platform != "win32", reason="Windows only cursor loading thingy") | ||
@with_app_context | ||
def test_windows_cursor_file(app, window): | ||
label = tukaan.Label(window, cursor=CursorFile(TESTS_DIRECTORY / "move_cursor.cur")) | ||
assert label.cursor == CursorFile(TESTS_DIRECTORY / "move_cursor.cur") | ||
assert label.cursor._name.startswith("@") | ||
assert label.cursor._name.endswith("move_cursor.cur") | ||
|
||
label_2 = tukaan.Label(window, cursor=CursorFile(TESTS_DIRECTORY / "watch_cursor.ani")) | ||
assert label_2.cursor == CursorFile(TESTS_DIRECTORY / "watch_cursor.ani") | ||
assert label_2.cursor._name.startswith("@") | ||
assert label_2.cursor._name.endswith("watch_cursor.ani") | ||
|
||
with pytest.raises(ValueError): | ||
CursorFile(Path("./foo.png")) | ||
|
||
|
||
@pytest.mark.skipif(sys.platform != "linux", reason="Xcursor is Linux only") | ||
@with_app_context | ||
def test_xcursor(app, window): | ||
frame = tukaan.Frame(window, cursor=CursorFile(TESTS_DIRECTORY / "move_cursor")) | ||
label = tukaan.Label(frame, cursor=CursorFile(TESTS_DIRECTORY / "watch_cursor")) | ||
label_2 = tukaan.Label(frame, cursor=CursorFile(TESTS_DIRECTORY / "watch_cursor")) | ||
assert len(Xcursor._defined_cursors) == 3 | ||
assert frame.cursor == CursorFile(TESTS_DIRECTORY / "move_cursor") | ||
assert label.cursor == CursorFile(TESTS_DIRECTORY / "watch_cursor") | ||
assert label_2.cursor == CursorFile(TESTS_DIRECTORY / "watch_cursor") | ||
label_2.destroy() | ||
assert len(Xcursor._defined_cursors) == 2 | ||
frame.destroy() | ||
assert len(Xcursor._defined_cursors) == 0 | ||
|
||
|
||
@with_app_context | ||
def test_default_cursors(app, window): | ||
button = tukaan.Button(window) | ||
assert button.cursor is Cursor.Arrow | ||
|
||
textbox = tukaan.TextBox(window) | ||
assert textbox.cursor is Cursor.Text |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.