From 990b0eb6a95a7943ce7108ca98fcf9dd68651d20 Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Fri, 3 Jan 2025 10:40:02 -0500 Subject: [PATCH] Fix downloads button positioning and interactivity --- .../browser/resources/downloads/toolbar.ts | 19 +++++++++++++++++ .../managed_footnote/managed_footnote.ts | 21 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 chromium_src/chrome/browser/resources/downloads/toolbar.ts create mode 100644 chromium_src/ui/webui/resources/cr_components/managed_footnote/managed_footnote.ts diff --git a/chromium_src/chrome/browser/resources/downloads/toolbar.ts b/chromium_src/chrome/browser/resources/downloads/toolbar.ts new file mode 100644 index 000000000000..a336c3b28b30 --- /dev/null +++ b/chromium_src/chrome/browser/resources/downloads/toolbar.ts @@ -0,0 +1,19 @@ +// Copyright (c) 2024 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/. + +import { injectStyle } from '//resources/brave/lit_overriding.js' +import { css } from '//resources/lit/v3_0/lit.rollup.js' +import { DownloadsToolbarElement } from './toolbar-chromium.js' + +// Our downloads page doesn't have a static area to display the "Clear All" +// button, so it ends up overlapping the scrollbar when the list of download +// items is long. Add some margin to the button to avoid that. +injectStyle(DownloadsToolbarElement, css` + #clearAll { + margin-right: 20px; + } +`) + +export * from './toolbar-chromium.js' diff --git a/chromium_src/ui/webui/resources/cr_components/managed_footnote/managed_footnote.ts b/chromium_src/ui/webui/resources/cr_components/managed_footnote/managed_footnote.ts new file mode 100644 index 000000000000..fc9d03c61039 --- /dev/null +++ b/chromium_src/ui/webui/resources/cr_components/managed_footnote/managed_footnote.ts @@ -0,0 +1,21 @@ +// Copyright (c) 2024 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/. + +import { injectStyle } from '//resources/brave/lit_overriding.js' +import { css } from '//resources/lit/v3_0/lit.rollup.js' +import { ManagedFootnoteElement } from './managed_footnote-chromium.js' + +// Don't show the managed footnote on the downloads page, as our downloads page +// doesn't have a static area to display the footnote and it thus interferes +// with the hit box for the "Clear All" button +if (window.location.href === 'chrome://downloads/') { + injectStyle(ManagedFootnoteElement, css` + :host([is-managed_]) { + display: none !important; + } + `) +} + +export * from './managed_footnote-chromium.js'