-
Notifications
You must be signed in to change notification settings - Fork 868
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
[Rounded Corners]: Fix WebContents shadow in light mode #25738
Conversation
Hey @simonhong and @zenparsing I'm not sure if this is the best approach as it makes everything very interconnected. Do you have any ideas about a better approach? The solution here is basically:
|
|
||
.offset_y = 0, | ||
.blur_radius = BraveContentsViewUtil::kMarginThickness, | ||
.shadow_color = SkColorSetA(SK_ColorBLACK, 0.1 * 255)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.1 is actually what's in the Figma now, so this might have changed
// View::ReorderChildView() didn't work for us. So remove child views and | ||
// add them again. | ||
base::ranges::for_each(children(), | ||
base::ranges::for_each(children_copy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this, I was encountering crashes - I've made a separate PR for this as it's not really related, and I don't know if this PR will land 😆
base::BindRepeating(&VerticalTabStripRegionView::OnBrowserPanelsMoved, | ||
base::Unretained(this))); | ||
|
||
sidebar_side_.Init( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda sucks that vertical tabs needs to know about sidebar 😢
// Don't need contents container's left or right margin with vertical tab as | ||
// vertical tab itself has sufficient padding. | ||
if (tabs::utils::ShouldShowVerticalTabs(browser_view_->browser()) && | ||
!IsFullscreenForBrowser()) { | ||
if (tabs::utils::IsVerticalTabOnRight(browser_view_->browser())) { | ||
contents_margins.set_right(0); | ||
contents_margins.set_right(contents_margin_for_rounded_corners); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we remove the margin from the webcontents for vertical tabs. This fixes the issue, but it means we double pad @simonhong (the WebContents and the VerticalTabs sidebar)
@@ -282,9 +291,9 @@ void BraveBrowserViewLayout::UpdateContentsContainerInsets( | |||
// If sidebar is shown in left-side, contents container doens't need its | |||
// left margin. | |||
if (sidebar_container_->sidebar_on_left()) { | |||
contents_margins.set_left(0); | |||
contents_margins.set_left(contents_margin_for_rounded_corners); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same, but for the sidebar
.blur_radius = 4, | ||
.shadow_color = SkColorSetA(SK_ColorBLACK, 0.07 * 255)}; | ||
|
||
.offset_y = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the offset_y
set the shadow between the location bar and the web contents was hard to see, so I removed it
After I cherry picked this PR's commits to latest master and enabled rounded corner feature, I got startup crash with this.
|
88db000
to
41da62f
Compare
Huh, weird it doesn't work for you. I'll dig into it tomorrow. Out of interest, does it work if you disable the check? |
It works w/o that check. |
41da62f
to
8f92316
Compare
8f92316
to
003b481
Compare
@simonhong could you take another look? |
@fallaciousreasoning This PR really made browser window beautiful! 👍🏼 Sorry but I can see another startup crash after enabling vertical tab.
and I'm still seeing sidebar UI flickering when toggled. It would be great if we can avoid it! |
Interestingly, I can reduce that error when I commit out the |
I'm not sure why but it seems empty during the startup? |
I found it - it was because Thanks @simonhong for your help! |
a52d4a9
to
651504a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ this touch is really nice 👍🏼
My last comment is optional as it's existing behavior. It's up to you!
@rebron do we want to uplift this to 1.71? I think we can leave it unless we're going to launch rounded corners, but might be worth having a look at the borders in 1.71 if not |
Released in v1.72.66 |
@fallaciousreasoning We want to uplift this into 1.71.x. We still need to discuss if we'll do rounded corners at all for release. |
Closed #25856 (review) 👍 |
…)" This reverts commit 74b1dfa.
Resolves brave/brave-browser#41313
Before:
After:
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: