-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated toolbar download button style
- Loading branch information
Showing
7 changed files
with
171 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/browser/ui/color/brave_color_id.h" | ||
|
||
#include "chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h" | ||
|
||
#define DownloadToolbarButtonView DownloadToolbarButtonViewChromium | ||
|
||
#include "src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc" | ||
|
||
#undef DownloadToolbarButtonView | ||
|
||
SkColor DownloadToolbarButtonView::GetIconColor() const { | ||
const DownloadDisplayController::IconInfo icon_info = GetIconInfo(); | ||
|
||
// Apply active color only when download is completed and user doesn't | ||
// interact with this button. | ||
if (icon_info.icon_state == download::DownloadIconState::kComplete && | ||
icon_info.is_active) { | ||
return GetColorProvider()->GetColor(kColorBraveDownloadToolbarButtonActive); | ||
} | ||
|
||
// Otherwise, always use inactive color. | ||
return GetColorProvider()->GetColor(kColorDownloadToolbarButtonInactive); | ||
} |
38 changes: 38 additions & 0 deletions
38
chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_TOOLBAR_BUTTON_VIEW_H_ | ||
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_TOOLBAR_BUTTON_VIEW_H_ | ||
|
||
#include "chrome/browser/download/bubble/download_display_controller.h" | ||
|
||
#define DownloadToolbarButtonView DownloadToolbarButtonViewChromium | ||
#define GetIconColor \ | ||
UnUsed() { \ | ||
return SK_ColorTRANSPARENT; \ | ||
} \ | ||
\ | ||
protected: \ | ||
DownloadDisplayController::IconInfo GetIconInfo() const { \ | ||
return controller_->GetIconInfo(); \ | ||
} \ | ||
\ | ||
public: \ | ||
virtual SkColor GetIconColor | ||
|
||
#include "src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h" // IWYU pragma: export | ||
|
||
#undef GetIconColor | ||
#undef DownloadToolbarButtonView | ||
|
||
class DownloadToolbarButtonView : public DownloadToolbarButtonViewChromium { | ||
public: | ||
using DownloadToolbarButtonViewChromium::DownloadToolbarButtonViewChromium; | ||
|
||
// DownloadToolbarButtonViewChromium overrides: | ||
SkColor GetIconColor() const override; | ||
}; | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_TOOLBAR_BUTTON_VIEW_H_ |
13 changes: 13 additions & 0 deletions
13
patches/chrome-browser-ui-views-download-bubble-download_toolbar_button_view.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc | ||
index 7d3b2a36ed999db404460e315201f2ef37443f91..1976fe65c7b46e16d1244805c52f82e1a05d188d 100644 | ||
--- a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc | ||
+++ b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc | ||
@@ -59,7 +59,7 @@ | ||
|
||
namespace { | ||
|
||
-constexpr int kProgressRingRadius = 9; | ||
+constexpr int kProgressRingRadius = 12; | ||
constexpr int kProgressRingRadiusTouchMode = 12; | ||
constexpr float kProgressRingStrokeWidth = 1.7f; | ||
// 7.5 rows * 60 px per row = 450; |
37 changes: 37 additions & 0 deletions
37
vector_icons/chrome/app/vector_icons/download_in_progress.icon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
CANVAS_DIMENSIONS, 16, | ||
MOVE_TO, 8, 0.76f, | ||
R_CUBIC_TO, 0.32f, 0, 0.59f, 0.27f, 0.59f, 0.59f, | ||
R_V_LINE_TO, 8.55f, | ||
R_LINE_TO, 2.32f, -2.32f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.84f, 0.84f, | ||
R_LINE_TO, -3.32f, 3.32f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, -0.84f, 0, | ||
LINE_TO, 4.26f, 8.42f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.84f, -0.84f, | ||
LINE_TO, 7.41f, 9.9f, | ||
V_LINE_TO, 1.35f, | ||
ARC_TO, 0.59f, 0.59f, 0, 0, 1, 8, 0.76f, | ||
CLOSE, | ||
R_MOVE_TO, -6.65f, 9.97f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, 0.59f, | ||
R_V_LINE_TO, 1.66f, | ||
R_CUBIC_TO, 0, 0.59f, 0.48f, 1.07f, 1.07f, 1.07f, | ||
R_H_LINE_TO, 9.97f, | ||
R_CUBIC_TO, 0.59f, 0, 1.07f, -0.48f, 1.07f, -1.07f, | ||
R_V_LINE_TO, -1.66f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, -0.59f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, 0.59f, | ||
R_V_LINE_TO, 1.66f, | ||
R_ARC_TO, 2.25f, 2.25f, 0, 0, 1, -2.25f, 2.25f, | ||
H_LINE_TO, 3.02f, | ||
R_ARC_TO, 2.25f, 2.25f, 0, 0, 1, -2.25f, -2.25f, | ||
R_V_LINE_TO, -1.66f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, -0.59f, | ||
CLOSE, | ||
R_MOVE_TO, 0, 0, | ||
CLOSE |
37 changes: 37 additions & 0 deletions
37
vector_icons/chrome/app/vector_icons/download_toolbar_button.icon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
CANVAS_DIMENSIONS, 16, | ||
MOVE_TO, 8, 0.76f, | ||
R_CUBIC_TO, 0.32f, 0, 0.59f, 0.27f, 0.59f, 0.59f, | ||
R_V_LINE_TO, 8.55f, | ||
R_LINE_TO, 2.32f, -2.32f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.84f, 0.84f, | ||
R_LINE_TO, -3.32f, 3.32f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, -0.84f, 0, | ||
LINE_TO, 4.26f, 8.42f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.84f, -0.84f, | ||
LINE_TO, 7.41f, 9.9f, | ||
V_LINE_TO, 1.35f, | ||
ARC_TO, 0.59f, 0.59f, 0, 0, 1, 8, 0.76f, | ||
CLOSE, | ||
R_MOVE_TO, -6.65f, 9.97f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, 0.59f, | ||
R_V_LINE_TO, 1.66f, | ||
R_CUBIC_TO, 0, 0.59f, 0.48f, 1.07f, 1.07f, 1.07f, | ||
R_H_LINE_TO, 9.97f, | ||
R_CUBIC_TO, 0.59f, 0, 1.07f, -0.48f, 1.07f, -1.07f, | ||
R_V_LINE_TO, -1.66f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, -0.59f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, 0.59f, | ||
R_V_LINE_TO, 1.66f, | ||
R_ARC_TO, 2.25f, 2.25f, 0, 0, 1, -2.25f, 2.25f, | ||
H_LINE_TO, 3.02f, | ||
R_ARC_TO, 2.25f, 2.25f, 0, 0, 1, -2.25f, -2.25f, | ||
R_V_LINE_TO, -1.66f, | ||
R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.59f, -0.59f, | ||
CLOSE, | ||
R_MOVE_TO, 0, 0, | ||
CLOSE |