Skip to content

Commit

Permalink
Enable color inversion for shelf tooltip bubble.
Browse files Browse the repository at this point in the history
Spec:

https://www.figma.com/file/rQFGy3iAMfNdDnydTGkvHr/Style-%7C-Semantic-color-system-surface-theming?node-id=522%3A28

Bug: 1134432
Change-Id: I92ba9d50bdef74d1bff52db34019f7ca7f58ca79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2508363
Reviewed-by: Min Chen <minch@chromium.org>
Reviewed-by: Yulun Wu <yulunwu@chromium.org>
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825056}
  • Loading branch information
Yulun Wu authored and Commit Bot committed Nov 6, 2020
1 parent e1f712f commit 5cf48d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ash/shelf/shelf_tooltip_bubble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "ash/shelf/shelf_tooltip_bubble.h"

#include "ash/style/ash_color_provider.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/wm/collision_detection/collision_detection_utils.h"
#include "ui/aura/window.h"
Expand Down Expand Up @@ -48,8 +49,12 @@ ShelfTooltipBubble::ShelfTooltipBubble(views::View* anchor,
SetLayoutManager(std::make_unique<views::FillLayout>());
views::Label* label = new views::Label(text);
label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
const SkColor tooltip_background = SkColorSetA(gfx::kGoogleGrey900, 0xE6);
const SkColor tooltip_text = SkColorSetA(gfx::kGoogleGrey200, 0xFF);
// TODO (https://crbug.com/1146125) Enable inverted tooltip colors.
const SkColor tooltip_background = AshColorProvider::Get()->GetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80);
const SkColor tooltip_text = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary);

set_color(tooltip_background);
label->SetEnabledColor(tooltip_text);
label->SetBackgroundColor(tooltip_background);
Expand Down

0 comments on commit 5cf48d2

Please sign in to comment.