helium/cat: prevent common actions from going into overflow menu (#457)

fixes #438
fixes #440
This commit is contained in:
wukko
2025-11-18 16:41:07 +06:00
committed by GitHub

View File

@@ -172,7 +172,23 @@
show_avatar_button_.Init(
prefs::kShowAvatarButton, prefs,
base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
@@ -700,6 +723,24 @@ bool ToolbarView::IsRectInWindowCaption(
@@ -564,10 +587,15 @@ void ToolbarView::Init() {
InitLayout();
+ auto flex_preferred = views::FlexSpecification(
+ views::MinimumFlexSizeRule::kPreferred,
+ views::MaximumFlexSizeRule::kPreferred);
+
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
home_, avatar_}) {
if (button) {
button->set_tag(GetViewCommandMap().at(button->GetID()));
+ button->SetProperty(views::kFlexBehaviorKey, flex_preferred);
}
}
if (browser_view_->GetSupportsTabStrip()) {
@@ -700,6 +728,24 @@ bool ToolbarView::IsRectInWindowCaption(
return gfx::ToEnclosingRect(rect_in_target_coords_f);
};
@@ -197,7 +213,7 @@
// Check each child view in container_view_ to see if the rect intersects with
// any clickable elements. If it does, check if the click is actually on that
// element. False if on a clickable element, true if not on a clickable element.
@@ -998,6 +1039,12 @@ void ToolbarView::InitLayout() {
@@ -998,6 +1044,12 @@ void ToolbarView::InitLayout() {
location_bar_->SetProperty(views::kMarginsKey,
gfx::Insets::VH(0, location_bar_margin));