Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 "ui/views/layout/grid_layout.h" | |
| 9 | |
| 10 namespace views { | |
| 11 | |
| 12 class VIEWS_EXPORT LayoutDelegate { | |
|
sky
2016/11/08 23:34:00
Layout spacing and alignment are best left to clie
| |
| 13 public: | |
| 14 enum LayoutDistanceType { | |
| 15 PANEL_VERT_MARGIN, | |
| 16 RELATED_CONTROL_HORIZONTAL_SPACING, | |
| 17 RELATED_CONTROL_VERTICAL_SPACING, | |
| 18 RELATED_BUTTON_HORIZONTAL_SPACING, | |
| 19 UNRELATED_CONTROL_VERTICAL_SPACING, | |
| 20 UNRELATED_CONTROL_LARGE_VERTICAL_SPACING, | |
| 21 BUTTON_HEDGE_MARGIN_NEW, | |
| 22 BUTTON_VEDGE_MARGIN_NEW, | |
| 23 }; | |
| 24 | |
| 25 // Returns a layout distance, indexed by |type|. These distances are in | |
| 26 // device-independent units. | |
| 27 virtual int GetLayoutDistance(LayoutDistanceType type) const; | |
| 28 | |
| 29 // Returns the alignment used for control labels in a GridLayout; for example, | |
| 30 // in this GridLayout: | |
| 31 // --------------------------- | |
| 32 // | Label 1 Checkbox 1 | | |
| 33 // | Label 2 Checkbox 2 | | |
| 34 // --------------------------- | |
| 35 // This value controls the alignment used for "Label 1" and "Label 2". | |
| 36 virtual GridLayout::Alignment GetControlLabelGridAlignment() const; | |
| 37 | |
| 38 // Returns whether to use extra padding on dialogs. If this is false, content | |
| 39 // Views for dialogs should not insert extra padding at their own edges. | |
| 40 virtual bool UseExtraDialogPadding() const; | |
| 41 }; | |
| 42 | |
| 43 } // namespace views | |
| 44 | |
| 45 #endif // UI_VIEWS_LAYOUT_LAYOUT_DELEGATE_H_ | |
| OLD | NEW |