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

Side by Side Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 12490014: The download arrow is not vertically centered and needs to be shifted down by 2 pt. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/download/download_shelf_view.h" 5 #include "chrome/browser/ui/views/download/download_shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 gfx::Size show_all_size = show_all_view_->GetPreferredSize(); 245 gfx::Size show_all_size = show_all_view_->GetPreferredSize();
246 int max_download_x = 246 int max_download_x =
247 std::max<int>(0, width() - kRightPadding - close_button_size.width() - 247 std::max<int>(0, width() - kRightPadding - close_button_size.width() -
248 kCloseAndLinkPadding - show_all_size.width() - 248 kCloseAndLinkPadding - show_all_size.width() -
249 kDownloadsTitlePadding - image_size.width() - 249 kDownloadsTitlePadding - image_size.width() -
250 kDownloadPadding); 250 kDownloadPadding);
251 int next_x = show_link_only ? kLeftPadding : 251 int next_x = show_link_only ? kLeftPadding :
252 max_download_x + kDownloadPadding; 252 max_download_x + kDownloadPadding;
253 // Align vertically with show_all_view_. 253 // Align vertically with show_all_view_.
254 arrow_image_->SetBounds(next_x, 254 arrow_image_->SetBounds(next_x,
255 CenterPosition(show_all_size.height(), height()), 255 CenterPosition(image_size.height(), height()),
256 image_size.width(), image_size.height()); 256 image_size.width(), image_size.height());
257 next_x += image_size.width() + kDownloadsTitlePadding; 257 next_x += image_size.width() + kDownloadsTitlePadding;
258 show_all_view_->SetBounds(next_x, 258 show_all_view_->SetBounds(next_x,
259 CenterPosition(show_all_size.height(), height()), 259 CenterPosition(show_all_size.height(), height()),
260 show_all_size.width(), 260 show_all_size.width(),
261 show_all_size.height()); 261 show_all_size.height());
262 next_x += show_all_size.width() + kCloseAndLinkPadding; 262 next_x += show_all_size.width() + kCloseAndLinkPadding;
263 // If the window is maximized, we want to expand the hitbox of the close 263 // If the window is maximized, we want to expand the hitbox of the close
264 // button to the right and bottom to make it easier to click. 264 // button to the right and bottom to make it easier to click.
265 bool is_maximized = browser_->window()->IsMaximized(); 265 bool is_maximized = browser_->window()->IsMaximized();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 const DownloadItemView* download_item_view) { 473 const DownloadItemView* download_item_view) {
474 gfx::Rect bounds = download_item_view->bounds(); 474 gfx::Rect bounds = download_item_view->bounds();
475 475
476 #if defined(TOOLKIT_VIEWS) 476 #if defined(TOOLKIT_VIEWS)
477 bounds.set_height(bounds.height() - 1); 477 bounds.set_height(bounds.height() - 1);
478 bounds.Offset(0, 3); 478 bounds.Offset(0, 3);
479 #endif 479 #endif
480 480
481 return bounds; 481 return bounds;
482 } 482 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698