Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/common/system/tray/tray_background_view.h" | 5 #include "ash/common/system/tray/tray_background_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 577 | 577 |
| 578 gfx::Rect TrayBackgroundView::GetFocusBounds() { | 578 gfx::Rect TrayBackgroundView::GetFocusBounds() { |
| 579 // The tray itself expands to the right and bottom edge of the screen to make | 579 // The tray itself expands to the right and bottom edge of the screen to make |
| 580 // sure clicking on the edges brings up the popup. However, the focus border | 580 // sure clicking on the edges brings up the popup. However, the focus border |
| 581 // should be only around the container. | 581 // should be only around the container. |
| 582 return GetContentsBounds(); | 582 return GetContentsBounds(); |
| 583 } | 583 } |
| 584 | 584 |
| 585 void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) { | 585 void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) { |
| 586 gfx::RectF paint_bounds(GetFocusBounds()); | 586 gfx::RectF paint_bounds(GetFocusBounds()); |
| 587 paint_bounds.Inset(gfx::Insets(2, -2)); | 587 if (MaterialDesignController::IsShelfMaterial()) |
| 588 paint_bounds.Inset(gfx::Insets(-2, 2, -2, 3)); | |
|
Evan Stade
2016/12/12 23:47:50
ick at these magic numbers. Where do they come fro
Greg Levin
2016/12/13 17:08:07
Agree with ick. That said, I'm not sure about the
tdanderson
2016/12/13 23:17:09
Leaving the non-md change in here is fine by me. N
Evan Stade
2016/12/14 00:48:16
I'm not really ok with these magic numbers though,
Greg Levin
2016/12/15 17:30:56
I don't know the details of the code, but the way
| |
| 589 else | |
| 590 paint_bounds.Inset(gfx::Insets(1, 1)); | |
| 588 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor, | 591 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor, |
| 589 kFocusBorderThickness); | 592 kFocusBorderThickness); |
| 590 } | 593 } |
| 591 | 594 |
| 592 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { | 595 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { |
| 593 ActionableView::OnPaint(canvas); | 596 ActionableView::OnPaint(canvas); |
| 594 if (!MaterialDesignController::IsShelfMaterial() || | 597 if (!MaterialDesignController::IsShelfMaterial() || |
| 595 shelf()->GetBackgroundType() == | 598 shelf()->GetBackgroundType() == |
| 596 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || | 599 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || |
| 597 !is_separator_visible_) { | 600 !is_separator_visible_) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 } | 647 } |
| 645 | 648 |
| 646 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { | 649 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { |
| 647 gfx::Insets insets = GetBackgroundInsets(); | 650 gfx::Insets insets = GetBackgroundInsets(); |
| 648 gfx::Rect bounds = GetLocalBounds(); | 651 gfx::Rect bounds = GetLocalBounds(); |
| 649 bounds.Inset(insets); | 652 bounds.Inset(insets); |
| 650 return bounds; | 653 return bounds; |
| 651 } | 654 } |
| 652 | 655 |
| 653 } // namespace ash | 656 } // namespace ash |
| OLD | NEW |