Skip to content

Commit

Permalink
修改功能_双击关闭标签页
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfoxtail committed Jan 14, 2023
1 parent d22b895 commit acec5ef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions patches/chrome-browser-ui-views-tabs-tab.cc.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 4e7a91bff0669d5f944a4b07dc62362a2f6fdf86..f07a30ff2a1ff857ad0984aa3b7ccfb36678df40 100644
index 4e7a91bff0669d5f944a4b07dc62362a2f6fdf86..afcbe90364878575a1d1027d4ae0d8d07d963c47 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -390,6 +390,7 @@ void Tab::Layout() {
Expand All @@ -10,7 +10,17 @@ index 4e7a91bff0669d5f944a4b07dc62362a2f6fdf86..f07a30ff2a1ff857ad0984aa3b7ccfb3
} else if (showing_close_button_) {
// Allow the title to overlay the close button's empty border padding.
title_right = close_x - after_title_padding;
@@ -1008,6 +1009,7 @@ void Tab::UpdateIconVisibility() {
@@ -530,7 +531,8 @@ void Tab::OnMouseReleased(const ui::MouseEvent& event) {
// Close tab on middle click, but only if the button is released over the tab
// (normal windows behavior is to discard presses of a UI element where the
// releases happen off the element).
- if (event.IsOnlyMiddleMouseButton()) {
+ if (event.IsOnlyMiddleMouseButton() ||
+ (event.IsOnlyLeftMouseButton() && event.GetClickCount() == 2)) {
if (HitTestPoint(event.location())) {
controller_->CloseTab(this, CLOSE_TAB_FROM_MOUSE);
} else if (closing_) {
@@ -1008,6 +1010,7 @@ void Tab::UpdateIconVisibility() {
available_width -= favicon_width;

showing_close_button_ = large_enough_for_close_button;
Expand Down

0 comments on commit acec5ef

Please sign in to comment.