Skip to content

Commit

Permalink
Use 4px between tab tile border and tab horizontal gap
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Dec 19, 2024
1 parent db46aae commit 9219ea5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion browser/ui/views/tabs/brave_tab_container.cc
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ void BraveTabContainer::SetDropArrow(
}

bool BraveTabContainer::IsPinnedTabContainer() const {
return tabs_view_model_.view_size() > 0 && tabs_view_model_.view_at(0)->data().pinned;
return tabs_view_model_.view_size() > 0 &&
tabs_view_model_.view_at(0)->data().pinned;
}

void BraveTabContainer::UpdateTabsBorderInTile(const TabTile& tile) {
Expand Down
21 changes: 14 additions & 7 deletions browser/ui/views/tabs/brave_tab_style_views.inc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,28 @@ SkPath BraveVerticalTabStyle::GetPath(
}
}

if (!is_pinned && IsTabTiled(tab()) && path_type != TabStyle::PathType::kHitTest) {
if (!is_pinned && IsTabTiled(tab()) &&
path_type != TabStyle::PathType::kHitTest) {
if (ShouldShowVerticalTabs()) {
tab()->controller()->IsFirstTabInTile(tab())
? tab_top += scale* kPaddingForVerticalTabInTile
: tab_bottom -= scale * kPaddingForVerticalTabInTile;
tab_left += scale * kPaddingForVerticalTabInTile;
tab_right -= scale * kPaddingForVerticalTabInTile;
} else {
// Give 2 dip more padding when tab is in tile.
constexpr auto kPaddingForHorizontalTab = 2;
tab_top += scale * kPaddingForHorizontalTab;
tab_bottom -= scale * kPaddingForHorizontalTab;
constexpr int kTotalVerticalPaddingForHorizontalTab = 6;
constexpr int kAdditionalVerticalPadding =
kTotalVerticalPaddingForHorizontalTab - brave_tabs::kHorizontalTabGap;
tab_top += scale * kAdditionalVerticalPadding;
tab_bottom -= scale * kAdditionalVerticalPadding;

constexpr int kTotalHorizontalPaddingForHorizontalTab = 4;
constexpr int kAdditionalHorizontalPadding =
kTotalHorizontalPaddingForHorizontalTab -
brave_tabs::kHorizontalTabInset;
tab()->controller()->IsFirstTabInTile(tab())
? tab_left += scale* kPaddingForHorizontalTab
: tab_right -= scale * kPaddingForHorizontalTab;
? tab_left += scale* kAdditionalHorizontalPadding
: tab_right -= scale * kAdditionalHorizontalPadding;
}
}

Expand Down

0 comments on commit 9219ea5

Please sign in to comment.