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 694256 - frequentView: Only display as many rows as we can fit
frequentView: Only display as many rows as we can fit
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: overview
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 694283 694330 (view as bug list)
Depends on: 694237
Blocks:
 
 
Reported: 2013-02-20 10:59 UTC by drago01
Modified: 2013-02-22 08:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
frequentView: Only display as many rows as we can fit (4.07 KB, patch)
2013-02-20 10:59 UTC, drago01
needs-work Details | Review
iconGrid: Add limitToParentAllocation and use it for FrequentView (3.63 KB, patch)
2013-02-21 23:39 UTC, drago01
none Details | Review
iconGrid: Add limitToParentAllocation property (2.24 KB, patch)
2013-02-21 23:49 UTC, drago01
none Details | Review
appDisplay: Use limitToParentAllocation for FrequentView (1.82 KB, patch)
2013-02-21 23:50 UTC, drago01
none Details | Review
iconGrid: Add fillParent property (3.35 KB, patch)
2013-02-22 04:17 UTC, Florian Müllner
committed Details | Review
appDisplay: Remove scroll view hack in FrequentView (2.59 KB, patch)
2013-02-22 04:17 UTC, Florian Müllner
committed Details | Review

Description drago01 2013-02-20 10:59:05 UTC
See patch.

Note this requires the patch from bug 694237 to work correctly.
Comment 1 drago01 2013-02-20 10:59:07 UTC
Created attachment 236909 [details] [review]
frequentView: Only display as many rows as we can fit

Replace the old fade hack with one that simply removes the icons that
do not fit on inside the allocation.
Comment 2 Florian Müllner 2013-02-20 11:24:21 UTC
Review of attachment 236909 [details] [review]:

I did the hack to get the app-picker refresh in in time for UI freeze. I don't consider this change to be bound to the freeze, so we have still some time to do it properly rather than replacing one hack with another one.

::: js/ui/appDisplay.js
@@ +303,3 @@
 
+        // We disable scrolling for this view as we only want to show
+        // a limited number of icons.

The hack is not so much the fade effect, but using a non-scrollable ScrollView in the first place - can we fix this properly then?

@@ +328,3 @@
+
+        // HACK: IconGrid currently lacks API to only display items that match the allocation
+        // so we remove the icons that do not fit afterwards ...

Ugh, that is horrible :-)

IconGrid should get an option to do exactly that - only display items that fit the given allocation.
Comment 3 Florian Müllner 2013-02-20 16:48:33 UTC
*** Bug 694283 has been marked as a duplicate of this bug. ***
Comment 4 drago01 2013-02-21 08:23:04 UTC
*** Bug 694330 has been marked as a duplicate of this bug. ***
Comment 5 drago01 2013-02-21 23:39:32 UTC
Created attachment 237126 [details] [review]
iconGrid: Add limitToParentAllocation and use it for FrequentView

This prevents us from using to many rows causing one being displayed as cut off
at the bottom.


So how about this?
Is it less horrible? ;)
Comment 6 Cosimo Cecchi 2013-02-21 23:44:39 UTC
Since it already has a custom xAlign property, maybe this should be called yExpand instead?
Comment 7 drago01 2013-02-21 23:49:47 UTC
Created attachment 237127 [details] [review]
iconGrid: Add limitToParentAllocation property

This property limits the number of displayed icons based on the height of
the parent's allocation. This allows us to display as many icons as we can
fit without overflowing.
Comment 8 drago01 2013-02-21 23:50:00 UTC
Created attachment 237128 [details] [review]
appDisplay: Use limitToParentAllocation for FrequentView

We only want to show as many icons as we can fit.
Comment 9 drago01 2013-02-21 23:50:36 UTC
(In reply to comment #6)
> Since it already has a custom xAlign property, maybe this should be called
> yExpand instead?

Hmm ... don't get this ... the problem has nothing to do with alignment.
Comment 10 Florian Müllner 2013-02-21 23:54:23 UTC
(In reply to comment #6)
> Since it already has a custom xAlign property, maybe this should be called
> yExpand instead?

The purpose of the property is to only paint children that fit the parent allocation, e.g. to prevent overallocation in the case that more children are added than fit. That's not what I'd understand by yExpand ...
Comment 11 Yosef Or Boczko 2013-02-21 23:56:15 UTC
Maybe instead fix the unnecessary line, to allow scrolling in Frequent?
Comment 12 Cosimo Cecchi 2013-02-21 23:59:01 UTC
Mine was just a drive-by comment, really...I see what the code does - the way I thought about it was whether the content makes an effort to expand vertically into the grid regardless of its allocation as opposed to being limited by the parent allocation.
I am fine with whichever name as long as the bug gets fixed, I just thought limitToParentAllocation was a bit weird as a name :)
Comment 13 Florian Müllner 2013-02-22 04:17:20 UTC
(In reply to comment #12)
> I am fine with whichever name as long as the bug gets fixed, I just thought
> limitToParentAllocation was a bit weird as a name :)

Yeah, I don't think it's a great name either :-)


(In reply to comment #7)
> iconGrid: Add limitToParentAllocation property
> 
> This property limits the number of displayed icons based on the height of
> the parent's allocation. This allows us to display as many icons as we can
> fit without overflowing.

I wrote a follow-up patch to replace the non-reactive scrollview-with-hidden-scrollbar with a custom widget that underallocates its children as necessary; however, when I was done it finally occurred to me what I didn't like about this approach: for the property to have any effect at all, very specific conditions have to be met (namely: a parent forcing underallocation). I'll attach a proposal for handling that part in IconGrid as well ...
Comment 14 Florian Müllner 2013-02-22 04:17:36 UTC
Created attachment 237139 [details] [review]
iconGrid: Add fillParent property

Setting this property will only display as many icons as fit the parent's
allocation, rather than overflowing.
Comment 15 Florian Müllner 2013-02-22 04:17:40 UTC
Created attachment 237140 [details] [review]
appDisplay: Remove scroll view hack in FrequentView

The frequent view should not be scrolled, but to work around the
icon grid overflowing, we used a (non-scrolling) scroll view anyway.
Now that IconGrid:fillParent allows us to avoid overflow, we can
remove this hack.
Comment 16 drago01 2013-02-22 08:38:00 UTC
Review of attachment 237139 [details] [review]:

OK this is indeed better.
Comment 17 drago01 2013-02-22 08:39:03 UTC
Review of attachment 237140 [details] [review]:

Looks good and works fine here. (For some reason it does not apply cleanly on master though).
Comment 18 Florian Müllner 2013-02-22 08:52:18 UTC
(In reply to comment #17)
> (For some reason it does not apply cleanly on master though).

Ah yes, I did the patches on top of bug 694261, the last one there creates a conflict in the context of the CSS hunk ...
Comment 19 Florian Müllner 2013-02-22 08:53:06 UTC
Attachment 237139 [details] pushed as 5f61b57 - iconGrid: Add fillParent property
Attachment 237140 [details] pushed as 7425b38 - appDisplay: Remove scroll view hack in FrequentView