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

Unified Diff: ash/common/system/tray/tray_popup_utils.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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/tray/tray_popup_utils.cc
diff --git a/ash/common/system/tray/tray_popup_utils.cc b/ash/common/system/tray/tray_popup_utils.cc
index a7cda5a74fec0bd57c525c16bb061856ee7a0b44..252bce06068cdc2a3b3ff738310ac038a8f612ca 100644
--- a/ash/common/system/tray/tray_popup_utils.cc
+++ b/ash/common/system/tray/tray_popup_utils.cc
@@ -117,13 +117,8 @@ class BorderlessLabelButton : public views::LabelButton {
SetBorder(views::CreateEmptyBorder(gfx::Insets(0, kHorizontalPadding)));
TrayPopupItemStyle style(nullptr, TrayPopupItemStyle::FontStyle::BUTTON);
style.SetupLabel(label());
- // TODO(tdanderson): Update focus rect for material design. See
- // crbug.com/615892
- // Hack alert: CreateSolidFocusPainter should add 0.5f to all insets to
- // make the lines align to pixel centers, but for now it doesn't. We can
- // get around this by relying on Skia rounding up integer coordinates.
SetFocusPainter(views::Painter::CreateSolidFocusPainter(
- kFocusBorderColor, gfx::Insets(0, 0, 1, 1)));
+ kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()));
tdanderson 2016/11/23 02:19:07 optional: consider adding a GetFocusPainter() to T
Evan Stade 2016/11/28 19:05:53 Done.
} else {
SetBorder(std::unique_ptr<views::Border>(new TrayPopupLabelButtonBorder));
SetFocusPainter(views::Painter::CreateSolidFocusPainter(
@@ -243,7 +238,6 @@ views::ImageView* TrayPopupUtils::CreateMoreImageView() {
views::Slider* TrayPopupUtils::CreateSlider(views::SliderListener* listener) {
const bool is_material = MaterialDesignController::IsSystemTrayMenuMaterial();
views::Slider* slider = views::Slider::CreateSlider(is_material, listener);
- slider->set_focus_border_color(kFocusBorderColor);
if (is_material) {
slider->SetBorder(
views::CreateEmptyBorder(gfx::Insets(0, kTrayPopupSliderPaddingMD)));
@@ -264,10 +258,8 @@ views::ToggleButton* TrayPopupUtils::CreateToggleButton(
(kTrayToggleButtonWidth - toggle_size.width()) / 2;
toggle->SetBorder(views::CreateEmptyBorder(
gfx::Insets(vertical_padding, horizontal_padding)));
- // TODO(tdanderson): Update the focus rect color, border thickness, and
- // location for material design.
toggle->SetFocusPainter(views::Painter::CreateSolidFocusPainter(
- kFocusBorderColor, gfx::Insets(1)));
+ kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()));
toggle->SetAccessibleName(l10n_util::GetStringUTF16(accessible_name_id));
return toggle;
}

Powered by Google App Engine
This is Rietveld 408576698