Implementing overview search function in a PopupMenu?



Hi all,

I'm working on a little extension that shows your contacts (from
gnome-contacts) in the menu of a PanelMenu.SystemStatusButton.
(The vague idea is you can chat from the menu/open up a chat window by
clicking on the contact/other stuff).

I've added a little St.Entry that lets you type in some terms to
search for contacts, and the idea is that the menu will then filter
out all the contacts matching the search terms.

It has just struck me that all I want is the `contactDisplay` search
provider in the Overview, but to display the results as items in a
PopupMenu instead of the results you get in the Overview.

Is there some way I can simply harness the code from search.js,
contactDisplay.js, searchDisplay.js etc to do the search functionality
for me?

I notice that in contactSearchProvider.js, all ContactSearchProvider
does is implement a `createResultActor` method that returns a 'new
Contact(..)' (which is the St.Bin holding the contact's avatar, alias,
etc), and also implements `createResultContainerActor` that makes an
icon grid in which to show the results.

I'd like to do something similar where my `createResultActor` returns
a `new ContactMenuItem(...)` which is just a PopupMenuItem, and
instead of the results being added to an icon grid, they're added to
the PopupMenu I specify.

Is this feasible? Which classes would I need to override to achieve
this? SearchTab, ContactDisplay, ... (I suppose I could have a 'tab'
being a PopupMenuSection that just gets hidden/shown as necessary?)

cheers!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]