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

Increase the contents view size so it can still receive events(please… (uplift to 1.71.x) #26026

Open
wants to merge 1 commit into
base: 1.71.x
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions browser/ui/brave_layout_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ std::optional<int> GetBraveLayoutConstant(LayoutConstant constant) {
}
case TAB_STRIP_HEIGHT: {
if (HorizontalTabsUpdateEnabled()) {
return brave_tabs::GetHorizontalTabStripHeight();
return brave_tabs::GetHorizontalTabStripHeight() +
GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
}
return std::nullopt;
}
Expand All @@ -57,7 +58,7 @@ std::optional<int> GetBraveLayoutConstant(LayoutConstant constant) {
if (!HorizontalTabsUpdateEnabled()) {
return std::nullopt;
}
return 0;
return 1;
}
case LOCATION_BAR_CHILD_CORNER_RADIUS:
return 4;
Expand Down
33 changes: 8 additions & 25 deletions browser/ui/views/frame/brave_non_client_hit_test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "brave/browser/ui/views/frame/brave_non_client_hit_test_helper.h"

#include "brave/browser/ui/views/tabs/vertical_tab_utils.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "ui/base/hit_test.h"
Expand Down Expand Up @@ -48,6 +49,12 @@ int NonClientHitTest(BrowserView* browser_view,
return hit_test_result;
}

// Below checking is only for dragging with tab when vertical tab is
// enabled and title is hidden.
if (!tabs::utils::ShouldShowVerticalTabs(browser_view->browser())) {
return HTNOWHERE;
}

// Now we have only resizable areas.
if (point_in_widget.x() <= kResizableArea &&
point_in_widget.y() <= kResizableArea) {
Expand All @@ -59,35 +66,11 @@ int NonClientHitTest(BrowserView* browser_view,
return HTTOPRIGHT;
}

if (point_in_widget.x() <= kResizableArea &&
point_in_widget.y() >= (widget_bounds.bottom() - kResizableArea)) {
return HTBOTTOMLEFT;
}

if (point_in_widget.x() >= (widget_bounds.right() - kResizableArea) &&
point_in_widget.y() >= (widget_bounds.bottom() - kResizableArea)) {
return HTBOTTOMRIGHT;
}

if (point_in_widget.x() <= kResizableArea) {
return HTLEFT;
}

if (point_in_widget.x() >= (widget_bounds.right() - kResizableArea)) {
return HTRIGHT;
}

if (point_in_widget.y() <= kResizableArea) {
return HTTOP;
}

if (point_in_widget.y() <= (widget_bounds.bottom() - kResizableArea)) {
return HTBOTTOM;
}

NOTREACHED_IN_MIGRATION()
<< "This shouldn't happen. Maybe due to inclusive/exclusive comparison?";
return hit_test_result;
return HTNOWHERE;
}

} // namespace brave
Loading