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

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

Issue 2264383002: More closely align palette to spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tool-magnifier
Patch Set: Use 48x48 icon as source Created 4 years, 4 months 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/hover_highlight_view.cc
diff --git a/ash/common/system/tray/hover_highlight_view.cc b/ash/common/system/tray/hover_highlight_view.cc
index 05668ce61d56974347677b898cd53e1907c43daa..765dd58c6a3dc6452ab3f96376bd0815f81d0248 100644
--- a/ash/common/system/tray/hover_highlight_view.cc
+++ b/ash/common/system/tray/hover_highlight_view.cc
@@ -47,13 +47,12 @@ bool HoverHighlightView::GetTooltipText(const gfx::Point& p,
return true;
}
-void HoverHighlightView::AddRightIcon(const gfx::ImageSkia& image) {
+void HoverHighlightView::AddRightIcon(const gfx::ImageSkia& image,
+ int icon_size) {
DCHECK(box_layout_);
DCHECK(!right_icon_);
- right_icon_ = new views::ImageView();
- right_icon_->SetImageSize(
- gfx::Size(kTrayPopupDetailsIconWidth, kTrayPopupDetailsIconWidth));
+ right_icon_ = new FixedSizedImageView(icon_size, icon_size);
right_icon_->SetImage(image);
right_icon_->SetEnabled(enabled());
AddChildView(right_icon_);
@@ -73,26 +72,28 @@ void HoverHighlightView::AddIconAndLabel(const gfx::ImageSkia& image,
box_layout_ = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 3,
kTrayPopupPaddingBetweenItems);
SetLayoutManager(box_layout_);
- DoAddIconAndLabel(image, text, highlight);
+ DoAddIconAndLabel(image, kTrayPopupDetailsIconWidth, text, highlight);
}
-void HoverHighlightView::AddIndentedIconAndLabel(const gfx::ImageSkia& image,
- const base::string16& text,
- bool highlight) {
- box_layout_ = new views::BoxLayout(views::BoxLayout::kHorizontal,
- kTrayPopupPaddingHorizontal, 0,
- kTrayPopupPaddingBetweenItems);
+void HoverHighlightView::AddIconAndLabelCustomSize(const gfx::ImageSkia& image,
+ const base::string16& text,
+ bool highlight,
+ int icon_size,
+ int indent,
+ int space_between_items) {
+ box_layout_ = new views::BoxLayout(views::BoxLayout::kHorizontal, indent, 0,
+ space_between_items);
SetLayoutManager(box_layout_);
- DoAddIconAndLabel(image, text, highlight);
+ DoAddIconAndLabel(image, icon_size, text, highlight);
}
void HoverHighlightView::DoAddIconAndLabel(const gfx::ImageSkia& image,
+ int icon_size,
const base::string16& text,
bool highlight) {
DCHECK(box_layout_);
- views::ImageView* image_view =
- new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0);
+ views::ImageView* image_view = new FixedSizedImageView(icon_size, 0);
image_view->SetImage(image);
image_view->SetEnabled(enabled());
AddChildView(image_view);
@@ -151,8 +152,9 @@ views::Label* HoverHighlightView::AddCheckableLabel(const base::string16& text,
rb.GetImageNamed(IDR_MENU_CHECK).ToImageSkia();
int margin = kTrayPopupPaddingHorizontal +
kTrayPopupDetailsLabelExtraLeftMargin - kCheckLabelPadding;
- SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 3,
- kCheckLabelPadding));
+ box_layout_ = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 3,
+ kCheckLabelPadding);
+ SetLayoutManager(box_layout_);
views::ImageView* image_view = new FixedSizedImageView(margin, 0);
image_view->SetImage(check);
image_view->SetHorizontalAlignment(views::ImageView::TRAILING);

Powered by Google App Engine
This is Rietveld 408576698