Current situation (and USERLIST one suggested above too) has bad usability with 
the mouse (ctrl+click) as it requires a double click.  As there is a primary 
mouse-based trigger, I think it's important to fix this.
(It probably could be nice to also directly select on single click from 
Scintilla's AUTOCLIST, but as wa don't have any mouse-based triggers currently 
it's not that important)

Anyway I tried to re-implement this using a `GtkMenu` and `gtk_menu_popup()`, 
and it had a subtlety (because we don't get the proper `GdkEvent` to feed 
`gtk_menu_popup()`) but otherwise was pretty straightforward, simpler (all 
popup logic is left out to `GtkMenu`), and behaves better regarding input, as 
click selects, and keyboard navigation works fine.  As it isn't likely there 
would be an endless list of possibilities, and anyway if there was the UI here 
wouldn't be really usable, I don't think there is a problem with putting 
elements in a menu (which doesn't scroll before filling the screen).
WIP branch: 
https://github.com/b4n/geany/commits/wip/techee/multi_tag_goto%2Bpopup-menu-wip

---

> Regarding the popup I decided doing it the lightweight way - I had a look at 
> Scintilla and the autocompletion positioning/resizing code is quite complex. 
> So I just took some reasonable size values for the popup and placed it inside 
> the middle of the window (similarly to the ctrl-tab document switching popup).

The complexity from Scintilla's popup placement is the will to align the text 
column exactly to the cursor, so that the autocompletion suggestion is 
perfectly vertically aligned with the buffer's text.  This means location the 
exact X coordinate of the second row's cell renderer, which isn't that trivial.
In my above-mentioned menu-based popup I implemented [a straightforward version 
of the popup 
placement](https://github.com/b4n/geany/blob/wip/techee/multi_tag_goto%2Bpopup-menu-wip/src/symbols.c#L1884)
 that simply places the top-left of the popup below the cursor.  I believe this 
to be good enough in this case, as anyway the item text has nothing to do with 
the buffer's content.

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/406#issuecomment-184301478

Reply via email to