• Manu Cornet's avatar
    CrOS Shelf: Change icon centering strategy · 0a9cd867
    Manu Cornet authored
    The main change here is that icons are first centered on the whole
    screen, then, when space becomes tighter, they are centered over the
    available area on the shelf.
    
    A few changes to make this work properly:
    
    * Fix an issue in |GetDimensionOfCenteredShelfItems| which was taking
      into account all items, even the ones within overflow, making the
      calculations incorrect.
    * Another issue was that the code calculating ideal bounds would
      assume control buttons (app list, back, overflow) were the same size
      as app buttons (56) while they're actually a little smaller (40).
      Giving control buttons their "real" size in the layout code allows
      for the removal of some overrides at each button class level.
    * Split out a small chunk from |CalculateIdealBounds| which is getting
      too long. More of that to come in future changes.
    * Make the special spacing between the app list button and the first
      app icon also there on the other side for more symmetry.
    
    Also add some extensive test coverage.
    
    Bug: 891080, 933291
    Change-Id: If4bb69aa6e182cd29c02d467039b5d839d09f493
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1512299
    Commit-Queue: Manu Cornet <manucornet@chromium.org>
    Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#642245}
    0a9cd867
overflow_bubble_view.cc 7.97 KB