From 7608f3b1643b4f26c85c682441e1e8a06eefe6e4 Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Wed, 26 Jun 2024 12:05:46 +0900 Subject: [PATCH] Fixed omnibox flickering with download toolbar button toggle fix https://github.com/brave/brave-browser/issues/39373 Our download button used smaller image size than other toolbar buttons. Set same icon size with other toolbar buttons. --- .../download/bubble/download_toolbar_button_view.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc b/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc index 773b79d4dfd4..c8ed12602de4 100644 --- a/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc +++ b/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc @@ -19,7 +19,7 @@ SkRect AdjustRingBounds(const gfx::RectF& ring_bounds); #define RectFToSkRect(ring_bounds) AdjustRingBounds(ring_bounds) #define DownloadToolbarButtonView DownloadToolbarButtonViewChromium -#define FromVectorIcon(icon, color) FromVectorIcon(icon, color, 16) +#define FromVectorIcon(icon, color) FromVectorIcon(icon, color, GetIconSize()) #include "src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc" @@ -76,21 +76,21 @@ void DownloadToolbarButtonView::UpdateIcon() { SkColor icon_color = GetColorProvider()->GetColor(ui::kColorAlertMediumSeverityIcon); - constexpr int kIconSize = 16; + const int icon_size = GetIconSize(); SetImageModel( ButtonState::STATE_NORMAL, - ui::ImageModel::FromVectorIcon(*new_icon, icon_color, kIconSize)); + ui::ImageModel::FromVectorIcon(*new_icon, icon_color, icon_size)); SetImageModel( ButtonState::STATE_HOVERED, - ui::ImageModel::FromVectorIcon(*new_icon, icon_color, kIconSize)); + ui::ImageModel::FromVectorIcon(*new_icon, icon_color, icon_size)); SetImageModel( ButtonState::STATE_PRESSED, - ui::ImageModel::FromVectorIcon(*new_icon, icon_color, kIconSize)); + ui::ImageModel::FromVectorIcon(*new_icon, icon_color, icon_size)); SetImageModel( Button::STATE_DISABLED, ui::ImageModel::FromVectorIcon( *new_icon, GetForegroundColor(ButtonState::STATE_DISABLED), - kIconSize)); + icon_size)); } }