|
7 | 7 |
|
8 | 8 | from rich.console import Console, ConsoleOptions, RenderResult |
9 | 9 | from rich.layout import Layout |
10 | | -from rich.region import Region |
| 10 | +from rich.region import Region as LayoutRegion |
11 | 11 | from rich.repr import rich_repr, RichReprResult |
12 | 12 | from rich.segment import Segments |
13 | 13 |
|
14 | 14 | from . import events |
15 | 15 | from ._context import active_app |
16 | | -from .geometry import Dimensions |
| 16 | +from .geometry import Dimensions, Region |
17 | 17 | from .message import Message |
18 | 18 | from .message_pump import MessagePump |
19 | 19 | from .widget import Widget, UpdateMessage |
@@ -101,9 +101,9 @@ def __rich_console__( |
101 | 101 | segments = console.render(self.layout, options) |
102 | 102 | yield from segments |
103 | 103 |
|
104 | | - def get_widget_at(self, x: int, y: int) -> Tuple[Widget, Region]: |
| 104 | + def get_widget_at(self, x: int, y: int) -> Tuple[Widget, LayoutRegion]: |
105 | 105 | for layout, (region, render) in self.layout.map.items(): |
106 | | - if region.contains(x, y): |
| 106 | + if Region(*region).contains(x, y): |
107 | 107 | if isinstance(layout.renderable, Widget): |
108 | 108 | return layout.renderable, region |
109 | 109 | else: |
|
0 commit comments