on xenial help sign in
Much clearer visual sorting.
42f4dc9Allan LeSage
tests/autopilot/unity8/shell/emulators/dash.py+4−5
@@ -174,11 +174,10 @@ class DashApps(GenericScopeView):
174 category_element = self._get_category_element(category)
174 category_element = self._get_category_element(category)
175 application_cards = category_element.select_many('Card')
175 application_cards = category_element.select_many('Card')
176
176
177− def visible_order(card):
177+ # sort by y, x
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)
178+ application_cards = sorted(
179+ application_cards,
180+ key=lambda card: (card.globalRect.y, card.globalRect.x))
182
181
183 result = []
182 result = []
184 for card in application_cards:
183 for card in application_cards: