Commit f317fa8a authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Make UnifiedSystemTray background semi-transparent

According to UnifiedSystemTray spec, the tray has blurry background.

It is appropriate to use app_list::IsBackgroundBlurEnabled, becuase
app_list is moving from ui/app_list to ash/app_list (go/move-applist),
and also it returns true only on high-end devices which have small
performance impact when the blur is enabled.

Screenshot: http://screen/wUryXYd800Y
Design doc: go/cros-qs-restyling

TEST=out/Release/chrome
--enable-features=EnableBackgroundBlur,SystenTrayUnified
BUG=811641

Change-Id: I270751b734110023261bdb698af33b31fb1af87f
Reviewed-on: https://chromium-review.googlesource.com/970055Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544313}
parent f790e0fe
...@@ -127,6 +127,9 @@ extern const int kTrayPopupSystemInfoRowHeight; ...@@ -127,6 +127,9 @@ extern const int kTrayPopupSystemInfoRowHeight;
// The colors used when --enable-features=SystemTrayUnified flag is enabled. // The colors used when --enable-features=SystemTrayUnified flag is enabled.
constexpr SkColor kUnifiedMenuBackgroundColor = SkColorSetRGB(0x20, 0x21, 0x24); constexpr SkColor kUnifiedMenuBackgroundColor = SkColorSetRGB(0x20, 0x21, 0x24);
constexpr SkColor kUnifiedMenuBackgroundColorWithBlur =
SkColorSetA(kUnifiedMenuBackgroundColor, 0xB3);
constexpr float kUnifiedMenuBackgroundBlur = 30.f;
constexpr SkColor kUnifiedMenuTextColor = SkColorSetRGB(0xf1, 0xf2, 0xf3); constexpr SkColor kUnifiedMenuTextColor = SkColorSetRGB(0xf1, 0xf2, 0xf3);
constexpr SkColor kUnifiedMenuIconColor = SkColorSetRGB(0xf1, 0xf2, 0xf3); constexpr SkColor kUnifiedMenuIconColor = SkColorSetRGB(0xf1, 0xf2, 0xf3);
constexpr SkColor kUnifiedMenuSecondaryTextColor = constexpr SkColor kUnifiedMenuSecondaryTextColor =
......
...@@ -27,6 +27,7 @@ void ConfigureFeaturePodLabel(views::Label* label) { ...@@ -27,6 +27,7 @@ void ConfigureFeaturePodLabel(views::Label* label) {
label->SetMultiLine(true); label->SetMultiLine(true);
label->SizeToFit(kUnifiedFeaturePodSize.width()); label->SizeToFit(kUnifiedFeaturePodSize.width());
label->SetHorizontalAlignment(gfx::ALIGN_CENTER); label->SetHorizontalAlignment(gfx::ALIGN_CENTER);
label->SetSubpixelRenderingEnabled(false);
} }
} // namespace } // namespace
......
...@@ -30,6 +30,7 @@ SignOutButton::SignOutButton(views::ButtonListener* listener) ...@@ -30,6 +30,7 @@ SignOutButton::SignOutButton(views::ButtonListener* listener)
SetEnabledTextColors(kUnifiedMenuTextColor); SetEnabledTextColors(kUnifiedMenuTextColor);
SetHorizontalAlignment(gfx::ALIGN_CENTER); SetHorizontalAlignment(gfx::ALIGN_CENTER);
SetBorder(views::CreateEmptyBorder(gfx::Insets())); SetBorder(views::CreateEmptyBorder(gfx::Insets()));
label()->SetSubpixelRenderingEnabled(false);
TrayPopupUtils::ConfigureTrayPopupButton(this); TrayPopupUtils::ConfigureTrayPopupButton(this);
} }
......
...@@ -66,6 +66,7 @@ DateView::DateView() : label_(new views::Label) { ...@@ -66,6 +66,7 @@ DateView::DateView() : label_(new views::Label) {
AddChildView(label_); AddChildView(label_);
label_->SetAutoColorReadabilityEnabled(false); label_->SetAutoColorReadabilityEnabled(false);
label_->SetSubpixelRenderingEnabled(false);
label_->SetEnabledColor(kUnifiedMenuTextColor); label_->SetEnabledColor(kUnifiedMenuTextColor);
Update(); Update();
...@@ -174,6 +175,7 @@ void BatteryView::Update() { ...@@ -174,6 +175,7 @@ void BatteryView::Update() {
void BatteryView::ConfigureLabel(views::Label* label) { void BatteryView::ConfigureLabel(views::Label* label) {
label->SetAutoColorReadabilityEnabled(false); label->SetAutoColorReadabilityEnabled(false);
label->SetSubpixelRenderingEnabled(false);
label->SetEnabledColor(kUnifiedMenuSecondaryTextColor); label->SetEnabledColor(kUnifiedMenuSecondaryTextColor);
} }
...@@ -207,6 +209,7 @@ EnterpriseManagedView::EnterpriseManagedView() { ...@@ -207,6 +209,7 @@ EnterpriseManagedView::EnterpriseManagedView() {
auto* label = new views::Label; auto* label = new views::Label;
label->SetAutoColorReadabilityEnabled(false); label->SetAutoColorReadabilityEnabled(false);
label->SetSubpixelRenderingEnabled(false);
label->SetEnabledColor(kUnifiedMenuSecondaryTextColor); label->SetEnabledColor(kUnifiedMenuSecondaryTextColor);
label->SetText( label->SetText(
l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_SHORT)); l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_SHORT));
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "ash/system/unified/unified_system_tray.h" #include "ash/system/unified/unified_system_tray.h"
#include "ash/system/unified/unified_system_tray_controller.h" #include "ash/system/unified/unified_system_tray_controller.h"
#include "ash/system/unified/unified_system_tray_view.h" #include "ash/system/unified/unified_system_tray_view.h"
#include "ui/app_list/app_list_features.h"
namespace ash { namespace ash {
...@@ -29,13 +30,19 @@ UnifiedSystemTrayBubble::UnifiedSystemTrayBubble(UnifiedSystemTray* tray) ...@@ -29,13 +30,19 @@ UnifiedSystemTrayBubble::UnifiedSystemTrayBubble(UnifiedSystemTray* tray)
bubble_view->AddChildView(controller_->CreateView()); bubble_view->AddChildView(controller_->CreateView());
bubble_view->set_anchor_view_insets( bubble_view->set_anchor_view_insets(
tray->shelf()->GetSystemTrayAnchor()->GetBubbleAnchorInsets()); tray->shelf()->GetSystemTrayAnchor()->GetBubbleAnchorInsets());
bubble_view->set_color(kUnifiedMenuBackgroundColor); bubble_view->set_color(SK_ColorTRANSPARENT);
bubble_view->layer()->SetFillsBoundsOpaquely(false);
bubble_widget_ = views::BubbleDialogDelegateView::CreateBubble(bubble_view); bubble_widget_ = views::BubbleDialogDelegateView::CreateBubble(bubble_view);
bubble_widget_->AddObserver(this); bubble_widget_->AddObserver(this);
TrayBackgroundView::InitializeBubbleAnimations(bubble_widget_); TrayBackgroundView::InitializeBubbleAnimations(bubble_widget_);
bubble_view->InitializeAndShowBubble(); bubble_view->InitializeAndShowBubble();
if (app_list::features::IsBackgroundBlurEnabled()) {
// ClientView's layer (See TrayBubbleView::InitializeAndShowBubble())
bubble_view->layer()->parent()->SetBackgroundBlur(
kUnifiedMenuBackgroundBlur);
}
bubble_widget_->widget_delegate()->set_can_activate(true); bubble_widget_->widget_delegate()->set_can_activate(true);
bubble_widget_->Activate(); bubble_widget_->Activate();
......
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
#include "ash/system/unified/unified_system_tray_view.h" #include "ash/system/unified/unified_system_tray_view.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/unified/feature_pod_button.h" #include "ash/system/unified/feature_pod_button.h"
#include "ash/system/unified/feature_pods_container_view.h" #include "ash/system/unified/feature_pods_container_view.h"
#include "ash/system/unified/top_shortcuts_view.h" #include "ash/system/unified/top_shortcuts_view.h"
#include "ash/system/unified/unified_system_info_view.h" #include "ash/system/unified/unified_system_info_view.h"
#include "ui/app_list/app_list_features.h"
#include "ui/views/background.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
namespace ash { namespace ash {
...@@ -22,6 +25,13 @@ UnifiedSystemTrayView::UnifiedSystemTrayView( ...@@ -22,6 +25,13 @@ UnifiedSystemTrayView::UnifiedSystemTrayView(
SetLayoutManager( SetLayoutManager(
std::make_unique<views::BoxLayout>(views::BoxLayout::kVertical)); std::make_unique<views::BoxLayout>(views::BoxLayout::kVertical));
SetBackground(
views::CreateSolidBackground(app_list::features::IsBackgroundBlurEnabled()
? kUnifiedMenuBackgroundColorWithBlur
: kUnifiedMenuBackgroundColor));
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
AddChildView(new TopShortcutsView(controller_)); AddChildView(new TopShortcutsView(controller_));
AddChildView(feature_pods_container_); AddChildView(feature_pods_container_);
AddChildView(system_info_view_); AddChildView(system_info_view_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment