~allanlesage/unity8/dash-apps-visible-ordering

« back to all changes in this revision

Viewing changes to tests/autopilot/unity8/shell/emulators/dash.py

  • Committer: Allan LeSage
  • Date: 2014-04-02 19:20:39 UTC
  • Revision ID: allan.lesage@canonical.com-20140402192039-1ulqe5pwqhy124ig
Much clearer visual sorting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
        category_element = self._get_category_element(category)
175
175
        application_cards = category_element.select_many('Card')
176
176
 
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))
182
181
 
183
182
        result = []
184
183
        for card in application_cards: