Commit Graph

78 Commits

Author SHA1 Message Date
Florian Müllner
792b963bda iconGrid: Change IconGrid.addItem() to take an object instead of an actor
IconGrid has never really been a general purpose container, but has
always been used in conjunction with BaseIcon. IconGrid will soon
gain the ability to adjust the item size dynamically to adapt to the
available space, which will require that we can make some more
assumptions about the items added to the grid (namely: we need
access to BaseIcon's setIconSize() method).
So change addItem() to take an object instead, which should have
an actor and a (BaseIcon) icon property.

Based on a patch by Carlos Soriano.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:36:39 +02:00
Carlos Soriano
cc449228f3 iconGrid: Rename childrenInRow to columnsForWidth
Since the parameter of the function is the width, reflect that in
the function name. Also, since we are counting columns, not only
children for each row, reflect that in the function name also.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 18:57:36 +02:00
Jasper St. Pierre
a7e9655e32 searchDisplay: Remove the setResults/getResultsForDisplay dance
Now that we control our own destiny, I noticed that getResultsToDisplay
is the only user of this._notDisplayedResult, and it's called immediately
after setResults, which is the only thing that sets it. Just remove the
stateness entirely.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:50 -04:00
Jasper St. Pierre
1ec82d2ddd searchDisplay: Remove getVisibleResultCount
This is only used in one place, so we can quickly substitute
where it's needed.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:50 -04:00
Jasper St. Pierre
98eaef621a searchDisplay: Remove the "provider meta"
As everything is tracked on the SearchResults or subclasses of now,
just use that, which we call the "provider display".

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:50 -04:00
Jasper St. Pierre
74a6ca58ef searchDisplay: Move the provider actors to the results display
Since the provider icon only appears in the list results, it makes
sense for that to be stored with the results class, rather than outside,
triggered by which sort of display it is.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
747faa43ae searchDisplay: Remove the providerIcon from the providerMeta
Since the resultsDisplay is tracking it, it's not needed.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
32a53f7412 searchDisplay: Remove focus management code
It turns out that this focus code broke sometime in the 3.6 cycle --
when updating results, the focus is always on the text entry, so this
never gets called. We'll eventually replace it with something that
keeps track of the focused result meta, but for now, remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
9c94e9813c searchDisplay: Make renderResults private
There's no need to call this from outside now.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
19749bb37f searchDisplay: Make the results display in charge of updating the actor
While this is a very simple translation right now, soon enough it will
be so that it will have a less crazy "public" API and can do things like
cache result metas.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
5ab4c484a5 searchDisplay: Remove clearDisplayForProvider
Since the two paths that call this want to keep the actor in two different
states, it makes sense to just call the one function that's the same between
both individually.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
e602199bfb searchDisplay: Add a base class for common parts of search results
Right now, this doesn't give us very much, since IconGrid and StBoxLayout
have different APIs. But since we want to introduce result caching, it
makes to reduce the duplication we already have so we don't need to add
the code to do so in both places.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
62e1c08dd6 searchDisplay: Remove pendingClear
It turns out that every time we call getResultsForDisplay is
directly after a setResults, so pendingClear is always true.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Jasper St. Pierre
46aa70aa09 searchDisplay: Add an accessible name to the provider icon
https://bugzilla.gnome.org/show_bug.cgi?id=696007
2013-03-18 12:12:40 -04:00
Jasper St. Pierre
41cf447c45 searchDisplay: Label search result actors for accessibility
https://bugzilla.gnome.org/show_bug.cgi?id=696007
2013-03-18 12:12:40 -04:00
Jasper St. Pierre
42d45bd14a searchDisplay: Scroll the search results when using keynav
This makes keynav for search results much more usable.

https://bugzilla.gnome.org/show_bug.cgi?id=689681
2013-03-12 19:29:48 -04:00
Giovanni Campagna
e7886734c4 search: fix description of results
"description" is documented as a valid field for search result metas,
and ListSearchResults implements it, so pass it down to be used.
Also, don't wrap the description in quotes, so that the search provider
can decide if it is an excerpt from the searched text or something else.
And to that extent, set use_markup to true, so that terms can be
highlighted.

https://bugzilla.gnome.org/show_bug.cgi?id=694906
2013-03-01 00:38:50 +01:00
Jasper St. Pierre
310dc10c4d Center the search results as well
Use overlay_scrollbars and the same padding.

https://bugzilla.gnome.org/show_bug.cgi?id=694701
2013-02-25 14:49:25 -05:00
Jasper St. Pierre
569797d7c5 searchDisplay: Remove doSearch
This is nothing but a middle man, as the view selector already owns
the search system. We want to start being a bit more tricky with what
we do with the search system so that we ignore whitespace, so let's
cut the middle-man out now.

https://bugzilla.gnome.org/show_bug.cgi?id=693458
2013-02-14 14:05:37 -05:00
Jeremy Bicha
2a5f8e84bb js: Use proper Unicode ellipsis (…) instead of three dots
https://bugzilla.gnome.org/show_bug.cgi?id=689542
2013-02-12 17:05:00 -05:00
Florian Müllner
af0b5e6176 searchDisplay: Unset default result when clearing search
If we fail to do so, a previously set result may be activated by
hitting enter, even if a search did not turn up any actual results.
2013-02-08 17:52:39 +01:00
Cosimo Cecchi
30aaa6e26c searchDisplay: set a max width on the search results scrolled child
On large displays, we don't want the search results list to expand
across the whole screen; set a maximum width of 1000px.
Unfortunately, since in St max-width only affects size requisition, we
need a little custom layout manager to have it applied to the allocation
too.

https://bugzilla.gnome.org/show_bug.cgi?id=692453
2013-01-24 12:06:46 -05:00
Tanner Doshier
660cfe707c searchDisplay: Make list results span all available horizontal space
https://bugzilla.gnome.org/show_bug.cgi?id=691967
2013-01-22 23:44:21 -05:00
Cosimo Cecchi
0155739bef search: remove more dead code
https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:54 -05:00
Cosimo Cecchi
3aa0d455c9 search: remove SearchResultDisplay base class
It's unused, and the clear() method is just wrong. Remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:54 -05:00
Tanner Doshier
c5d8484e19 searchDisplay: Add ListSearchResult and ListSearchResults
These are for all search results except apps (and Wanda).
We also simplify a bit the packing of search results, which removes some
ugly code in navigateFocus() where we needed to call
st_widget_navigate_focus() twice, since the grid icon was composed by
two nested boxes, both focusable.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:53 -05:00
Cosimo Cecchi
575ab0d609 searchDisplay: simplify drag actor source code
Make sure this._dragActorSource is always set from _init() to siplify
code.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:53 -05:00
Tanner Doshier
9af107feff searchDisplay, and others: Switch from provider title to provider icon
Display a '+' icon on the provider icon if there are more results that are
hidden. If the provider icon is clicked, ask the provider to launch itself and
perform a search with the current terms.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:53 -05:00
Cosimo Cecchi
ec7ade4ee6 remote-search: implement new ActivateResult() method
This allows us to fix the shortcomings of the original ActivateResult()
method. In particular:
- allow to pass the search terms to the provider
- allow to pass a user interaction timestamp

https://bugzilla.gnome.org/show_bug.cgi?id=689735
2012-12-06 12:15:13 -05:00
Cosimo Cecchi
9b846cbb83 search: remove additional params from activateResult() call
The only case when we're interested in using those parameters nowadays
is for DnD, which is handled in a separate method already.
Since we're not going to support DnD for non-app search results anyway,
drop the params from all the activateResults() calls; this will be
useful later since we're going to add another parameter to it.

https://bugzilla.gnome.org/show_bug.cgi?id=689735
2012-12-06 12:15:13 -05:00
Jasper St. Pierre
5fc16bb05b searchDisplay, appDisplay: Use ClutterPanAction for re-swipe scrolling
The sooner we can kill off the custom overview swipe scroll code, the
better.

https://bugzilla.gnome.org/show_bug.cgi?id=689062
2012-11-30 16:03:34 -05:00
Florian Müllner
175ddaa3a1 searchDisplay: Fix alignment of section headers in RTL locales
https://bugzilla.gnome.org/show_bug.cgi?id=684379
2012-09-21 21:03:52 +02:00
Rui Matos
c866b0dbfd Clean up vestiges of the OpenSearch system
https://bugzilla.gnome.org/show_bug.cgi?id=683583
2012-09-07 20:49:35 +02:00
Jasper St. Pierre
4ba1f26e4d searchDisplay: Improve the placement and style of the "No results" text
During user testing, it was shown that several people did not notice the
miniscule text label. Make it large and centered.

https://bugzilla.gnome.org/show_bug.cgi?id=683135
2012-08-31 16:43:52 -03:00
Jasper St. Pierre
ef4231b9c0 search: Junk the OpenSearch system
The original design for the overview had buttons for searching for
Wikipedia and Google, but in practice this is a bad idea. The buttons
are the default activations, meaning that using the overview as a
fluent motion of launching something - "firefxo<Enter>", will launch
Google/Wikipedia.

https://bugzilla.gnome.org/show_bug.cgi?id=670168
2012-08-19 21:19:17 -04:00
Florian Müllner
59246babea search: Remove createResultContainer() hook
It is now unused since the contacts search provider was the only
consumer, so remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=677442
2012-07-03 12:19:32 +02:00
Christian Weber
c1f51a7bf3 searchDisplay: Use the rowLimit we pass to the IconGrid
When displaying children, we need to make sure that we use the rowLimit
property that we pass to iconGrid, rather than assuming that it's
always MAX_SEARCH_RESULTS_ROWS in case some subclass (in an extension maybe)
wants to do something different.

https://bugzilla.gnome.org/show_bug.cgi?id=675527
2012-06-03 01:32:29 -04:00
Alejandro Piñeiro
94493cde35 a11y: setting the proper role/label_actor for SearchResult.content
role/label_actor should be used for the actor that will receive
the focus. In some cases it was also (wrongly) set on the
container, so using an AT like Orca, it exposed both.

https://bugzilla.gnome.org/show_bug.cgi?id=672242
2012-06-01 16:10:07 +02:00
Rui Matos
4ce2f80a2f searchDisplay: Remove the sync search completed code path
Now that all searches are async we can remove the code path for the
SearchSystem::search-completed signal which is no longer useful.

This patch ends up fixing the status text not being updated for when
there are no results.

https://bugzilla.gnome.org/show_bug.cgi?id=675328
2012-05-07 21:45:45 +02:00
Rui Matos
0862d1c804 searchDisplay: Remove a couple of no longer used variables
https://bugzilla.gnome.org/show_bug.cgi?id=675328
2012-05-07 21:45:42 +02:00
Jasper St. Pierre
333e380340 search: Remove the ability to add synchronous search providers
As shown in the previous commits, synchronous search is easily implemented
by the asynchronous search API. The only reason we still have a
synchronous search API is of historical reasons. Well, we're not a museum,
and git log can keep our fossils safe if need be....

https://bugzilla.gnome.org/show_bug.cgi?id=675328
2012-05-07 15:29:46 -03:00
Rui Matos
54788d750e searchDisplay: Reset the keyboard focus after displaying async results
We hide the content around displaying new search results to prevent
flickering, unfortunately, one side effect of hiding an actor is
losing key focus if it currently is on the that actor or any
child. This could happen in the case of async results showing up after
the user had moved focus to the search results.

This patch works around that issue by saving the key focus and
resetting it back after displaying the new async results.

https://bugzilla.gnome.org/show_bug.cgi?id=675078
2012-04-30 01:10:08 +02:00
Rui Matos
168e9eeac1 searchDisplay: Update the selection for async searches without results
This ensures that the initial selection is always set correctly. We
were missing the empty async search results case.

https://bugzilla.gnome.org/show_bug.cgi?id=673233
2012-04-06 14:09:40 +02:00
Florian Müllner
384c7e2c17 viewSelector: Allow to start navigating results using arrow keys
We currently require users to tab away from the search entry before
search results can be navigated using arrow keys. For convenience,
support using arrow keys directly from the entry.

https://bugzilla.gnome.org/show_bug.cgi?id=663901
2012-03-20 18:22:26 +01:00
Rui Matos
c2f304f3bc searchDisplay: Check the provider container for visibility
It's the provider container that might be !visible, not the individual
results.
2012-03-10 16:20:47 +01:00
Rui Matos
59ebec25f3 search: remove selection mechanism
Now that we are using standard St keyboard navigation we don't need
this specific keynav and selection mechanism for search results.

https://bugzilla.gnome.org/show_bug.cgi?id=663901
2012-03-10 15:00:18 +01:00
Rui Matos
b864b03a65 searchDisplay, viewSelector: add default result activation
Adds a way to highlight and activate the first search result when
pressing enter on the search entry.

https://bugzilla.gnome.org/show_bug.cgi?id=663901
2012-03-10 15:00:18 +01:00
Rui Matos
c7a37660ce searchDisplay, viewSelector: use St keynav in Applications and Search
https://bugzilla.gnome.org/show_bug.cgi?id=663901
2012-03-10 15:00:18 +01:00
Florian Müllner
e2c66ce48a search: Make asynchronous providers more explicit
Currently, asynchronous search providers are expected to call
startAsync() in getInitialResultSet()/getSubsearchResultSet(),
which will trigger async mode until the search is canceled or
updated. Switching between synchronous and asynchronous mode like
this makes asynchronous search an implementation detail, but being
transparent to the searchDisplay means that certain optimizations
don't work as expected. Namely, updating asynchronous search results
causes flickering, and the automatic selection never focuses
asynchronous results.
So change the API to require providers being either synchronous (with
the current getInitialResultSet()/getSubsearchResultSet() methods)
or asynchronous (with asynchronous variants), and handle asynchronous
providers explicitly in searchDisplay.

https://bugzilla.gnome.org/show_bug.cgi?id=663125
2012-02-21 23:00:53 +01:00
Florian Müllner
eb0d803617 searchDisplay: Split renderResults()
renderResults() updates the results set, determines the number of
results to display, retrieves the corresponding result metas and
adds a new results actor for each meta.
Splitting the function in those parts allows to move the retrieval
of the result metas into SearchResults, which is where we ensure
flicker-free rendering and control the selection - we want to keep
both features for asynchronous result metas which we are about to
introduce.

https://bugzilla.gnome.org/show_bug.cgi?id=663125
2012-02-21 23:00:53 +01:00