Cute XTermVideoPlayer

This commit is contained in:
Autumn Lamonte 2022-01-25 20:04:08 -06:00
parent b5c955c947
commit b1d568e253

View file

@ -37,6 +37,15 @@ public class XtermVideoPlayer extends TApplication {
addFileMenu(); addFileMenu();
addWindowMenu(); addWindowMenu();
// Make it cute.
getTheme().setFemme();
System.setProperty("jexer.TWindow.borderStyleForeground", "round");
System.setProperty("jexer.TWindow.borderStyleModal", "round");
System.setProperty("jexer.TWindow.borderStyleMoving", "round");
System.setProperty("jexer.TWindow.borderStyleInactive", "round");
setDesktop(null);
setHideStatusBar(true);
// Create a window for the image. The resize event is overridden so // Create a window for the image. The resize event is overridden so
// that the internal image field changes in size with the window. // that the internal image field changes in size with the window.
TWindow window = new TWindow(this, filename, 0, 0, TWindow window = new TWindow(this, filename, 0, 0,
@ -53,6 +62,7 @@ public class XtermVideoPlayer extends TApplication {
} }
} }
}; };
window.setAlpha(255);
// Add the image field. We will load frames into this. // Add the image field. We will load frames into this.
image = window.addImage(0, 0, window.getWidth() - 2, image = window.addImage(0, 0, window.getWidth() - 2,
@ -149,6 +159,14 @@ public class XtermVideoPlayer extends TApplication {
} }
} }
/**
* Show FPS.
*/
@Override
protected void onPreDraw() {
menuTrayText = String.format("FPS %d", getFramesPerSecond());
}
// Main entry point. // Main entry point.
public static void main(String [] args) throws Exception { public static void main(String [] args) throws Exception {
if (args.length == 0) { if (args.length == 0) {