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

Side by Side Diff: ui/views/layout/layout_delegate.h

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Changes due to feedback. Created 3 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 unified diff | Download patch
« no previous file with comments | « ui/views/layout/grid_layout.cc ('k') | ui/views/layout/layout_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_LAYOUT_LAYOUT_DELEGATE_H_
6 #define UI_VIEWS_LAYOUT_LAYOUT_DELEGATE_H_
7
8 #include "base/macros.h"
9 #include "ui/gfx/geometry/insets.h"
10 #include "ui/views/style/typography_provider.h"
11 #include "ui/views/views_export.h"
12
13 namespace views {
14
15 enum InsetsMetric {
16 // The margins that should be applied around a bubble dialog.
17 BUBBLE_DIALOG,
18 // The insets that should be applied around a DialogClientView. Note that
19 // the top inset is used for the distance between the buttons and the
20 // DialogClientView's content view.
21 DIALOG_BUTTON,
22 // The insets that should be applied around a dialog's frame view.
23 DIALOG_FRAME_VIEW,
24 // The margins that should be applied around a panel GridLayout.
25 PANEL,
26 // Padding to add to vector image buttons to increase their click and touch
27 // target size.
28 VECTOR_IMAGE_BUTTON,
29 };
30
31 enum DistanceMetric {
32 // The default padding to add on each side of a button's label.
33 BUTTON_HORIZONTAL_PADDING,
34 // The distance between a dialog's edge and the close button in the upper
35 // trailing corner.
36 CLOSE_BUTTON_MARGIN,
37 // The default minimum width of a dialog button.
38 DIALOG_BUTTON_MINIMUM_WIDTH,
39 // The spacing between a pair of related horizontal buttons, used for
40 // dialog layout.
41 RELATED_BUTTON_HORIZONTAL,
42 // Horizontal spacing between controls that are logically related.
43 RELATED_CONTROL_HORIZONTAL,
44 // The spacing between a pair of related vertical controls, used for
45 // dialog layout.
46 RELATED_CONTROL_VERTICAL,
47 };
48
49 class VIEWS_EXPORT LayoutDelegate {
sky 2017/04/06 19:59:24 This class allows looking up layout and typography
kylix_rd 2017/04/07 14:07:59 I like that suggestion. From an observational pers
50 public:
51 LayoutDelegate();
52 virtual ~LayoutDelegate();
53
54 static LayoutDelegate* Get();
55
56 // Returns the insets metric according to the given enumeration element.
57 virtual gfx::Insets GetInsetsMetric(InsetsMetric metric) const;
58
59 // Returns the distance metric between elements according to the given
60 // enumeration element.
61 virtual int GetDistanceMetric(DistanceMetric metric) const;
62
63 // Returns the TypographyProvider, used to configure text properties such as
64 // font, weight, color, size, and line height. Never null.
65 virtual const TypographyProvider& GetTypographyProvider() const;
66
67 private:
68 DefaultTypographyProvider typography_provider_;
69
70 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate);
71 };
72
73 } // namespace views
74
75 #endif // UI_VIEWS_LAYOUT_LAYOUT_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/views/layout/grid_layout.cc ('k') | ui/views/layout/layout_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698