Skip to content

Commit c2c39dc

Browse files
(v2) Scene editor: some fixes.
1 parent 80ac0d6 commit c2c39dc

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

source/v2/phasereditor/phasereditor.scene.ui/src/phasereditor/scene/ui/editor/properties/AnimationsSection.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,13 @@ public void update_UI_from_Model() {
167167
}
168168

169169
_animCanvas.setVisible(found != null);
170+
{
171+
var gd = (GridData) _animCanvas.getLayoutData();
172+
gd.heightHint = found == null? 0 : 200;
173+
}
170174
_animCanvas.setModel(found);
171175

172-
_animCanvas.getParent().layout();
176+
_animCanvas.getParent().getParent().layout();
173177
}
174178

175179
}

source/v2/phasereditor/phasereditor.scene.ui/src/phasereditor/scene/ui/editor/properties/BitmapTextSection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public void run() {
158158

159159
var packs = AssetPackCore.getAssetPackModels(project);
160160

161+
dlg.setTitle("Select BitmapFont");
161162
dlg.setInput(packs.stream().flatMap(pack -> pack.getAssets().stream())
162163
.filter(asset -> asset instanceof BitmapFontAssetModel).toArray());
163164

source/v2/phasereditor/phasereditor.ui/src/phasereditor/ui/properties/FormPropertyPage.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@
2121
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2222
package phasereditor.ui.properties;
2323

24-
import static java.util.stream.Collectors.toList;
2524
import static phasereditor.ui.IEditorSharedImages.IMG_BULLET_COLLAPSE;
2625
import static phasereditor.ui.IEditorSharedImages.IMG_BULLET_EXPAND;
2726

2827
import java.util.ArrayList;
29-
import java.util.Arrays;
3028
import java.util.HashMap;
3129
import java.util.HashSet;
3230
import java.util.List;
@@ -118,17 +116,7 @@ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
118116
}
119117
}
120118

121-
// dispose all rows with irrelevant sections
122-
123-
// for (var control : _sectionsContainer.getChildren()) {
124-
// var row = (RowComp) control;
125-
//
126-
// var newSection = sectionMap.get(row.getSection().getClass());
127-
//
128-
// if (newSection == null) {
129-
// row.dispose();
130-
// }
131-
// }
119+
// hide all rows with irrelevant sections
132120

133121
for (var control : _sectionsContainer.getChildren()) {
134122
var row = (RowComp) control;
@@ -170,17 +158,7 @@ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
170158

171159
}
172160

173-
// sort the rows, following the new sections order
174-
175-
var clsList = uniqueSections.stream().map(section -> section.getClass()).collect(toList());
176-
177-
var rowList = _sectionsContainer.getChildren();
178-
179-
Arrays.sort(rowList, (a, b) -> {
180-
return Integer.compare(clsList.indexOf(a.getClass()), clsList.indexOf(b.getClass()));
181-
});
182-
183-
_sectionsContainer.layout(rowList);
161+
_sectionsContainer.layout();
184162

185163
updateScrolledComposite();
186164
}

0 commit comments

Comments
 (0)