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

Side by Side Diff: ash/common/shelf/shelf_button.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/shelf/app_list_button.cc ('k') | ash/common/system/tray/actionable_view.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shelf/shelf_button.h" 5 #include "ash/common/shelf/shelf_button.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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 } 465 }
466 466
467 void ShelfButton::OnBlur() { 467 void ShelfButton::OnBlur() {
468 ClearState(STATE_FOCUSED); 468 ClearState(STATE_FOCUSED);
469 CustomButton::OnBlur(); 469 CustomButton::OnBlur();
470 } 470 }
471 471
472 void ShelfButton::OnPaint(gfx::Canvas* canvas) { 472 void ShelfButton::OnPaint(gfx::Canvas* canvas) {
473 CustomButton::OnPaint(canvas); 473 CustomButton::OnPaint(canvas);
474 if (HasFocus()) { 474 if (HasFocus()) {
475 gfx::Rect paint_bounds(GetLocalBounds()); 475 canvas->DrawSolidFocusRect(gfx::RectF(GetLocalBounds()), kFocusBorderColor,
476 paint_bounds.Inset(1, 1, 1, 1); 476 kFocusBorderThickness);
477 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor);
478 } 477 }
479 } 478 }
480 479
481 void ShelfButton::OnGestureEvent(ui::GestureEvent* event) { 480 void ShelfButton::OnGestureEvent(ui::GestureEvent* event) {
482 switch (event->type()) { 481 switch (event->type()) {
483 case ui::ET_GESTURE_TAP_DOWN: 482 case ui::ET_GESTURE_TAP_DOWN:
484 AddState(STATE_HOVERED); 483 AddState(STATE_HOVERED);
485 return CustomButton::OnGestureEvent(event); 484 return CustomButton::OnGestureEvent(event);
486 case ui::ET_GESTURE_END: 485 case ui::ET_GESTURE_END:
487 ClearState(STATE_HOVERED); 486 ClearState(STATE_HOVERED);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 bar_->SetHorizontalAlignment(views::ImageView::TRAILING); 596 bar_->SetHorizontalAlignment(views::ImageView::TRAILING);
598 bar_->SetVerticalAlignment(views::ImageView::CENTER); 597 bar_->SetVerticalAlignment(views::ImageView::CENTER);
599 break; 598 break;
600 } 599 }
601 bar_->SchedulePaint(); 600 bar_->SchedulePaint();
602 } 601 }
603 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); 602 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL);
604 } 603 }
605 604
606 } // namespace ash 605 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/system/tray/actionable_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698