Vojtech Szocs has posted comments on this change.
Change subject: webadmin: Double click collapse system tree
......................................................................
Patch Set 2: Code-Review+2
(3 comments)
....................................................
File
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/MainSectionView.java
Line 132: public void execute() {
Line 133: //Manually call onResize() so the tabs at the top are
positioned correctly. For some reason
Line 134: //doing setWidgetSize doesn't trigger the onResize
event. Also this need to be deferred
Line 135: //otherwise the handlers haven't been added yet, and
the resize won't do anything.
Line 136: westStackPanel.onResize();
My understanding is: setting widget size doesn't trigger onResize, since
onResize gets triggered via Window resize event and bubbles down GWT layout
panel hierarchy, with parents calling onResize on their children.
+1 for the explanation in the comment.
Line 137: }
Line 138: });
Line 139: }
Line 140:
Line 150: @Override
Line 151: public void onResize() {
Line 152: super.onResize();
Line 153: Double westStackWidth =
horizontalSplitLayoutPanel.getWidgetSize(westStackPanel);
Line 154: if (uiHandlers != null && westStackWidth != null) {
Assuming westStackPanel is always adopted by horizontalSplitLayoutPanel,
westStackWidth should never become null.
However, I agree it's better to check for null and stay more defensive in this
case.
Line 155:
uiHandlers.setMainTabBarOffset(westStackWidth.intValue());
Line 156: }
Line 157: }
Line 158: };
....................................................
File
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/main/TabbedSplitLayoutPanel.java
Line 183: layoutCommand = null;
Line 184: forceLayout();
Line 185: }
Line 186: };
Line 187: Scheduler.get().scheduleDeferred(layoutCommand);
Hm, I'm wondering why we need to remember layoutCommand here - why not simply
do this:
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
forceLayout();
}
});
Line 188: }
Line 189: }
Line 190:
Line 191: /**
--
To view, visit http://gerrit.ovirt.org/22657
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ida98ac456d9dd325ba1bf5676671bf53b5c3173e
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Greg Sheremeta <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches