下段提示区:包进 ScrollPane + 固定 90px 高度,保证任意停靠高度下三段都各占一块
This commit is contained in:
1 parent
1cfd5e13cd
commit
9e318f3361
1 file changed
+16
-2
@@ -70,9 +70,16 @@ public final class ObjectPanel {
|
||||
Object scroll = scrollClass.getConstructor(actorClass, skinClass).newInstance(state.listTable, skin);
|
||||
state.listScroll = scroll;
|
||||
state.status = label(loader, skin, "Ready. Press Refresh to list scene objects.");
|
||||
Object logScroll = null;
|
||||
state.nameField = fieldClass.getConstructor(String.class, skinClass)
|
||||
.newInstance("particle_bone", skin);
|
||||
|
||||
try {
|
||||
logScroll = scrollClass.getConstructor(actorClass, skinClass).newInstance(state.status, skin);
|
||||
} catch (Throwable error) {
|
||||
System.err.println("[panel] 提示区滚动容器建不出来: " + error);
|
||||
}
|
||||
|
||||
// 让面板铺满停靠框(WidgetGroup.setFillParent)。
|
||||
call(root, Obf.TABLE_SET_FILL_PARENT, new Class<?>[] {boolean.class}, void.class, Boolean.TRUE);
|
||||
// 内容整体靠上:不设的话控件会在停靠框里垂直居中/被挤到下面
|
||||
@@ -104,8 +111,15 @@ public final class ObjectPanel {
|
||||
layoutCell(cell, Obf.CELL_TOP, Obf.CELL_EXPAND, Obf.CELL_FILL);
|
||||
// 下段:实时提示(多行、只靠左,不加 fill,保持自然高度贴在底部)
|
||||
call(root, Obf.TABLE_ROW, new Class<?>[0], cellClass);
|
||||
cell = call(root, Obf.TABLE_ADD, new Class<?>[] {actorClass}, cellClass, state.status);
|
||||
layoutCell(cell, Obf.CELL_LEFT, Obf.CELL_BOTTOM);
|
||||
cell = call(root, Obf.TABLE_ADD, new Class<?>[] {actorClass}, cellClass,
|
||||
logScroll == null ? state.status : logScroll);
|
||||
layoutCell(cell, Obf.CELL_LEFT, Obf.CELL_FILL_X);
|
||||
try {
|
||||
// 固定高度 90px:下段永远占一块,消息多了在它自己里滚
|
||||
call(cell, "L", new Class<?>[] {float.class}, cellClass, Float.valueOf(90f));
|
||||
} catch (Throwable error) {
|
||||
System.err.println("[panel] 提示区高度设置失败: " + error);
|
||||
}
|
||||
|
||||
wire(loader, refresh, new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user