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

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

Issue 2527513002: Update ash shelf/tray focus rects. (Closed)
Patch Set: fixes Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/system_menu_button.h" 5 #include "ash/common/system/tray/system_menu_button.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/system/tray/system_tray.h" 8 #include "ash/common/system/tray/system_tray.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "ash/common/system/tray/tray_popup_utils.h" 10 #include "ash/common/system/tray/tray_popup_utils.h"
(...skipping 21 matching lines...) Expand all
32 SetImage(views::Button::STATE_NORMAL, &normal_icon); 32 SetImage(views::Button::STATE_NORMAL, &normal_icon);
33 SetImage(views::Button::STATE_DISABLED, &disabled_icon); 33 SetImage(views::Button::STATE_DISABLED, &disabled_icon);
34 34
35 const int horizontal_padding = (kMenuButtonSize - normal_icon.width()) / 2; 35 const int horizontal_padding = (kMenuButtonSize - normal_icon.width()) / 2;
36 const int vertical_padding = (kMenuButtonSize - normal_icon.height()) / 2; 36 const int vertical_padding = (kMenuButtonSize - normal_icon.height()) / 2;
37 SetBorder(views::CreateEmptyBorder(vertical_padding, horizontal_padding, 37 SetBorder(views::CreateEmptyBorder(vertical_padding, horizontal_padding,
38 vertical_padding, horizontal_padding)); 38 vertical_padding, horizontal_padding));
39 39
40 SetTooltipText(l10n_util::GetStringUTF16(accessible_name_id)); 40 SetTooltipText(l10n_util::GetStringUTF16(accessible_name_id));
41 41
42 // TODO(tdanderson): Update the focus rect color, border thickness, and
43 // location for material design.
44 SetFocusForPlatform(); 42 SetFocusForPlatform();
45 SetFocusPainter(views::Painter::CreateSolidFocusPainter( 43 SetFocusPainter(views::Painter::CreateSolidFocusPainter(
46 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); 44 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()));
47 45
48 SetInkDropMode(InkDropMode::ON); 46 SetInkDropMode(InkDropMode::ON);
49 set_has_ink_drop_action_on_click(true); 47 set_has_ink_drop_action_on_click(true);
50 set_ink_drop_base_color(kTrayPopupInkDropBaseColor); 48 set_ink_drop_base_color(kTrayPopupInkDropBaseColor);
51 set_ink_drop_visible_opacity(kTrayPopupInkDropRippleOpacity); 49 set_ink_drop_visible_opacity(kTrayPopupInkDropRippleOpacity);
52 } 50 }
53 51
54 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, 52 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener,
55 TrayPopupInkDropStyle ink_drop_style, 53 TrayPopupInkDropStyle ink_drop_style,
56 const gfx::VectorIcon& icon, 54 const gfx::VectorIcon& icon,
(...skipping 20 matching lines...) Expand all
77 SystemMenuButton::CreateInkDropHighlight() const { 75 SystemMenuButton::CreateInkDropHighlight() const {
78 return TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this); 76 return TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this);
79 } 77 }
80 78
81 std::unique_ptr<views::InkDropMask> SystemMenuButton::CreateInkDropMask() 79 std::unique_ptr<views::InkDropMask> SystemMenuButton::CreateInkDropMask()
82 const { 80 const {
83 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); 81 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this);
84 } 82 }
85 83
86 } // namespace ash 84 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698