Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vertical Tabs]: Add hover effect (uplift to 1.72.x) #25965

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions browser/ui/color/brave_color_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@
// as brave_color_mixer depends on this without deps to //ui/views:flags.
// But it's safe have without the guard as this file is included only when
// !is_android.
#define BRAVE_VERTICAL_TAB_COLOR_IDS \
E_CPONLY(kColorBraveVerticalTabSeparator) \
E_CPONLY(kColorBraveVerticalTabActiveBackground) \
E_CPONLY(kColorBraveVerticalTabInactiveBackground) \
E_CPONLY(kColorBraveVerticalTabNTBIconColor) \
E_CPONLY(kColorBraveVerticalTabNTBTextColor) \
#define BRAVE_VERTICAL_TAB_COLOR_IDS \
E_CPONLY(kColorBraveVerticalTabSeparator) \
E_CPONLY(kColorBraveVerticalTabActiveBackground) \
E_CPONLY(kColorBraveVerticalTabInactiveBackground) \
E_CPONLY(kColorBraveVerticalTabInactiveHoverBackground) \
E_CPONLY(kColorBraveVerticalTabNTBIconColor) \
E_CPONLY(kColorBraveVerticalTabNTBTextColor) \
E_CPONLY(kColorBraveVerticalTabNTBShortcutTextColor)

#define BRAVE_SHARED_PINNED_TAB_COLOR_IDS \
Expand Down
5 changes: 5 additions & 0 deletions browser/ui/tabs/brave_tab_color_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "ui/color/color_provider.h"
#include "ui/color/color_provider_key.h"
#include "ui/color/color_recipe.h"
#include "ui/color/color_transform.h"

namespace tabs {

Expand All @@ -30,6 +31,10 @@ void AddBraveTabThemeColorMixer(ui::ColorProvider* provider,
mixer[kColorBraveVerticalTabActiveBackground] = {
kColorTabBackgroundInactiveFrameActive};
mixer[kColorBraveVerticalTabInactiveBackground] = {kColorToolbar};
mixer[kColorBraveVerticalTabInactiveHoverBackground] =
ui::AlphaBlend(kColorBraveVerticalTabActiveBackground,
kColorBraveVerticalTabInactiveBackground,
/* 40% opacity */ 0.4 * SK_AlphaOPAQUE);
mixer[kColorBraveVerticalTabSeparator] = {kColorToolbarContentAreaSeparator};
mixer[kColorBraveVerticalTabNTBIconColor] = {
kColorTabForegroundInactiveFrameActive};
Expand Down
9 changes: 6 additions & 3 deletions browser/ui/views/tabs/brave_tab_style_views.inc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,12 @@ SkColor BraveVerticalTabStyle::GetTargetTabBackgroundColor(
return gfx::kPlaceholderColor;
}

return cp->GetColor(selection_state == TabStyle::TabSelectionState::kActive
? kColorBraveVerticalTabActiveBackground
: kColorBraveVerticalTabInactiveBackground);
if (selection_state == TabStyle::TabSelectionState::kInactive) {
return cp->GetColor(hovered ? kColorBraveVerticalTabInactiveHoverBackground
: kColorBraveVerticalTabInactiveBackground);
}

return cp->GetColor(kColorBraveVerticalTabActiveBackground);
}

bool BraveVerticalTabStyle::ShouldShowVerticalTabs() const {
Expand Down
Loading