on xenial help sign in
Much clearer visual sorting.
commit42f4dc98401c008de4bc3c346457fd08b6a31b7d authorAllan LeSage <allan.lesage@canonical.com> dateWed 2 Apr 2014, 14:20 (13 years ago) parentc288e83
1 file changed+4−5
tests/autopilot/unity8/shell/emulators/dash.py+4−5
tests/autopilot/unity8/shell/emulators/dash.py+4−5
@@ -174,11 +174,10 @@ class DashApps(GenericScopeView):
174174 category_element = self._get_category_element(category)
175175 application_cards = category_element.select_many('Card')
176176
177− def visible_order(card):
178− """Enable sorting of cards by vertical, horizontal."""
179− # NOTE that we limit testable resolution to 10K
180− return card.globalRect[1] * 10000 + card.globalRect[0]
181− application_cards = sorted(application_cards, key=visible_order)
177+ # sort by y, x
178+ application_cards = sorted(
179+ application_cards,
180+ key=lambda card: (card.globalRect.y, card.globalRect.x))
182181
183182 result = []
184183 for card in application_cards: