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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.cc

Issue 1781593005: Fix regression in dragging location bar right edge (Mac). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md_extensions_buttons
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
index 947757549281e7f3239dfa71eafb2d040bbd3f93..4f46aeccdd37094d1f57c55b2a75bea91648fc45 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
@@ -104,6 +104,8 @@ bool ToolbarActionsBar::disable_animations_for_testing_ = false;
ToolbarActionsBar::PlatformSettings::PlatformSettings()
: item_spacing(GetLayoutConstant(TOOLBAR_STANDARD_SPACING)),
+ left_padding(GetLayoutConstant(TOOLBAR_ACTIONS_LEFT_PADDING)),
+ right_padding(GetLayoutConstant(TOOLBAR_ACTIONS_RIGHT_PADDING)),
icons_per_overflow_menu_row(1),
chevron_enabled(!extensions::FeatureSwitch::extension_action_redesign()->
IsEnabled()) {
@@ -185,7 +187,8 @@ gfx::Size ToolbarActionsBar::GetPreferredSize() const {
int ToolbarActionsBar::GetMinimumWidth() const {
if (!platform_settings_.chevron_enabled || toolbar_actions_.empty())
return platform_settings_.item_spacing;
- return 2 * platform_settings_.item_spacing + delegate_->GetChevronWidth();
+ return platform_settings_.left_padding + delegate_->GetChevronWidth() +
+ platform_settings_.right_padding;
}
int ToolbarActionsBar::GetMaximumWidth() const {
@@ -204,9 +207,9 @@ int ToolbarActionsBar::IconCountToWidth(int icons) const {
const int icons_size = (icons == 0) ? 0 :
(icons * IconWidth(true)) - platform_settings_.item_spacing;
const int chevron_size = display_chevron ? delegate_->GetChevronWidth() : 0;
- const int side_padding = platform_settings_.item_spacing * 2;
- return icons_size + chevron_size + side_padding;
+ return platform_settings_.left_padding + icons_size + chevron_size +
+ platform_settings_.right_padding;
}
size_t ToolbarActionsBar::WidthToIconCount(int pixels) const {
@@ -216,7 +219,8 @@ size_t ToolbarActionsBar::WidthToIconCount(int pixels) const {
// We reserve space for the padding on either side of the toolbar and,
// if enabled, for the chevron.
- int available_space = pixels - (platform_settings_.item_spacing * 2);
+ int available_space = pixels -
+ (platform_settings_.left_padding + platform_settings_.right_padding);
if (platform_settings_.chevron_enabled)
available_space -= delegate_->GetChevronWidth();
@@ -306,7 +310,7 @@ gfx::Rect ToolbarActionsBar::GetFrameForIndex(
size_t index_in_row = in_overflow_mode() ?
relative_index % icons_per_overflow_row : relative_index;
- return gfx::Rect(platform_settings().item_spacing +
+ return gfx::Rect(platform_settings().left_padding +
index_in_row * IconWidth(true),
row_index * IconHeight(),
IconWidth(false),
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698