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

Side by Side Diff: ui/views/layout/layout_provider.cc

Issue 2932523003: Fix Harmony popover buttons being flush with their content. (Closed)
Patch Set: fix merge Created 3 years, 6 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 | « ui/views/layout/layout_provider.h ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ui/views/layout/layout_provider.h" 5 #include "ui/views/layout/layout_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "ui/base/material_design/material_design_controller.h" 9 #include "ui/base/material_design/material_design_controller.h"
10 #include "ui/views/layout/layout_constants.h" 10 #include "ui/views/layout/layout_constants.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 case DistanceMetric::DISTANCE_BUTTON_HORIZONTAL_PADDING: 79 case DistanceMetric::DISTANCE_BUTTON_HORIZONTAL_PADDING:
80 return kButtonHorizontalPadding; 80 return kButtonHorizontalPadding;
81 case DistanceMetric::DISTANCE_BUTTON_MAX_LINKABLE_WIDTH: 81 case DistanceMetric::DISTANCE_BUTTON_MAX_LINKABLE_WIDTH:
82 return 0; 82 return 0;
83 case DistanceMetric::DISTANCE_CLOSE_BUTTON_MARGIN: 83 case DistanceMetric::DISTANCE_CLOSE_BUTTON_MARGIN:
84 return kCloseButtonMargin; 84 return kCloseButtonMargin;
85 case DistanceMetric::DISTANCE_RELATED_BUTTON_HORIZONTAL: 85 case DistanceMetric::DISTANCE_RELATED_BUTTON_HORIZONTAL:
86 return kRelatedButtonHSpacing; 86 return kRelatedButtonHSpacing;
87 case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL: 87 case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL:
88 return kRelatedControlHorizontalSpacing; 88 return kRelatedControlHorizontalSpacing;
89 case DistanceMetric::DISTANCE_BUBBLE_BUTTON_TOP_MARGIN:
89 case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL: 90 case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL:
90 return kRelatedControlVerticalSpacing; 91 return kRelatedControlVerticalSpacing;
91 case DISTANCE_DIALOG_BUTTON_BOTTOM_MARGIN: 92 case DISTANCE_DIALOG_BUTTON_BOTTOM_MARGIN:
92 return views::kButtonVEdgeMarginNew; 93 return views::kButtonVEdgeMarginNew;
93 case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: 94 case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH:
94 return kDialogMinimumButtonWidth; 95 return kDialogMinimumButtonWidth;
95 case DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN: 96 case DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN:
96 return kButtonHEdgeMarginNew; 97 return kButtonHEdgeMarginNew;
97 case DISTANCE_UNRELATED_CONTROL_VERTICAL: 98 case DISTANCE_UNRELATED_CONTROL_VERTICAL:
98 return kUnrelatedControlVerticalSpacing; 99 return kUnrelatedControlVerticalSpacing;
(...skipping 10 matching lines...) Expand all
109 // This is an arbitrary value, but it's a good arbitrary value. Some dialogs 110 // This is an arbitrary value, but it's a good arbitrary value. Some dialogs
110 // have very small widths for their contents views, which causes ugly 111 // have very small widths for their contents views, which causes ugly
111 // title-wrapping where a two-word title is split across multiple lines or 112 // title-wrapping where a two-word title is split across multiple lines or
112 // similar. To prevent that, forbid any snappable dialog from being narrower 113 // similar. To prevent that, forbid any snappable dialog from being narrower
113 // than this value. In principle it's possible to factor in the title width 114 // than this value. In principle it's possible to factor in the title width
114 // here, but it is not really worth the complexity. 115 // here, but it is not really worth the complexity.
115 return std::max(min_width, 320); 116 return std::max(min_width, 320);
116 } 117 }
117 118
118 } // namespace views 119 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/layout/layout_provider.h ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698