mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Tooltips (#2670)
* inflect * diagram * tooltip render * tooltip property * add guard * tooltip docs * docs * tidy, fix horizontal * words, removed comment * fix screenshot render * simplify * simfplify * changelog * simplify optimize * inflect tests * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * docstring * disable auto focus * should be fraction * optimization * snapshot update * Update tests/snapshot_tests/snapshot_apps/scroll_to_center.py Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> --------- Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -459,3 +459,20 @@ def test_translate_inside():
|
||||
assert Region(10, 10, 20, 5).translate_inside(Region(0, 0, 100, 100)) == Region(
|
||||
10, 10, 20, 5
|
||||
)
|
||||
|
||||
|
||||
def test_inflect():
|
||||
# Default inflect positive
|
||||
assert Region(10, 10, 30, 20).inflect(margin=Spacing(2, 2, 2, 2)) == Region(
|
||||
44, 34, 30, 20
|
||||
)
|
||||
|
||||
# Inflect y axis negative
|
||||
assert Region(10, 10, 30, 20).inflect(
|
||||
y_axis=-1, margin=Spacing(2, 2, 2, 2)
|
||||
) == Region(44, -14, 30, 20)
|
||||
|
||||
# Inflect y axis negative
|
||||
assert Region(10, 10, 30, 20).inflect(
|
||||
x_axis=-1, margin=Spacing(2, 2, 2, 2)
|
||||
) == Region(-24, 34, 30, 20)
|
||||
|
||||
Reference in New Issue
Block a user