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

Add margin to right of tab group title #18203

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

peize-li123
Copy link

I confirm that no security/privacy review is needed

Ticket for this issue is brave/brave-browser#29259

Description:
Before this PR, we only added a margin to empty title group headers, but non-empty headers also need some space between the header and its tabs.

Before:
image

After:
IMG_2830

@peize-li123 peize-li123 requested a review from a team as a code owner April 23, 2023 06:26
Copy link
Contributor

@sangwoo108 sangwoo108 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@@ -17,6 +17,7 @@
#undef TabGroupStyle

const int TabGroupStyle::kStrokeThicknessForVerticalTabs = 4;
const int TabGroupStyle::kTitleAdjustment = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

As we included the original tab_group_style.cc, we might be able to access the original constant there. if so, we can remove this and use kTitleAdjustmentForEmptyHeader = 2; for consistency.

Copy link
Author

Choose a reason for hiding this comment

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

Hi, Thanks for checking my PR! This was what I tried before but I did not figure our how to submit my code change in the original tab_group_style.cc. Do you have any clue how I can do that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I seem to be unclear about it. I think you got it right about modifying chromium_src/.../tab_group_style.cc . But I think you could do something like,

// chromium_src/.../tab_group_style.cc
int TabGroupStyle::GetTitleAdjustmentToTabGroupHeaderDesiredWidth(
  return kTitleAdjustmentForEmptyHeader;  // even this constant is defined in the origianl .cc file, we can use it here, I guess.
)

Then, you don't need to declare a new constant.


int TabGroupStyle::GetTitleAdjustmentToTabGroupHeaderDesiredWidth(
const std::u16string title) const {
return kTitleAdjustment;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be helpful if we have a comment about why we're overriding this, e.g.

"Sets spacing between title view and group header even when |title| is empty"

Copy link
Contributor

Choose a reason for hiding this comment

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

And I'm curious how this will affect the vertical tab, or does nothing to it?

Copy link
Author

Choose a reason for hiding this comment

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

It's not affecting the vertical tabs, and if we can modify the original constant then we don't need to override this anymore

@sangwoo108
Copy link
Contributor

sangwoo108 commented Apr 24, 2023

Hi, I've run our CI bots with this PR and it seems that the PR isn't formatted properly. Did you happen to run npm run format? And npm run presubmit could let you know potential problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants