-
Notifications
You must be signed in to change notification settings - Fork 894
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
Give main content area padding and a shadow #20526
Conversation
a4ab92a
to
e203b05
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.
Vertical tab related stuff LGTM but deferring the final call to @simonhong as he would know better about contents layout and sidebar layout.
Got below crash while resizing window. WDP Infobar(#15822) was launched at that time. Only happened once and can't repro it again.
|
@simonhong Ah, thanks! I see that layout is getting called recursively. STR:
|
e203b05
to
9571224
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.
++ with nits 👍🏼
@@ -262,10 +303,9 @@ void BraveBrowserView::UpdateSideBarHorizontalAlignment() { | |||
prefs::kSidePanelHorizontalAlignment); | |||
|
|||
sidebar_container_view_->SetSidebarOnLeft(on_left); | |||
static_cast<BraveContentsLayoutManager*>(GetContentsLayoutManager()) | |||
->set_sidebar_on_left(on_left); | |||
GetBrowserViewLayout()->set_sidebar_on_left(on_left); |
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.
nit: How about call sidebar_container_view_->SetSidebarOnLeft(on_left);
from BraveBrowserViewLayout::SetSidebarOnLeft()
as layout manager manages sidebar container?
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.
Good idea.
Another option would be to have BraveBrowserViewLayout
just get the "on left" state from sidebar_container_view_
, like sidebar_container_view_->is_sidebar_on_left()
. That way, we wouldn't have to worry about the "on left" state ever getting out of sync. Would that work?
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.
I think it's good idea. It seems BraveBrowserView
itself doesn't need left/right info
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.
Seems like BraveBrowserView
still needs to listen to the pref change so that it can re-layout, though?
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.
Ah, I thought you'll use container view for listening prefs instead :)
IMO, current one seems fine but container view or layout manager also could listen prefs change if you want.
#define BRAVE_SIDE_PANEL_WEB_UI_VIEW_H \ | ||
protected: \ | ||
void AddedToWidget() override; | ||
|
||
#include "src/chrome/browser/ui/views/side_panel/side_panel_web_ui_view.h" // IWYU pragma: export | ||
|
||
#undef BRAVE_SIDE_PANEL_WEB_UI_VIEW_H |
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 this, we could avoid side_panel_web_ui_view.h
patch file.
#include "ui/views/controls/webview/webview.h"
#define ViewHierarchyChanged \
AddedToWidget() override; \
void ViewHierarchyChanged
#include "src/chrome/browser/ui/views/side_panel/side_panel_web_ui_view.h" // IWYU pragma: export
#undef ViewHierarchyChanged
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.
Ah, I missed that we could include a dependency first to avoid interfering with parent class identifiers. Nice!
9571224
to
cae6fe3
Compare
@@ -19,13 +19,11 @@ | |||
#define BrowserWindow BraveBrowserWindow | |||
#define BrowserViewLayout BraveBrowserViewLayout |
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.
Looks like this is a duplicate entry with L28 (similar to how #undef was duplicated).
@@ -69,6 +69,8 @@ class SidebarContainerView | |||
SidebarContainerView& operator=(const SidebarContainerView&) = delete; | |||
|
|||
void Init(); | |||
|
|||
bool sidebar_on_left() { return sidebar_on_left_; } |
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.
const
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.
chromiun_src
LGTM (with one cleanup comment).
cae6fe3
to
63f645a
Compare
Resolves brave/brave-browser#31645
A new feature flag has been created for this change:
With feature flag enabled:
Implementation Notes
In order to round the corners of the combined webview and devtools area, all other views have been moved out of the contents container view, matching upstream. The following views have been re-parented to the browser view:
Significant refactoring has been done in
brave_browser_view_layout.cc
in order to accomplish this.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 lint
,npm 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: