Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 1860163003: Use MD-style focus indicator on DL shelf items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view_md.cc ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_shelf_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index 9fb5f3a1183ac4da60fb781b99bbb4e886ac2401..e474e4c0bc5057d37580f48a5108e06b72034183 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -105,7 +105,11 @@ int GetBetweenItemPadding() {
return ui::MaterialDesignController::IsModeMaterial() ? 0 : kDownloadPadding;
}
-int GetTopBottomPadding() {
+int GetTopPadding() {
+ return ui::MaterialDesignController::IsModeMaterial() ? 1 : kTopBottomPadding;
+}
+
+int GetBottomPadding() {
return ui::MaterialDesignController::IsModeMaterial() ? 0 : kTopBottomPadding;
}
@@ -119,7 +123,7 @@ void AdjustSize(views::View* view, gfx::Size* size) {
}
int CenterPosition(int size, int target_size) {
- return std::max((target_size - size) / 2, GetTopBottomPadding());
+ return std::max((target_size - size) / 2, GetTopPadding());
}
} // namespace
@@ -257,7 +261,7 @@ gfx::Size DownloadShelfView::GetPreferredSize() const {
AdjustSize(*download_views_.begin(), &prefsize);
prefsize.Enlarge(GetBetweenItemPadding(), 0);
}
- prefsize.Enlarge(0, 2 * GetTopBottomPadding());
+ prefsize.Enlarge(0, GetTopPadding() + GetBottomPadding());
if (shelf_animation_.is_animating()) {
prefsize.set_height(
static_cast<int>(static_cast<double>(prefsize.height()) *
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view_md.cc ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698