Skip to content

Commit

Permalink
Merge pull request #27112 from brave/emerick-fix-clear-all-downloads-…
Browse files Browse the repository at this point in the history
…button

Fix downloads button positioning and interactivity
  • Loading branch information
emerick authored Jan 5, 2025
2 parents f9e7a9c + 990b0eb commit 2d7e2d1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions chromium_src/chrome/browser/resources/downloads/toolbar.ts
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 2d7e2d1

Please sign in to comment.