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

Unified Diff: ash/common/system/tray/tray_background_view.cc

Issue 2569773002: Fix SysTray focus rect position (Closed)
Patch Set: Remove GetFocusBounds() 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/tray/tray_background_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_background_view.cc
diff --git a/ash/common/system/tray/tray_background_view.cc b/ash/common/system/tray/tray_background_view.cc
index 26d7797d3190ec631b3fff426aa36444232bb31f..597f87064e89c2a4ee1975c3befa8f0dfd4fe11b 100644
--- a/ash/common/system/tray/tray_background_view.cc
+++ b/ash/common/system/tray/tray_background_view.cc
@@ -568,16 +568,16 @@ void TrayBackgroundView::HandlePerformActionResult(bool action_performed,
ActionableView::HandlePerformActionResult(action_performed, event);
}
-gfx::Rect TrayBackgroundView::GetFocusBounds() {
+void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) {
// The tray itself expands to the right and bottom edge of the screen to make
// sure clicking on the edges brings up the popup. However, the focus border
// should be only around the container.
- return GetContentsBounds();
-}
-
-void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) {
- gfx::RectF paint_bounds(GetFocusBounds());
- paint_bounds.Inset(gfx::Insets(2, -2));
+ gfx::RectF paint_bounds(MaterialDesignController::IsShelfMaterial()
Evan Stade 2016/12/15 21:53:11 nit: instead of multiple ternaries I'd just use if
Greg Levin 2016/12/15 23:46:36 Heh... I wrote that version, then switched it back
+ ? GetBackgroundBounds()
+ : GetContentsBounds());
+ paint_bounds.Inset(gfx::Insets(MaterialDesignController::IsShelfMaterial()
+ ? -kFocusBorderThickness
+ : 1));
canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor,
kFocusBorderThickness);
}
« no previous file with comments | « ash/common/system/tray/tray_background_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698