Commit b618fbb4 authored by minch's avatar minch Committed by Commit Bot

dark_mode: Keep enabled color for brightness icon.

Bug: 1145363
Change-Id: Ia1d5a051aa2da436855b5891923a8b091d2039a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537592Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827355}
parent 6994a009
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/system/brightness/unified_brightness_slider_controller.h" #include "ash/system/brightness/unified_brightness_slider_controller.h"
#include "ui/gfx/paint_vector_icon.h"
namespace ash { namespace ash {
...@@ -37,4 +39,17 @@ const char* UnifiedBrightnessView::GetClassName() const { ...@@ -37,4 +39,17 @@ const char* UnifiedBrightnessView::GetClassName() const {
return "UnifiedBrightnessView"; return "UnifiedBrightnessView";
} }
void UnifiedBrightnessView::OnThemeChanged() {
UnifiedSliderView::OnThemeChanged();
// Override the color for the icon. Since the button is set to disabled but
// wants to keep the color for an enabled icon.
button()->SetImage(
views::Button::STATE_DISABLED,
gfx::CreateVectorIcon(
kUnifiedMenuBrightnessIcon,
AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kButtonIconColor)));
}
} // namespace ash } // namespace ash
...@@ -26,6 +26,7 @@ class UnifiedBrightnessView : public UnifiedSliderView, ...@@ -26,6 +26,7 @@ class UnifiedBrightnessView : public UnifiedSliderView,
// views::View: // views::View:
const char* GetClassName() const override; const char* GetClassName() const override;
void OnThemeChanged() override;
private: private:
UnifiedSystemTrayModel* const model_; UnifiedSystemTrayModel* const model_;
......
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