- Structure for fully undecorated windows (miss drag and resize)
- Cleanup useless assets
|
Before Width: | Height: | Size: 985 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 327 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1006 B |
|
Before Width: | Height: | Size: 1006 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1004 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -147,20 +147,6 @@
|
||||
selection: padded-list-selection,
|
||||
background: select-box-list-bg
|
||||
}
|
||||
},
|
||||
white: {
|
||||
font: default-font,
|
||||
fontColor: black,
|
||||
background: default-select-white,
|
||||
backgroundOver: default-select-over,
|
||||
scrollStyle: default,
|
||||
listStyle: {
|
||||
font: default-font,
|
||||
fontColorSelected: black,
|
||||
fontColorUnselected: black,
|
||||
selection: list-selection-white,
|
||||
background: select-box-list-bg-white
|
||||
}
|
||||
}
|
||||
},
|
||||
com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: {
|
||||
@@ -241,22 +227,6 @@
|
||||
cursor: cursor
|
||||
}
|
||||
},
|
||||
com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: {
|
||||
default: {
|
||||
checkboxOn: check-on,
|
||||
checkboxOff: check-off,
|
||||
font: default-font,
|
||||
fontColor: white,
|
||||
disabledFontColor: grey
|
||||
},
|
||||
radio: {
|
||||
checkboxOn: radio-on,
|
||||
checkboxOff: radio-off,
|
||||
font: default-font,
|
||||
fontColor: white,
|
||||
disabledFontColor: grey
|
||||
}
|
||||
},
|
||||
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
|
||||
default: {
|
||||
fontColorUnselected: white,
|
||||
@@ -602,6 +572,26 @@
|
||||
imageOver: icon-link-inactive,
|
||||
imageChecked: icon-link-active,
|
||||
imageCheckedOver: icon-unlink-active
|
||||
},
|
||||
window-action-close: {
|
||||
imageDown: window-action-close-pressed,
|
||||
imageOver: window-action-close-hover,
|
||||
imageUp: window-action-close-normal
|
||||
},
|
||||
window-action-iconify: {
|
||||
imageDown: window-action-iconify-pressed,
|
||||
imageOver: window-action-iconify-hover,
|
||||
imageUp: window-action-iconify-normal
|
||||
},
|
||||
window-action-maximize: {
|
||||
imageDown: window-action-maximize-pressed,
|
||||
imageOver: window-action-maximize-hover,
|
||||
imageUp: window-action-maximize-normal
|
||||
},
|
||||
window-action-restore: {
|
||||
imageDown: window-action-restore-pressed,
|
||||
imageOver: window-action-restore-hover,
|
||||
imageUp: window-action-restore-normal
|
||||
}
|
||||
},
|
||||
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
|
||||
|
||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 48 KiB |
@@ -34,6 +34,8 @@ public class MsgAPI {
|
||||
public static final String DISPOSE = GLOBAL_PREFIX + ".DISPOSE";
|
||||
public static final String CREATE = GLOBAL_PREFIX + ".CREATE_BTN_CLICKED";
|
||||
|
||||
public static final String WINDOW_MAXIMIZED = GLOBAL_PREFIX + ".WINDOW_MAXIMIZED";
|
||||
|
||||
public static final String SAVE_EDITOR_CONFIG = GLOBAL_PREFIX + ".SAVE_EDITOR_CONFIG";
|
||||
|
||||
public static final String OPEN_CODE_EDITOR = GLOBAL_PREFIX + ".OPEN_CODE_EDITOR";
|
||||
|
||||
@@ -147,11 +147,7 @@ public class HyperLap2D implements IProxy, ApplicationListener, Lwjgl3WindowList
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
facade.sendNotification(MsgAPI.CHECK_EDITS_ACTION, (Runnable) () -> {
|
||||
sendNotification(MsgAPI.DISPOSE);
|
||||
VisUI.dispose();
|
||||
Gdx.app.exit();
|
||||
});
|
||||
closeRequested();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -212,7 +208,7 @@ public class HyperLap2D implements IProxy, ApplicationListener, Lwjgl3WindowList
|
||||
|
||||
@Override
|
||||
public void maximized(boolean isMaximized) {
|
||||
|
||||
facade.sendNotification(MsgAPI.WINDOW_MAXIMIZED, isMaximized);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -227,7 +223,11 @@ public class HyperLap2D implements IProxy, ApplicationListener, Lwjgl3WindowList
|
||||
|
||||
@Override
|
||||
public boolean closeRequested() {
|
||||
sendNotification(MsgAPI.CHECK_EDITS_ACTION, (Runnable) () -> Gdx.app.exit());
|
||||
facade.sendNotification(MsgAPI.CHECK_EDITS_ACTION, (Runnable) () -> {
|
||||
sendNotification(MsgAPI.DISPOSE);
|
||||
VisUI.dispose();
|
||||
Gdx.app.exit();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,11 @@ package games.rednblack.editor.controller;
|
||||
|
||||
import games.rednblack.editor.HyperLap2DFacade;
|
||||
import games.rednblack.editor.splash.SplashScreenAdapter;
|
||||
import games.rednblack.editor.view.ui.FollowersUIMediator;
|
||||
import games.rednblack.editor.view.ui.*;
|
||||
import games.rednblack.editor.view.menu.HyperLap2DMenuBarMediator;
|
||||
import games.rednblack.editor.view.HyperLap2DScreenMediator;
|
||||
import games.rednblack.editor.view.stage.SandboxMediator;
|
||||
import games.rednblack.editor.view.stage.UIStageMediator;
|
||||
import games.rednblack.editor.view.ui.RulersUIMediator;
|
||||
import games.rednblack.editor.view.ui.UIDropDownMenuMediator;
|
||||
import games.rednblack.editor.view.ui.box.*;
|
||||
import games.rednblack.editor.view.ui.dialog.*;
|
||||
import games.rednblack.editor.view.ui.panel.CustomVariablesPanelMediator;
|
||||
@@ -48,6 +46,7 @@ public class BootstrapViewCommand extends SimpleCommand {
|
||||
|
||||
facade.registerMediator(new HyperLap2DScreenMediator());
|
||||
facade.registerMediator(new HyperLap2DMenuBarMediator());
|
||||
facade.registerMediator(new UIWindowActionMediator());
|
||||
|
||||
facade.registerMediator(new UICompositeHierarchyMediator());
|
||||
facade.registerMediator(new UISceneBoxMediator());
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.puremvc.java.patterns.mediator.Mediator;
|
||||
public class HyperLap2DMenuBarMediator extends Mediator<HyperLap2DMenuBar> {
|
||||
private static final String TAG = HyperLap2DMenuBarMediator.class.getCanonicalName();
|
||||
public static final String NAME = TAG;
|
||||
|
||||
private ProjectManager projectManager;
|
||||
private SettingsManager settingsManager;
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
|
||||
package games.rednblack.editor.view.ui;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.kotcrab.vis.ui.VisUI;
|
||||
import com.kotcrab.vis.ui.widget.VisImageButton;
|
||||
import com.kotcrab.vis.ui.widget.VisTable;
|
||||
import games.rednblack.editor.HyperLap2DFacade;
|
||||
import games.rednblack.editor.view.menu.HyperLap2DMenuBar;
|
||||
@@ -35,6 +38,7 @@ import games.rednblack.editor.view.ui.box.UIResourcesBoxMediator;
|
||||
import games.rednblack.editor.view.ui.box.UIToolBox;
|
||||
import games.rednblack.editor.view.ui.box.UIToolBoxMediator;
|
||||
import games.rednblack.editor.view.ui.widget.H2DLogo;
|
||||
import games.rednblack.h2d.common.view.ui.StandardWidgetsFactory;
|
||||
|
||||
public class UIMainTable extends VisTable {
|
||||
private final VisTable topTable, middleTable;
|
||||
@@ -60,15 +64,26 @@ public class UIMainTable extends VisTable {
|
||||
}
|
||||
|
||||
private void initMenuBar() {
|
||||
HyperLap2DMenuBarMediator hyperlap2DMenuBarMediator = facade.retrieveMediator(HyperLap2DMenuBarMediator.NAME);
|
||||
HyperLap2DMenuBar menuBar = hyperlap2DMenuBarMediator.getViewComponent();
|
||||
topTable.add(new H2DLogo()).left().fillY();
|
||||
topTable.add(menuBar.getTable().padLeft(0)).fillX().height(32).expandX();
|
||||
|
||||
HyperLap2DMenuBarMediator hyperlap2DMenuBarMediator = facade.retrieveMediator(HyperLap2DMenuBarMediator.NAME);
|
||||
HyperLap2DMenuBar menuBar = hyperlap2DMenuBarMediator.getViewComponent();
|
||||
topTable.add(menuBar.getTable()).height(32).growX();
|
||||
|
||||
//TODO Undecorated window is cool but should enable window dragging
|
||||
/*VisTable titleTable = new VisTable();
|
||||
titleTable.setBackground(VisUI.getSkin().getDrawable("menu-bg"));
|
||||
titleTable.add("Title");
|
||||
topTable.add(titleTable).growX().fillY();
|
||||
|
||||
UIWindowActionMediator uiWindowActionMediator = facade.retrieveMediator(UIWindowActionMediator.NAME);
|
||||
UIWindowAction uiWindowAction = uiWindowActionMediator.getViewComponent();
|
||||
topTable.add(uiWindowAction).padTop(-1).fillY();*/
|
||||
}
|
||||
|
||||
private void initSupportMenus() {
|
||||
UISubmenuBar compositePanel = new UISubmenuBar();
|
||||
topTable.add(compositePanel).fillX().expandX().colspan(2).height(32);
|
||||
topTable.add(compositePanel).fillX().colspan(2).expandX().height(32);
|
||||
}
|
||||
|
||||
private void initLeftBoxesPanel() {
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package games.rednblack.editor.view.ui;
|
||||
|
||||
import com.badlogic.gdx.scenes.scene2d.InputEvent;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.kotcrab.vis.ui.VisUI;
|
||||
import com.kotcrab.vis.ui.widget.VisImageButton;
|
||||
import com.kotcrab.vis.ui.widget.VisTable;
|
||||
import games.rednblack.editor.HyperLap2DApp;
|
||||
import games.rednblack.h2d.common.view.ui.StandardWidgetsFactory;
|
||||
|
||||
public class UIWindowAction extends VisTable {
|
||||
|
||||
private VisImageButton maximizeButton;
|
||||
private boolean isMaximized;
|
||||
|
||||
public UIWindowAction() {
|
||||
setBackground(VisUI.getSkin().getDrawable("menu-bg"));
|
||||
align(Align.top);
|
||||
VisImageButton iconifyButton = StandardWidgetsFactory.createImageButton("window-action-iconify");
|
||||
add(iconifyButton).padRight(-1);
|
||||
iconifyButton.addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
HyperLap2DApp.getInstance().mainWindow.iconifyWindow();
|
||||
}
|
||||
});
|
||||
|
||||
maximizeButton = StandardWidgetsFactory.createImageButton("window-action-maximize");
|
||||
add(maximizeButton).padRight(-1);
|
||||
maximizeButton.addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
if (isMaximized) {
|
||||
HyperLap2DApp.getInstance().mainWindow.restoreWindow();
|
||||
} else {
|
||||
HyperLap2DApp.getInstance().mainWindow.maximizeWindow();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
setMaximized(true);
|
||||
|
||||
VisImageButton closeButton = StandardWidgetsFactory.createImageButton("window-action-close");
|
||||
add(closeButton);
|
||||
closeButton.addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
HyperLap2DApp.getInstance().hyperlap2D.closeRequested();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setMaximized(boolean maximized) {
|
||||
isMaximized = maximized;
|
||||
if (maximized) {
|
||||
maximizeButton.setStyle(VisUI.getSkin().get("window-action-restore", VisImageButton.VisImageButtonStyle.class));
|
||||
} else {
|
||||
maximizeButton.setStyle(VisUI.getSkin().get("window-action-maximize", VisImageButton.VisImageButtonStyle.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package games.rednblack.editor.view.ui;
|
||||
|
||||
import games.rednblack.editor.HyperLap2DFacade;
|
||||
import games.rednblack.h2d.common.MsgAPI;
|
||||
import org.puremvc.java.interfaces.INotification;
|
||||
import org.puremvc.java.patterns.mediator.Mediator;
|
||||
|
||||
public class UIWindowActionMediator extends Mediator<UIWindowAction> {
|
||||
private static final String TAG = UIWindowActionMediator.class.getCanonicalName();
|
||||
public static final String NAME = TAG;
|
||||
|
||||
|
||||
public UIWindowActionMediator() {
|
||||
super(NAME, new UIWindowAction());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegister() {
|
||||
super.onRegister();
|
||||
facade = HyperLap2DFacade.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] listNotificationInterests() {
|
||||
return new String[]{
|
||||
MsgAPI.WINDOW_MAXIMIZED
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleNotification(INotification notification) {
|
||||
super.handleNotification(notification);
|
||||
|
||||
switch (notification.getName()) {
|
||||
case MsgAPI.WINDOW_MAXIMIZED:
|
||||
viewComponent.setMaximized(notification.getBody());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class CustomMenuBar {
|
||||
|
||||
private CustomMenu currentMenu;
|
||||
|
||||
private Array<CustomMenu> menus = new Array<CustomMenu>();
|
||||
private Array<CustomMenu> menus = new Array<>();
|
||||
|
||||
public CustomMenuBar () {
|
||||
Skin skin = VisUI.getSkin();
|
||||
|
||||