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

Tabs bottom border radius and separator UI #422

Merged
merged 3 commits into from
Sep 13, 2018
Merged

Conversation

petemill
Copy link
Member

@petemill petemill commented Sep 7, 2018

Fix brave/brave-browser#962

Brave design spec shows no bottom border radius on tabs.
This patching method, although not great, is simple compared to the amount of code which would need to be copied over and only slightly modified, since bottom border radius is calculated in the middle of a long drawing function.

Feedback appreciated.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Needed or QA/No-QA-Needed) to include the closed issue in milestone

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@petemill petemill self-assigned this Sep 7, 2018
@petemill petemill requested review from bridiver and bbondy and removed request for bridiver and bbondy September 7, 2018 20:49
@petemill petemill changed the title Remove bottom border radius from Tabs [WIP] Remove bottom border radius from Tabs Sep 7, 2018
@bbondy bbondy changed the title [WIP] Remove bottom border radius from Tabs WIP: Remove bottom border radius from Tabs Sep 8, 2018
@bbondy bbondy removed the 0.55.x label Sep 8, 2018
@bbondy
Copy link
Member

bbondy commented Sep 8, 2018

removed label on PR until it's landed on that branch, I think that's preferable to see fast when things are merged and not accidentally miss anything. I do this typically from the closed PR page.

@petemill petemill force-pushed the ui/tab-bottom-corners branch from f3842b1 to df6e36b Compare September 10, 2018 18:38
@petemill petemill changed the title WIP: Remove bottom border radius from Tabs Tabs bottom border radius and separator UI Sep 10, 2018
@petemill petemill changed the title Tabs bottom border radius and separator UI WIP: Tabs bottom border radius and separator UI Sep 10, 2018
@petemill
Copy link
Member Author

Rebasing and testing on latest master / C70

@petemill petemill force-pushed the ui/tab-bottom-corners branch 2 times, most recently from 8f7c159 to 6d36bf1 Compare September 11, 2018 03:56
@petemill
Copy link
Member Author

This is ready for review now. @bbondy @bridiver I also tagged you for review in case you had an opinion on this new patching method (making the chromium namespace non-anonymous so that it can be accessed by the brave override class).

@simonhong
Copy link
Member

simonhong commented Sep 11, 2018

When we need to override some original method and our new method needs many anonymous functions in original file, how about below in upstream file?

#if defined(BRAVE_CHROMIUM_BUILD)
void Tab::PaintSeparators(gfx::Canvas* canvas) {
  ...
  our implementation
  ...
}
#else
void Tab::PaintSeparators(gfx::Canvas* canvas) {
  ...
  original implementation
  ...
}
#endif

@petemill
Copy link
Member Author

@simonhong that is valid, but it puts some of our customized logic mixed in with the chromium source, whilst we may have some other logic in the brave modules. The method currently in this PR is a proposal to keep the logic changes in the brave modules to avoid confusion. If we still prefer putting the function in the patched file over de-anonymizing the namespace, then sure - I'll make that change.

browser/ui/views/tabs/brave_tab.cc Outdated Show resolved Hide resolved
browser/ui/views/tabs/brave_tab.cc Show resolved Hide resolved
@simonhong
Copy link
Member

@petemill , Yep, my suggestion is just another option :)

@simonhong simonhong changed the title WIP: Tabs bottom border radius and separator UI Tabs bottom border radius and separator UI Sep 12, 2018
Fix brave/brave-browser#962

Brave design spec shows no bottom border radius on tabs.
This patching method, although not great, is simple compared to the amount of code which would need to be copied over and only slightly modified.
@petemill petemill force-pushed the ui/tab-bottom-corners branch from 6d36bf1 to 6c10e41 Compare September 13, 2018 02:38
@petemill
Copy link
Member Author

@simonhong addressed all feedback now - thanks. Decided to keep in the de-anonymizing namespace option after speaking to other team members due to the less worse impact on future rebasing.

simonhong
simonhong previously approved these changes Sep 13, 2018
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.

LGTM with nits. 👍

flags.setColor(separator_color(separator_opacities.right));
canvas->DrawRoundRect(
trailing_separator_bounds, scaled_separator_radius, flags);
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: last empty line.

#include "ui/gfx/geometry/rect.h"

namespace chrome_browser_ui_views_tabs_tab_cc {
const gfx::RectF ScaleAndAlignBounds(const gfx::Rect& bounds,
Copy link
Member

Choose a reason for hiding this comment

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

nit: indent

}

class BraveTab : public Tab {
public:
Copy link
Member

Choose a reason for hiding this comment

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

nit: indent

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

++

@petemill petemill merged commit 0d1b737 into master Sep 13, 2018
@petemill petemill deleted the ui/tab-bottom-corners branch September 13, 2018 16:41
petemill added a commit that referenced this pull request Sep 13, 2018
Tabs bottom border radius and separator UI
@petemill
Copy link
Member Author

0.55.x f1d811d

@bbondy
Copy link
Member

bbondy commented Sep 14, 2018

Added merged/0.55.x label

@bbondy bbondy added this to the 0.55.x - Release milestone Jan 14, 2019
cezaraugusto added a commit that referenced this pull request Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab border refinement
4 participants