Skip to content

Commit

Permalink
Fixed omnibox flickering with download toolbar button toggle
Browse files Browse the repository at this point in the history
fix brave/brave-browser#39373

Our download button used smaller image size than other toolbar buttons.
Set same icon size with other toolbar buttons.
  • Loading branch information
simonhong authored and emerick committed Jun 26, 2024
1 parent 33514d3 commit 7608f3b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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));
}
}

Expand Down

0 comments on commit 7608f3b

Please sign in to comment.