@@ -74,17 +74,17 @@ def row_position(self, row):
74
74
# Pick a point half way across horizontally, and half way down the row,
75
75
# taking into account the size of the rows and the header
76
76
row_height = self .native_table .rowHeight
77
- return self .native .convertPoint (
77
+ return self .native_table .convertPoint (
78
78
NSPoint (
79
79
self .width / 2 ,
80
- row * row_height + self . header_height + row_height / 2 ,
80
+ ( row * row_height ) + ( row_height / 2 ) ,
81
81
),
82
82
toView = None ,
83
83
)
84
84
85
85
async def select_row (self , row , add = False ):
86
86
point = self .row_position (row )
87
- # Selection maintains an inner mouse event loop, so we can't
87
+ # Table maintains an inner mouse event loop, so we can't
88
88
# use the "wait for another event" approach for the mouse events.
89
89
# Use a short delay instead.
90
90
await self .mouse_event (
@@ -102,14 +102,30 @@ async def select_row(self, row, add=False):
102
102
103
103
async def activate_row (self , row ):
104
104
point = self .row_position (row )
105
- # Selection maintains an inner mouse event loop, so we can't
105
+ # Table maintains an inner mouse event loop, so we can't
106
106
# use the "wait for another event" approach for the mouse events.
107
107
# Use a short delay instead.
108
- await self .mouse_event (NSEventType .LeftMouseDown , point , delay = 0.1 )
109
- await self .mouse_event (NSEventType .LeftMouseUp , point , delay = 0.1 )
108
+ await self .mouse_event (
109
+ NSEventType .LeftMouseDown ,
110
+ point ,
111
+ delay = 0.1 ,
112
+ )
113
+ await self .mouse_event (
114
+ NSEventType .LeftMouseUp ,
115
+ point ,
116
+ delay = 0.1 ,
117
+ )
110
118
111
119
# Second click, with a click count.
112
120
await self .mouse_event (
113
- NSEventType .LeftMouseDown , point , delay = 0.1 , clickCount = 2
121
+ NSEventType .LeftMouseDown ,
122
+ point ,
123
+ delay = 0.1 ,
124
+ clickCount = 2 ,
125
+ )
126
+ await self .mouse_event (
127
+ NSEventType .LeftMouseUp ,
128
+ point ,
129
+ delay = 0.1 ,
130
+ clickCount = 2 ,
114
131
)
115
- await self .mouse_event (NSEventType .LeftMouseUp , point , delay = 0.1 , clickCount = 2 )
0 commit comments