Hi, I’m trying to build ColumnView that is responding to right-clicks on items. I’ve prepared this MRE: mvp3.py · GitHub
My problem here is that not all pixels belonging to a list item responds to the right click. Some, close to the edge of the list item, do not seem to be captured by the controller. I’ve added the Box (line 44) to have a widget expand to the whole cell area, but it doesn’t seem to work. Also, its not possible to add a controller directly to the Gtk.ListItem object.
These pixels are still highlighted on mouse-over, so users will definitelly be surprised the right click doesn’t work. How do I make it work on the whole area?
In your example you are connecting the gesture to the content widget of each column. Each Box is inside a ColumnViewRowWidget and ColumnViewCellWidget which I presume all have margins of some size.
In my app I connect to the ColumnView itself and don’t see the behavior you see.
Then there is no way to know that as far as I know. I only need to know the row and in fact there is no way to know that even. I rely on what row is selected, which may or may not be the clicked on row. You can use “SingleClickActivate” which means the row at the cursor position will be selected. But that also has a number of issues.