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

Fix newtab button isn't clickable #430

Merged
merged 1 commit into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions browser/ui/views/tabs/brave_new_tab_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,16 @@ void BraveNewTabButton::PaintPlusIcon(gfx::Canvas* canvas, int offset, int size)
const int fixed_offset = (GetContentsBounds().width() / 2) - (size / 2);
NewTabButton::PaintPlusIcon(canvas, fixed_offset, size);
}

SkPath BraveNewTabButton::GetNewerMaterialUiButtonPath(float button_y,
float scale,
bool extend_to_top,
bool for_fill) const {
SkPath path;
const gfx::Rect contents_bounds = GetContentsBounds();
path.addRect(0, extend_to_top ? 0 : button_y,
contents_bounds.width() * scale,
button_y + contents_bounds.height() * scale);
path.close();
return path;
}
petemill marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions browser/ui/views/tabs/brave_new_tab_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class BraveNewTabButton : public NewTabButton {
private:
gfx::Size CalculatePreferredSize() const override;
void PaintPlusIcon(gfx::Canvas* canvas, int offset, int size) override;
SkPath GetNewerMaterialUiButtonPath(float button_y,
float scale,
bool extend_to_top,
bool for_fill) const override;
petemill marked this conversation as resolved.
Show resolved Hide resolved
DISALLOW_COPY_AND_ASSIGN(BraveNewTabButton);
};

Expand Down
10 changes: 9 additions & 1 deletion patches/chrome-browser-ui-views-tabs-new_tab_button.h.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.h b/chrome/browser/ui/views/tabs/new_tab_button.h
index ee40211315f979cfc34a7373195b2179b72429d4..9b3715cfe72390310b277f1ed0361821558da189 100644
index ee40211315f979cfc34a7373195b2179b72429d4..6b0e87c2a7ae38b47c4a452ff0d6bacb1cb2620f 100644
--- a/chrome/browser/ui/views/tabs/new_tab_button.h
+++ b/chrome/browser/ui/views/tabs/new_tab_button.h
@@ -25,6 +25,7 @@ class NewTabButton : public views::ImageButton,
Expand All @@ -19,3 +19,11 @@ index ee40211315f979cfc34a7373195b2179b72429d4..9b3715cfe72390310b277f1ed0361821

SkColor GetButtonFillColor(bool opaque) const;
SkColor GetIconColor() const;
@@ -120,6 +121,7 @@ class NewTabButton : public views::ImageButton,
// the path will be shrunk by 1px from all sides to allow room for the stroke
// to show up. If |extend_to_top| is true, the path is extended vertically to
// y = 0.
+ virtual
SkPath GetNewerMaterialUiButtonPath(float button_y,
float scale,
bool extend_to_top,