Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 1967263002: Launcher icon is misaligned when shelf position is changed to Left/Right (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 void ShelfView::OnShelfAlignmentChanged() { 429 void ShelfView::OnShelfAlignmentChanged() {
430 overflow_button_->OnShelfAlignmentChanged(); 430 overflow_button_->OnShelfAlignmentChanged();
431 LayoutToIdealBounds(); 431 LayoutToIdealBounds();
432 for (int i = 0; i < view_model_->view_size(); ++i) { 432 for (int i = 0; i < view_model_->view_size(); ++i) {
433 if (i >= first_visible_index_ && i <= last_visible_index_) 433 if (i >= first_visible_index_ && i <= last_visible_index_)
434 view_model_->view_at(i)->Layout(); 434 view_model_->view_at(i)->Layout();
435 } 435 }
436 tooltip_.Close(); 436 tooltip_.Close();
437 if (overflow_bubble_) 437 if (overflow_bubble_)
438 overflow_bubble_->Hide(); 438 overflow_bubble_->Hide();
439 // For crbug.com/587931, because AppListButton layout logic is in OnPaint.
440 views::View* app_list_button = GetAppListButtonView();
441 if (app_list_button)
442 app_list_button->SchedulePaint();
439 } 443 }
440 444
441 void ShelfView::SchedulePaintForAllButtons() { 445 void ShelfView::SchedulePaintForAllButtons() {
442 for (int i = 0; i < view_model_->view_size(); ++i) { 446 for (int i = 0; i < view_model_->view_size(); ++i) {
443 if (i >= first_visible_index_ && i <= last_visible_index_) 447 if (i >= first_visible_index_ && i <= last_visible_index_)
444 view_model_->view_at(i)->SchedulePaint(); 448 view_model_->view_at(i)->SchedulePaint();
445 } 449 }
446 if (overflow_button_ && overflow_button_->visible()) 450 if (overflow_button_ && overflow_button_->visible())
447 overflow_button_->SchedulePaint(); 451 overflow_button_->SchedulePaint();
448 } 452 }
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 1885
1882 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1886 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1883 const gfx::Rect bounds = GetBoundsInScreen(); 1887 const gfx::Rect bounds = GetBoundsInScreen();
1884 int distance = shelf_->SelectValueForShelfAlignment( 1888 int distance = shelf_->SelectValueForShelfAlignment(
1885 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1889 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1886 bounds.x() - coordinate.x()); 1890 bounds.x() - coordinate.x());
1887 return distance > 0 ? distance : 0; 1891 return distance > 0 ? distance : 0;
1888 } 1892 }
1889 1893
1890 } // namespace ash 1894 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698