Commit b68d203e authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Set explicit color for bubble close button

Made in service of dark mode, but also setting one for light mode after
consulting with UX.

Bug: 918194
Change-Id: Ie4a5c76cd8ba833d5e518a65fea1ff21d0f8b28d
Reviewed-on: https://chromium-review.googlesource.com/c/1393022Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619520}
parent 1ddbb012
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#if BUILDFLAG(ENABLE_APP_LIST) #if BUILDFLAG(ENABLE_APP_LIST)
#include "ash/public/cpp/app_list/app_list_constants.h" #include "ash/public/cpp/app_list/app_list_constants.h"
#include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPaint.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/background.h" #include "ui/views/background.h"
#endif #endif
...@@ -135,7 +136,8 @@ class AppListDialogContainer : public BaseDialogContainer, ...@@ -135,7 +136,8 @@ class AppListDialogContainer : public BaseDialogContainer,
explicit AppListDialogContainer(views::View* dialog_body) explicit AppListDialogContainer(views::View* dialog_body)
: BaseDialogContainer(dialog_body, base::RepeatingClosure()) { : BaseDialogContainer(dialog_body, base::RepeatingClosure()) {
SetBackground(std::make_unique<AppListOverlayBackground>()); SetBackground(std::make_unique<AppListOverlayBackground>());
close_button_ = views::BubbleFrameView::CreateCloseButton(this); close_button_ = views::BubbleFrameView::CreateCloseButton(
this, GetNativeTheme()->SystemDarkModeEnabled());
AddChildView(close_button_); AddChildView(close_button_);
} }
~AppListDialogContainer() override {} ~AppListDialogContainer() override {}
......
...@@ -88,7 +88,7 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& title_margins, ...@@ -88,7 +88,7 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& title_margins,
default_title_->SetVisible(false); default_title_->SetVisible(false);
AddChildView(default_title_); AddChildView(default_title_);
close_ = CreateCloseButton(this); close_ = CreateCloseButton(this, GetNativeTheme()->SystemDarkModeEnabled());
close_->SetVisible(false); close_->SetVisible(false);
#if defined(OS_WIN) #if defined(OS_WIN)
// Windows will automatically create a tooltip for the close button based on // Windows will automatically create a tooltip for the close button based on
...@@ -111,10 +111,13 @@ std::unique_ptr<Label> BubbleFrameView::CreateDefaultTitleLabel( ...@@ -111,10 +111,13 @@ std::unique_ptr<Label> BubbleFrameView::CreateDefaultTitleLabel(
} }
// static // static
Button* BubbleFrameView::CreateCloseButton(ButtonListener* listener) { Button* BubbleFrameView::CreateCloseButton(ButtonListener* listener,
bool is_dark_mode) {
ImageButton* close_button = nullptr; ImageButton* close_button = nullptr;
close_button = CreateVectorImageButton(listener); close_button = CreateVectorImageButton(listener);
SetImageFromVectorIcon(close_button, vector_icons::kCloseRoundedIcon); SetImageFromVectorIconWithColor(
close_button, vector_icons::kCloseRoundedIcon,
is_dark_mode ? SkColorSetA(SK_ColorWHITE, 0xDD) : gfx::kGoogleGrey700);
close_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_APP_CLOSE)); close_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_APP_CLOSE));
close_button->SizeToPreferredSize(); close_button->SizeToPreferredSize();
......
...@@ -38,7 +38,7 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, ...@@ -38,7 +38,7 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
const base::string16& title_text); const base::string16& title_text);
// Creates a close button used in the corner of the dialog. // Creates a close button used in the corner of the dialog.
static Button* CreateCloseButton(ButtonListener* listener); static Button* CreateCloseButton(ButtonListener* listener, bool is_dark_mode);
// NonClientFrameView: // NonClientFrameView:
gfx::Rect GetBoundsForClientView() const override; gfx::Rect GetBoundsForClientView() const override;
......
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