Skip to content

Commit eae95d4

Browse files
authored
[CQ] prefer “magic” flow layout constants (#8194)
`VerticalFlowAlignment` identifies some "magic" constants: ![image](https://github.com/user-attachments/assets/d49fa227-d381-4cf3-867d-17db1c5fe1c5) that are prefered: ![image](https://github.com/user-attachments/assets/8c852821-d863-4d27-8723-b91fe260731b) (Note that both `CENTER` and `MIDDLE` are initialized to `1` so this is semantics preserving.) --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 111c3d8 commit eae95d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

flutter-idea/src/io/flutter/view/EmbeddedBrowser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ protected void showLabels(List<LabelInput> labels, ContentManager contentManager
200200
}
201201
}
202202

203-
final JPanel center = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.CENTER));
203+
final JPanel center = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE));
204204
center.add(panel);
205205
replacePanelLabel(center, contentManager);
206206
}

flutter-idea/src/io/flutter/view/ViewUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void presentLabels(@NotNull ToolWindow toolWindow, @NotNull List<String>
4747
}
4848

4949
// Use VerticalFlowLayout to center the block of labels vertically
50-
final JPanel centerPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.CENTER));
50+
final JPanel centerPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE));
5151
centerPanel.add(labelsPanel);
5252

5353
replacePanelLabel(toolWindow, centerPanel);
@@ -73,7 +73,7 @@ public void presentClickableLabel(ToolWindow toolWindow, List<LabelInput> labels
7373
}
7474
}
7575

76-
final JPanel center = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.CENTER));
76+
final JPanel center = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE));
7777
center.add(panel);
7878
replacePanelLabel(toolWindow, center);
7979
}

0 commit comments

Comments
 (0)