Skip to content

Commit

Permalink
Put shortcut text always on the right side
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Jan 13, 2025
1 parent 13560dc commit 8d79126
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions browser/ui/views/frame/vertical_tab_strip_region_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,21 @@ class VerticalTabNewTabButton : public BraveNewTabButton {
text_->SetProperty(views::kFlexBehaviorKey,
views::FlexSpecification(
views::MinimumFlexSizeRule::kPreferredSnapToZero,
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(3)
.WithWeight(0));
views::MaximumFlexSizeRule::kPreferred)
.WithOrder(3));

constexpr int kFontSize = 12;
const auto text_font = text_->font_list();
text_->SetFontList(
text_font.DeriveWithSizeDelta(kFontSize - text_font.GetFontSize()));

auto* spacer = AddChildView(std::make_unique<views::View>());
spacer->SetProperty(
views::kFlexBehaviorKey,
views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero,
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(4));

shortcut_text_ = AddChildView(std::make_unique<views::Label>());
shortcut_text_->SetHorizontalAlignment(
gfx::HorizontalAlignment::ALIGN_RIGHT);
Expand Down

0 comments on commit 8d79126

Please sign in to comment.