Skip to content

Commit

Permalink
Merge pull request #12334 from brave/fixed_sidebar_wallet_icon_color
Browse files Browse the repository at this point in the history
Fixed sidebar wallet icon color is not updated based on theme change
  • Loading branch information
simonhong committed Feb 18, 2022
2 parents 092b5ac + 0bd9dbd commit 6e9640d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions browser/ui/views/sidebar/sidebar_item_add_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ void SidebarItemAddButton::OnGestureEvent(ui::GestureEvent* event) {
}
}

void SidebarItemAddButton::OnThemeChanged() {
View::OnThemeChanged();

UpdateButtonImages();
}

void SidebarItemAddButton::AddedToWidget() {
UpdateButtonImages();
}
Expand Down
1 change: 1 addition & 0 deletions browser/ui/views/sidebar/sidebar_item_add_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SidebarItemAddButton : public SidebarButtonView,
void OnMouseExited(const ui::MouseEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
void AddedToWidget() override;
void OnThemeChanged() override;

// views::WidgetObserver overrides:
void OnWidgetDestroying(views::Widget* widget) override;
Expand Down
8 changes: 3 additions & 5 deletions browser/ui/views/sidebar/sidebar_items_contents_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ void SidebarItemsContentsView::UpdateAllBuiltInItemsViewState() {
if (!sidebar::IsBuiltInType(item))
continue;

if (item.open_in_panel) {
UpdateItemViewStateAt(item_index, item_index == active_index);
continue;
}

// If browser window has tab that loads brave talk, brave talk panel icon
// will use colored one for normal state also.
if (item.built_in_item_type ==
Expand All @@ -122,7 +117,10 @@ void SidebarItemsContentsView::UpdateAllBuiltInItemsViewState() {
item_index,
browser_->sidebar_controller()->DoesBrowserHaveOpenedTabForItem(
item));
continue;
}

UpdateItemViewStateAt(item_index, item_index == active_index);
}
}

Expand Down

0 comments on commit 6e9640d

Please sign in to comment.