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

Unified Diff: sky/sdk/lib/framework/rendering/flex.dart

Issue 1158813004: Style guide says enum values should be lowerCamelCase. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/layout.dart ('k') | sky/tests/raw/render_flex.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/flex.dart
diff --git a/sky/sdk/lib/framework/rendering/flex.dart b/sky/sdk/lib/framework/rendering/flex.dart
index 4c8e11e89c270fbba229ad84e66938ca4b23bdd8..f719dada7c7ec613b13f35fb5c892d7478a546f1 100644
--- a/sky/sdk/lib/framework/rendering/flex.dart
+++ b/sky/sdk/lib/framework/rendering/flex.dart
@@ -15,14 +15,14 @@ class FlexBoxParentData extends BoxParentData with ContainerParentDataMixin<Rend
}
}
-enum FlexDirection { Horizontal, Vertical }
+enum FlexDirection { horizontal, vertical }
class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, FlexBoxParentData>,
RenderBoxContainerDefaultsMixin<RenderBox, FlexBoxParentData> {
// lays out RenderBox children using flexible layout
RenderFlex({
- FlexDirection direction: FlexDirection.Horizontal
+ FlexDirection direction: FlexDirection.horizontal
}) : _direction = direction;
FlexDirection _direction;
@@ -56,7 +56,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
// Steps 1-3. Determine used flex factor, size inflexible items, calculate free space
int totalFlex = 0;
assert(constraints != null);
- double freeSpace = (_direction == FlexDirection.Horizontal) ? constraints.maxWidth : constraints.maxHeight;
+ double freeSpace = (_direction == FlexDirection.horizontal) ? constraints.maxWidth : constraints.maxHeight;
RenderBox child = firstChild;
while (child != null) {
int flex = _getFlex(child);
@@ -66,7 +66,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
BoxConstraints innerConstraints = new BoxConstraints(maxHeight: constraints.maxHeight,
maxWidth: constraints.maxWidth);
child.layout(innerConstraints, parentUsesSize: true);
- freeSpace -= (_direction == FlexDirection.Horizontal) ? child.size.width : child.size.height;
+ freeSpace -= (_direction == FlexDirection.horizontal) ? child.size.width : child.size.height;
}
child = child.parentData.nextSibling;
}
@@ -81,12 +81,12 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
double spaceForChild = spacePerFlex * flex;
BoxConstraints innerConstraints;
switch (_direction) {
- case FlexDirection.Horizontal:
+ case FlexDirection.horizontal:
innerConstraints = new BoxConstraints(maxHeight: constraints.maxHeight,
minWidth: spaceForChild,
maxWidth: spaceForChild);
break;
- case FlexDirection.Vertical:
+ case FlexDirection.vertical:
innerConstraints = new BoxConstraints(minHeight: spaceForChild,
maxHeight: spaceForChild,
maxWidth: constraints.maxWidth);
@@ -97,11 +97,11 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
// For now, center the flex items in the cross direction
switch (_direction) {
- case FlexDirection.Horizontal:
+ case FlexDirection.horizontal:
child.parentData.position = new sky.Point(usedSpace, size.height / 2.0 - child.size.height / 2.0);
usedSpace += child.size.width;
break;
- case FlexDirection.Vertical:
+ case FlexDirection.vertical:
child.parentData.position = new sky.Point(size.width / 2.0 - child.size.width / 2.0, usedSpace);
usedSpace += child.size.height;
break;
« no previous file with comments | « sky/sdk/lib/framework/layout.dart ('k') | sky/tests/raw/render_flex.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698