Skip to content

Commit fac9b6d

Browse files
committed
separate out download shelf into own .patch, fix tooltips not showing in shelf finally
1 parent 30c978d commit fac9b6d

4 files changed

Lines changed: 77 additions & 60 deletions

File tree

other/mini_installer.patch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,3 +994,4 @@ index 8b606fa040a8f..c64160e8a5279 100644
994994
- : base::PathService::Get(base::DIR_TEMP, &tmp_path);
995995
return tmp_path.Append(kLogFilename);
996996
}
997+

other/restore_download_shelf.patch

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
2+
index 42706748b2d50..90ce02a65ebd1 100644
3+
--- a/chrome/browser/ui/views/download/download_item_view.cc
4+
+++ b/chrome/browser/ui/views/download/download_item_view.cc
5+
@@ -65,6 +65,7 @@
6+
#include "ui/base/mojom/menu_source_type.mojom-forward.h"
7+
#include "ui/base/text/bytes_formatting.h"
8+
#include "ui/base/themed_vector_icon.h"
9+
+#include "ui/base/ui_base_features.h"
10+
#include "ui/color/color_id.h"
11+
#include "ui/color/color_provider.h"
12+
#include "ui/compositor/layer.h"
13+
@@ -116,7 +117,7 @@ namespace {
14+
constexpr int kTextWidth = 140;
15+
16+
// Padding before the icon and at end of the item.
17+
-constexpr int kStartPadding = 12;
18+
+constexpr int kStartPadding = 8;
19+
constexpr int kEndPadding = 6;
20+
21+
// Horizontal padding between progress indicator and filename/status text.
22+
@@ -192,6 +193,12 @@ class TransparentButton : public views::Button {
23+
24+
void OnTooltipTextUpdated() { parent()->GetTooltipText(); }
25+
26+
+ // Fix bug in CR af6f4b9c4f3b02fbcba3ffa3c7f4b65b0995aba3 that prevented download item tooltip from showing.
27+
+ std::u16string GetRenderedTooltipText(const gfx::Point& p) const override {
28+
+ const std::u16string this_tooltip_text = parent()->GetTooltipText();
29+
+ return this_tooltip_text;
30+
+ }
31+
+
32+
private:
33+
base::CallbackListSubscription tooltip_text_changed_subscription_;
34+
};
35+
@@ -602,6 +609,9 @@ gfx::Size DownloadItemView::CalculatePreferredSize(
36+
}
37+
}
38+
39+
+ if (features::IsThorium2024()) {
40+
+ height -= 16;
41+
+ }
42+
// The normal height of the item which may be exceeded if text is large.
43+
constexpr int kDefaultDownloadItemHeight = 48;
44+
return gfx::Size(width, std::max(kDefaultDownloadItemHeight,
45+
@@ -610,13 +620,6 @@ gfx::Size DownloadItemView::CalculatePreferredSize(
46+
47+
void DownloadItemView::OnPaintBackground(gfx::Canvas* canvas) {
48+
View::OnPaintBackground(canvas);
49+
-
50+
- // Draw the separator as part of the background. It will be covered by the
51+
- // focus ring when the view has focus.
52+
- gfx::Rect rect(width() - 1, 0, 1, height());
53+
- rect.Inset(gfx::Insets::VH(kTopBottomPadding, 0));
54+
- canvas->FillRect(GetMirroredRect(rect),
55+
- GetColorProvider()->GetColor(kColorToolbarSeparator));
56+
}
57+
58+
void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
59+
@@ -694,6 +697,14 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
60+
canvas->DrawImageInt(icon, bounds.x(), bounds.y());
61+
}
62+
63+
+ // Draw the separator as part of the background. It will be covered by the
64+
+ // focus ring when the view has focus.
65+
+ // Alex313031: TODO: Use NTB method to pop out to overlay and move right 1px
66+
+ gfx::Rect rect(width() - 1, 0, 1, height());
67+
+ rect.Inset(gfx::Insets::VH(kTopBottomPadding, 0));
68+
+ canvas->FillRect(GetMirroredRect(rect),
69+
+ GetColorProvider()->GetColor(kColorToolbarSeparator));
70+
+
71+
OnPaintBorder(canvas);
72+
}
73+

other/thorium-2024-ui.patch

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,66 +1399,6 @@ index 147193abed0f0..3a4acb12b6d5f 100644
13991399
}
14001400

14011401
DownloadBubbleRowView* DownloadBubblePrimaryView::GetRow(
1402-
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
1403-
index 31a271a03e5e6..ad03a301e1177 100644
1404-
--- a/chrome/browser/ui/views/download/download_item_view.cc
1405-
+++ b/chrome/browser/ui/views/download/download_item_view.cc
1406-
@@ -65,6 +65,7 @@
1407-
#include "ui/base/mojom/menu_source_type.mojom-forward.h"
1408-
#include "ui/base/text/bytes_formatting.h"
1409-
#include "ui/base/themed_vector_icon.h"
1410-
+#include "ui/base/ui_base_features.h"
1411-
#include "ui/color/color_id.h"
1412-
#include "ui/color/color_provider.h"
1413-
#include "ui/compositor/layer.h"
1414-
@@ -116,7 +117,7 @@ namespace {
1415-
constexpr int kTextWidth = 140;
1416-
1417-
// Padding before the icon and at end of the item.
1418-
-constexpr int kStartPadding = 12;
1419-
+constexpr int kStartPadding = 8;
1420-
constexpr int kEndPadding = 6;
1421-
1422-
// Horizontal padding between progress indicator and filename/status text.
1423-
@@ -602,6 +603,9 @@ gfx::Size DownloadItemView::CalculatePreferredSize(
1424-
}
1425-
}
1426-
1427-
+ if (features::IsThorium2024()) {
1428-
+ height -= 16;
1429-
+ }
1430-
// The normal height of the item which may be exceeded if text is large.
1431-
constexpr int kDefaultDownloadItemHeight = 48;
1432-
return gfx::Size(width, std::max(kDefaultDownloadItemHeight,
1433-
@@ -610,13 +614,6 @@ gfx::Size DownloadItemView::CalculatePreferredSize(
1434-
1435-
void DownloadItemView::OnPaintBackground(gfx::Canvas* canvas) {
1436-
View::OnPaintBackground(canvas);
1437-
-
1438-
- // Draw the separator as part of the background. It will be covered by the
1439-
- // focus ring when the view has focus.
1440-
- gfx::Rect rect(width() - 1, 0, 1, height());
1441-
- rect.Inset(gfx::Insets::VH(kTopBottomPadding, 0));
1442-
- canvas->FillRect(GetMirroredRect(rect),
1443-
- GetColorProvider()->GetColor(kColorToolbarSeparator));
1444-
}
1445-
1446-
void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
1447-
@@ -694,6 +691,14 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
1448-
canvas->DrawImageInt(icon, bounds.x(), bounds.y());
1449-
}
1450-
1451-
+ // Draw the separator as part of the background. It will be covered by the
1452-
+ // focus ring when the view has focus.
1453-
+ // Alex313031: TODO: Use NTB method to pop out to overlay and move right 1px
1454-
+ gfx::Rect rect(width() - 1, 0, 1, height());
1455-
+ rect.Inset(gfx::Insets::VH(kTopBottomPadding, 0));
1456-
+ canvas->FillRect(GetMirroredRect(rect),
1457-
+ GetColorProvider()->GetColor(kColorToolbarSeparator));
1458-
+
1459-
OnPaintBorder(canvas);
1460-
}
1461-
14621402
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc
14631403
index 1807e4c267..72dff16f3b 100644
14641404
--- a/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc

setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ patchThor () {
9494
cp -v other/change-libavcodec-header.patch ${CR_SRC_DIR}/third_party/ffmpeg/ &&
9595
cp -v other/fix-policy-templates.patch ${CR_SRC_DIR}/ &&
9696
cp -v other/ftp-support-thorium.patch ${CR_SRC_DIR}/ &&
97+
cp -v other/restore_download_shelf.patch ${CR_SRC_DIR}/ &&
9798
cp -v other/thorium-2024-ui.patch ${CR_SRC_DIR}/ &&
9899
cp -v other/GPC.patch ${CR_SRC_DIR}/ &&
99100
cp -v other/GPC-2.patch ${CR_SRC_DIR}/ &&
@@ -133,6 +134,8 @@ patchThor () {
133134
printf "${YEL}Patching for Thorium 2024 UI...${c0}\n" &&
134135
cd ${CR_SRC_DIR} &&
135136
git apply --reject ./thorium-2024-ui.patch &&
137+
printf "${YEL}Download Shelf patch...${c0}\n" &&
138+
git apply --reject ./restore_download_shelf.patch &&
136139

137140
printf "\n" &&
138141
printf "${YEL}Patching mini_installer...${c0}\n" &&

0 commit comments

Comments
 (0)