From b1d568e2538797ff3840ed5b404a68ede62bd05b Mon Sep 17 00:00:00 2001 From: Autumn Lamonte Date: Tue, 25 Jan 2022 20:04:08 -0600 Subject: [PATCH] Cute XTermVideoPlayer --- examples/XtermVideoPlayer.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/examples/XtermVideoPlayer.java b/examples/XtermVideoPlayer.java index 2f8abc2..5e7d06c 100644 --- a/examples/XtermVideoPlayer.java +++ b/examples/XtermVideoPlayer.java @@ -37,6 +37,15 @@ public class XtermVideoPlayer extends TApplication { addFileMenu(); 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 // that the internal image field changes in size with the window. 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. 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. public static void main(String [] args) throws Exception { if (args.length == 0) {