Skip to content

Commit

Permalink
Adjusted split view tile and its tabs padding/margin in non-vertical
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Dec 19, 2024
1 parent deaa7a8 commit e6c84c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 8 additions & 2 deletions browser/ui/views/tabs/brave_tab_container.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,14 @@ void BraveTabContainer::PaintBoundingBoxForTile(gfx::Canvas& canvas,
const bool is_vertical_tab =
tabs::utils::ShouldShowVerticalTabs(tab_slot_controller_->GetBrowser());
if (!is_vertical_tab) {
// In order to make gap between the bounding box and toolbar.
bounding_rects.Inset(gfx::Insets::VH(1, 0));
// In order to make margin between the bounding box and tab strip.
// Need to compensate the amount of overlap because it's hidden by overlap
// at bottom.
constexpr int kVerticalMargin = 2;
const int margin_bottom =
kVerticalMargin + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
bounding_rects.Inset(
gfx::Insets::TLBR(kVerticalMargin, 0, margin_bottom, 0));
}

constexpr auto kRadius = 12.f; // same value with --leo-radius-l
Expand Down
5 changes: 2 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 @@ -223,9 +223,8 @@ SkPath BraveVerticalTabStyle::GetPath(
tab_left += scale * kPaddingForVerticalTab;
tab_right -= scale * kPaddingForVerticalTab;
} else {
// As the horizontal tab has padding already we only gives 1 dip padding.
// Accumulative padding will be 4 dips.
constexpr auto kPaddingForHorizontalTab = 1;
// Give 2 dip more padding when tab is in tile.
constexpr auto kPaddingForHorizontalTab = 2;
tab_top += scale * kPaddingForHorizontalTab;
tab_bottom -= scale * kPaddingForHorizontalTab;
tab()->controller()->IsFirstTabInTile(tab())
Expand Down

0 comments on commit e6c84c6

Please sign in to comment.