After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612348 - Alignment and spacing needs slight adjustment when displaying search results
Alignment and spacing needs slight adjustment when displaying search results
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-09 22:12 UTC by Jeremy Perry
Modified: 2011-02-14 18:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
annotated image of the problem (150.09 KB, image/png)
2010-03-09 22:13 UTC, Jeremy Perry
  Details
Additional image showing position of message text (3.31 KB, image/png)
2010-03-09 22:19 UTC, Jeremy Perry
  Details
Patch (4.31 KB, patch)
2010-03-14 17:32 UTC, Daniel Borgmann
none Details | Review
Cut-off results with patch applied (19.00 KB, image/png)
2010-03-14 19:10 UTC, Florian Müllner
  Details
Fixed cut-off search results (4.92 KB, patch)
2010-03-14 23:18 UTC, Daniel Borgmann
reviewed Details | Review

Description Jeremy Perry 2010-03-09 22:12:25 UTC
When the overview shows search results, you can notice that the heading "APPLICATIONS" is not in the same spot as when no search results are shown, and several other spots are inconsistent with the overview. This shift is noticable when moving into and out of search results. A good test to reproduce is to type the letter f - which should give you the result of Firefox and other apps. Note the position of the app icons and the header "APPLICATIONS" changes but it should not.

Please see attached annotated image.
Comment 1 Jeremy Perry 2010-03-09 22:13:01 UTC
Created attachment 155683 [details]
annotated image of the problem
Comment 2 Jeremy Perry 2010-03-09 22:16:09 UTC
I should have noted also that the messages that appear when searching or when no search results are found should appear in the same line as the first label. This will help make the presentation nicer. Attaching an example for this as well.
Comment 3 Jeremy Perry 2010-03-09 22:19:03 UTC
Created attachment 155685 [details]
Additional image showing position of message text
Comment 4 Daniel Borgmann 2010-03-14 17:32:27 UTC
Created attachment 156130 [details] [review]
Patch

This patch adjusts the mentioned spacings and makes app search results match the look of the app well. It also adds 4px spacing between the icon and label of other search results.
Comment 5 Florian Müllner 2010-03-14 19:10:13 UTC
Created attachment 156133 [details]
Cut-off results with patch applied

(In reply to comment #4)
> Created an attachment (id=156130) [details] [review]

Thanks for working on this!

While the spacing looks a lot better, there is a problem with search results not being displayed - there always seems to be one less than expected (see attachment). An extreme example: searching for "gnome-terminal" results in one match and an empty result area.

I also noted that you add two #dashSearchResults sections to the theme.
Comment 6 Daniel Borgmann 2010-03-14 23:18:38 UTC
Created attachment 156147 [details] [review]
Fixed cut-off search results
Comment 7 Daniel Borgmann 2010-03-14 23:26:03 UTC
(In reply to comment #5)
> Created an attachment (id=156133) [details]
> Cut-off results with patch applied
> 
> (In reply to comment #4)
> > Created an attachment (id=156130) [details] [review] [details] [review]
> 
> Thanks for working on this!
> 
> While the spacing looks a lot better, there is a problem with search results
> not being displayed - there always seems to be one less than expected (see
> attachment). An extreme example: searching for "gnome-terminal" results in one
> match and an empty result area.

Indeed, how could I miss that? The problem appears when there are less search results than would fit into the panel, and the spacing gets all messed up. The updated patch fixes that by always requesting enough space for the maximum amount of columns. I don't know if this is the most elegant, but it works fine.


> I also noted that you add two #dashSearchResults sections to the theme.

There should only be #dashSearchResults and #dashAppSearchResults. The former is a container around the different groups of search results, the latter is the container for the application search results. Did I miss something?
Comment 8 Colin Walters 2010-03-17 23:54:27 UTC
Review of attachment 156147 [details] [review]:

::: js/ui/appDisplay.js
@@ +204,3 @@
+            let childXSpacing = Math.max(0, width - childNaturalWidth) / 2;
+            let width = Math.min(this._item_size, childNaturalWidth);
+            /* Center the item in its allocation horizontally */

This needs a Math.floor().

@@ +206,3 @@
+            let childXSpacing = Math.max(0, width - childNaturalWidth) / 2;
+            let width = Math.min(this._item_size, childNaturalWidth);
+            /* Center the item in its allocation horizontally */

Ditto.

@@ +210,1 @@
+            let childBox = new Clutter.ActorBox();

This is totally unrelated to your patch...but I just realized that we can move the allocation of the ActorBox outside of the loop.  Might as well reduce GC pressure a bit.
Comment 9 Dan Winship 2011-02-14 18:30:04 UTC
patches against the old overview