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

Unified Diff: ash/system/tray/tray_popup_header_button.cc

Issue 800513002: Update TrayPopupHeaderButton Visual Feedback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/system/tray/tray_popup_header_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_popup_header_button.cc
diff --git a/ash/system/tray/tray_popup_header_button.cc b/ash/system/tray/tray_popup_header_button.cc
index 84c04fbb8a3f4dc3bc27ad010eca8ab93cf87cb4..0a1f206021bee38493e42c209749a6d477c92283 100644
--- a/ash/system/tray/tray_popup_header_button.cc
+++ b/ash/system/tray/tray_popup_header_button.cc
@@ -7,7 +7,7 @@
#include "ash/ash_constants.h"
#include "ash/system/tray/tray_constants.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/canvas.h"
+#include "ui/views/background.h"
#include "ui/views/painter.h"
namespace ash {
@@ -53,15 +53,13 @@ gfx::Size TrayPopupHeaderButton::GetPreferredSize() const {
return gfx::Size(ash::kTrayPopupItemHeight, ash::kTrayPopupItemHeight);
}
-void TrayPopupHeaderButton::OnPaintBorder(gfx::Canvas* canvas) {
- // Just the left border.
- const int kBorderHeight = 25;
- int padding = (height() - kBorderHeight) / 2;
- canvas->FillRect(gfx::Rect(0, padding, 1, height() - padding * 2),
- ash::kBorderDarkColor);
-}
-
void TrayPopupHeaderButton::StateChanged() {
+ if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
+ set_background(views::Background::CreateSolidBackground(
+ kTrayPopupHoverBackgroundColor));
+ } else {
+ set_background(nullptr);
+ }
SchedulePaint();
}
« no previous file with comments | « ash/system/tray/tray_popup_header_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698