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

Side by Side Diff: ash/common/system/tray/tray_background_view.cc

Issue 2527513002: Update ash shelf/tray focus rects. (Closed)
Patch Set: rebase Created 4 years 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 | « ash/common/system/tray/system_menu_button.cc ('k') | ash/common/system/tray/tray_popup_utils.h » ('j') | 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/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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 576 }
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::Rect paint_bounds(GetFocusBounds()); 586 gfx::RectF paint_bounds(GetFocusBounds());
587 paint_bounds.Inset(2, -2, 3, -2); 587 paint_bounds.Inset(gfx::Insets(2, -2));
588 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor); 588 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor,
589 kFocusBorderThickness);
589 } 590 }
590 591
591 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { 592 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) {
592 ActionableView::OnPaint(canvas); 593 ActionableView::OnPaint(canvas);
593 if (!MaterialDesignController::IsShelfMaterial() || 594 if (!MaterialDesignController::IsShelfMaterial() ||
594 shelf()->GetBackgroundType() == 595 shelf()->GetBackgroundType() ==
595 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || 596 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT ||
596 !is_separator_visible_) { 597 !is_separator_visible_) {
597 return; 598 return;
598 } 599 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 644 }
644 645
645 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { 646 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const {
646 gfx::Insets insets = GetBackgroundInsets(); 647 gfx::Insets insets = GetBackgroundInsets();
647 gfx::Rect bounds = GetLocalBounds(); 648 gfx::Rect bounds = GetLocalBounds();
648 bounds.Inset(insets); 649 bounds.Inset(insets);
649 return bounds; 650 return bounds;
650 } 651 }
651 652
652 } // namespace ash 653 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_menu_button.cc ('k') | ash/common/system/tray/tray_popup_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698