CPP-17180 Create featured lazy icons in breadcrumbs

- inline `layoutMe()`

GitOrigin-RevId: 819fac3d6e0fcef6237ce95fb771a46b70430220
This commit is contained in:
Alexey Utkin
2019-08-22 01:50:10 +03:00
committed by intellij-monorepo-bot
parent edc3fa78f2
commit 8453c3d691
@@ -231,19 +231,6 @@ public class Breadcrumbs extends JBPanelWithEmptyText {
return null;
}
private void layoutMe() {
Rectangle bounds = new Rectangle(getWidth(), getHeight());
JBInsets.removeFrom(bounds, getInsets());
int scale = getScale();
for (CrumbView view : views) {
if (view.crumb != null) {
view.update();
view.setBounds(bounds.x, bounds.y, view.preferred.width, bounds.height, scale);
bounds.x += view.preferred.width;
}
}
}
private void updatePreferredSize(Dimension size, int scale) {
for (CrumbView view : views) {
if (view.crumb != null) {
@@ -292,7 +279,16 @@ public class Breadcrumbs extends JBPanelWithEmptyText {
public void layoutContainer(Container container) {
if (container instanceof Breadcrumbs) {
Breadcrumbs breadcrumbs = (Breadcrumbs)container;
breadcrumbs.layoutMe();
Rectangle bounds = new Rectangle(breadcrumbs.getWidth(), breadcrumbs.getHeight());
JBInsets.removeFrom(bounds, breadcrumbs.getInsets());
int scale = breadcrumbs.getScale();
for (CrumbView view : breadcrumbs.views) {
if (view.crumb != null) {
view.update();
view.setBounds(bounds.x, bounds.y, view.preferred.width, bounds.height, scale);
bounds.x += view.preferred.width;
}
}
}
}
};