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

Make vertical tab strip resizable. #18567

Merged
merged 2 commits into from
May 23, 2023
Merged

Make vertical tab strip resizable. #18567

merged 2 commits into from
May 23, 2023

Conversation

sangwoo108
Copy link
Contributor

@sangwoo108 sangwoo108 commented May 22, 2023

Make the vertical tab strip resizable, with a minimum and maximum width approximately half/twice the standard tab width.

Screen.Recording.2023-05-22.at.10.08.41.PM.mov

Resolves brave/brave-browser#30322

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Dragging the right side of vertical tab strip should change the width of it.
  • Double-clicking the right side of it should reset the width to the default width.
  • The changed width should be persistent even after restarting the browser.

@sangwoo108 sangwoo108 force-pushed the sko/vtab-resize branch 3 times, most recently from 8366b3d to 1d0e7cc Compare May 23, 2023 01:28
@sangwoo108 sangwoo108 marked this pull request as ready for review May 23, 2023 02:04
Make the vertical tab strip resizable, with a minimum and maximum width
approximately half/twice the standard tab width."
@sangwoo108 sangwoo108 enabled auto-merge (squash) May 23, 2023 03:35
@sangwoo108 sangwoo108 disabled auto-merge May 23, 2023 03:35
display::Screen::GetScreen()->GetCursorScreenPoint().x();
if (!resize_offset_.has_value()) {
resize_offset_ = cursor_position - bounds_in_screen.right();
LOG(ERROR) << *resize_offset_;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dvlog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, removed.

Comment on lines 906 to 908
if (resizing_) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worried too much. I thought it could happen when the view is resized. Removed.

Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ ResizeArea seems very convenient! :)

@sangwoo108
Copy link
Contributor Author

++ ResizeArea seems very convenient! :)

Yeah, really is. Didn't have to struggle with event overriding 😄

@sangwoo108 sangwoo108 enabled auto-merge (squash) May 23, 2023 14:43
@sangwoo108 sangwoo108 merged commit 54f759c into master May 23, 2023
@sangwoo108 sangwoo108 deleted the sko/vtab-resize branch May 23, 2023 15:28
@github-actions github-actions bot added this to the 1.53.x - Nightly milestone May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resize handle for vertical tab strip
2 participants