Commit a7a4dd07 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Fix system menu focus ring color

This fix changes focus ring colors for all ui elements
in the system menu to Google blue 300.

Bug: 960116
Change-Id: I2ad84b88168521240ac12434ab2a2d83fd704bf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2006266Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734183}
parent febaa302
...@@ -32,8 +32,7 @@ constexpr int kResizeInsideBoundsSize = 1; ...@@ -32,8 +32,7 @@ constexpr int kResizeInsideBoundsSize = 1;
// Background color used for the Chrome OS boot splash screen. // Background color used for the Chrome OS boot splash screen.
constexpr SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe); constexpr SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
// The border color of keyboard focus for launcher items and system tray. // The border thickness of keyboard focus for launcher items and system tray.
constexpr SkColor kFocusBorderColor = SkColorSetA(gfx::kGoogleBlue500, 0x99);
constexpr int kFocusBorderThickness = 2; constexpr int kFocusBorderThickness = 2;
constexpr int kDefaultLargeCursorSize = 64; constexpr int kDefaultLargeCursorSize = 64;
......
...@@ -89,6 +89,7 @@ class MoreButton : public views::Button { ...@@ -89,6 +89,7 @@ class MoreButton : public views::Button {
TrayPopupUtils::ConfigureTrayPopupButton(this); TrayPopupUtils::ConfigureTrayPopupButton(this);
views::InstallPillHighlightPathGenerator(this); views::InstallPillHighlightPathGenerator(this);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
~MoreButton() override = default; ~MoreButton() override = default;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "ash/system/tray/size_range_layout.h" #include "ash/system/tray/size_range_layout.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/unfocusable_label.h" #include "ash/system/tray/unfocusable_label.h"
#include "ash/system/unified/unified_system_tray_view.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
...@@ -253,7 +254,8 @@ views::ToggleButton* TrayPopupUtils::CreateToggleButton( ...@@ -253,7 +254,8 @@ views::ToggleButton* TrayPopupUtils::CreateToggleButton(
std::unique_ptr<views::Painter> TrayPopupUtils::CreateFocusPainter() { std::unique_ptr<views::Painter> TrayPopupUtils::CreateFocusPainter() {
return views::Painter::CreateSolidFocusPainter( return views::Painter::CreateSolidFocusPainter(
kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()); UnifiedSystemTrayView::GetFocusRingColor(), kFocusBorderThickness,
gfx::InsetsF());
} }
void TrayPopupUtils::ConfigureTrayPopupButton(views::Button* button) { void TrayPopupUtils::ConfigureTrayPopupButton(views::Button* button) {
......
...@@ -41,6 +41,7 @@ CustomShapeButton::CustomShapeButton(views::ButtonListener* listener) ...@@ -41,6 +41,7 @@ CustomShapeButton::CustomShapeButton(views::ButtonListener* listener)
TrayPopupUtils::ConfigureTrayPopupButton(this); TrayPopupUtils::ConfigureTrayPopupButton(this);
views::HighlightPathGenerator::Install( views::HighlightPathGenerator::Install(
this, std::make_unique<CustomShapeButtonHighlightPathGenerator>()); this, std::make_unique<CustomShapeButtonHighlightPathGenerator>());
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
CustomShapeButton::~CustomShapeButton() = default; CustomShapeButton::~CustomShapeButton() = default;
......
...@@ -63,6 +63,7 @@ FeaturePodIconButton::FeaturePodIconButton(views::ButtonListener* listener, ...@@ -63,6 +63,7 @@ FeaturePodIconButton::FeaturePodIconButton(views::ButtonListener* listener,
TrayPopupUtils::ConfigureTrayPopupButton(this); TrayPopupUtils::ConfigureTrayPopupButton(this);
views::InstallCircleHighlightPathGenerator(this); views::InstallCircleHighlightPathGenerator(this);
GetViewAccessibility().OverrideIsLeaf(true); GetViewAccessibility().OverrideIsLeaf(true);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
FeaturePodIconButton::~FeaturePodIconButton() = default; FeaturePodIconButton::~FeaturePodIconButton() = default;
...@@ -171,6 +172,8 @@ FeaturePodLabelButton::FeaturePodLabelButton(views::ButtonListener* listener) ...@@ -171,6 +172,8 @@ FeaturePodLabelButton::FeaturePodLabelButton(views::ButtonListener* listener)
SetPaintToLayer(); SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false); layer()->SetFillsBoundsOpaquely(false);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
FeaturePodLabelButton::~FeaturePodLabelButton() = default; FeaturePodLabelButton::~FeaturePodLabelButton() = default;
......
...@@ -31,6 +31,8 @@ RoundedLabelButton::RoundedLabelButton(views::ButtonListener* listener, ...@@ -31,6 +31,8 @@ RoundedLabelButton::RoundedLabelButton(views::ButtonListener* listener,
1, gfx::Font::NORMAL, gfx::Font::Weight::MEDIUM)); 1, gfx::Font::NORMAL, gfx::Font::Weight::MEDIUM));
TrayPopupUtils::ConfigureTrayPopupButton(this); TrayPopupUtils::ConfigureTrayPopupButton(this);
views::InstallPillHighlightPathGenerator(this); views::InstallPillHighlightPathGenerator(this);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
RoundedLabelButton::~RoundedLabelButton() = default; RoundedLabelButton::~RoundedLabelButton() = default;
......
...@@ -30,6 +30,8 @@ TopShortcutButton::TopShortcutButton(const gfx::VectorIcon& icon, ...@@ -30,6 +30,8 @@ TopShortcutButton::TopShortcutButton(const gfx::VectorIcon& icon,
AshColorProvider::ContentLayerType::kIconPrimary, AshColorProvider::ContentLayerType::kIconPrimary,
AshColorProvider::AshColorMode::kDark))); AshColorProvider::AshColorMode::kDark)));
SetEnabled(false); SetEnabled(false);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
TopShortcutButton::TopShortcutButton(views::ButtonListener* listener, TopShortcutButton::TopShortcutButton(views::ButtonListener* listener,
...@@ -46,6 +48,8 @@ TopShortcutButton::TopShortcutButton(views::ButtonListener* listener, ...@@ -46,6 +48,8 @@ TopShortcutButton::TopShortcutButton(views::ButtonListener* listener,
views::Button::STATE_DISABLED, views::Button::STATE_DISABLED,
gfx::CreateVectorIcon(icon, kTrayTopShortcutButtonIconSize, gfx::CreateVectorIcon(icon, kTrayTopShortcutButtonIconSize,
AshColorProvider::GetDisabledColor(icon_color))); AshColorProvider::GetDisabledColor(icon_color)));
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
TopShortcutButton::TopShortcutButton(views::ButtonListener* listener, TopShortcutButton::TopShortcutButton(views::ButtonListener* listener,
...@@ -59,6 +63,8 @@ TopShortcutButton::TopShortcutButton(views::ButtonListener* listener, ...@@ -59,6 +63,8 @@ TopShortcutButton::TopShortcutButton(views::ButtonListener* listener,
TrayPopupUtils::ConfigureTrayPopupButton(this); TrayPopupUtils::ConfigureTrayPopupButton(this);
views::InstallCircleHighlightPathGenerator(this); views::InstallCircleHighlightPathGenerator(this);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
TopShortcutButton::~TopShortcutButton() = default; TopShortcutButton::~TopShortcutButton() = default;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "ash/system/unified/sign_out_button.h" #include "ash/system/unified/sign_out_button.h"
#include "ash/system/unified/top_shortcut_button.h" #include "ash/system/unified/top_shortcut_button.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/user_chooser_detailed_view_controller.h" #include "ash/system/unified/user_chooser_detailed_view_controller.h"
#include "ash/system/unified/user_chooser_view.h" #include "ash/system/unified/user_chooser_view.h"
#include "base/numerics/ranges.h" #include "base/numerics/ranges.h"
...@@ -52,6 +53,7 @@ UserAvatarButton::UserAvatarButton(views::ButtonListener* listener) ...@@ -52,6 +53,7 @@ UserAvatarButton::UserAvatarButton(views::ButtonListener* listener)
SetFocusForPlatform(); SetFocusForPlatform();
views::InstallCircleHighlightPathGenerator(this); views::InstallCircleHighlightPathGenerator(this);
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
} }
} // namespace } // namespace
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "ash/system/supervised/supervised_icon_string.h" #include "ash/system/supervised/supervised_icon_string.h"
#include "ash/system/tray/system_tray_notifier.h" #include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tray_popup_utils.h"
#include "ash/system/unified/unified_system_tray_view.h"
#include "base/i18n/time_formatting.h" #include "base/i18n/time_formatting.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -108,6 +109,7 @@ DateView::DateView(UnifiedSystemTrayController* controller) ...@@ -108,6 +109,7 @@ DateView::DateView(UnifiedSystemTrayController* controller)
SetInstallFocusRingOnFocus(true); SetInstallFocusRingOnFocus(true);
SetFocusForPlatform(); SetFocusForPlatform();
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
SetInkDropMode(views::InkDropHostView::InkDropMode::OFF); SetInkDropMode(views::InkDropHostView::InkDropMode::OFF);
} }
...@@ -278,6 +280,7 @@ ManagedStateView::ManagedStateView(views::ButtonListener* listener, ...@@ -278,6 +280,7 @@ ManagedStateView::ManagedStateView(views::ButtonListener* listener,
SetInstallFocusRingOnFocus(true); SetInstallFocusRingOnFocus(true);
SetFocusForPlatform(); SetFocusForPlatform();
focus_ring()->SetColor(UnifiedSystemTrayView::GetFocusRingColor());
SetInkDropMode(views::InkDropHostView::InkDropMode::OFF); SetInkDropMode(views::InkDropHostView::InkDropMode::OFF);
} }
......
...@@ -282,6 +282,11 @@ SkColor UnifiedSystemTrayView::GetBackgroundColor() { ...@@ -282,6 +282,11 @@ SkColor UnifiedSystemTrayView::GetBackgroundColor() {
return ShelfConfig::Get()->GetThemedColorFromWallpaper(background_color); return ShelfConfig::Get()->GetThemedColorFromWallpaper(background_color);
} }
// static
SkColor UnifiedSystemTrayView::GetFocusRingColor() {
return ShelfConfig::Get()->shelf_focus_border_color();
}
// static // static
std::unique_ptr<views::Background> UnifiedSystemTrayView::CreateBackground() { std::unique_ptr<views::Background> UnifiedSystemTrayView::CreateBackground() {
return views::CreateBackgroundFromPainter( return views::CreateBackgroundFromPainter(
......
...@@ -64,6 +64,9 @@ class ASH_EXPORT UnifiedSystemTrayView : public views::View, ...@@ -64,6 +64,9 @@ class ASH_EXPORT UnifiedSystemTrayView : public views::View,
// Get the background color of unified system tray. // Get the background color of unified system tray.
static SkColor GetBackgroundColor(); static SkColor GetBackgroundColor();
// Get focus ring color for system tray elements.
static SkColor GetFocusRingColor();
// Create background of UnifiedSystemTray with rounded corners. // Create background of UnifiedSystemTray with rounded corners.
static std::unique_ptr<views::Background> CreateBackground(); static std::unique_ptr<views::Background> CreateBackground();
......
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