diff options
author | Holger Cremer <HolgerCremer@gmail.com> | 2015-06-13 01:16:26 +0200 |
---|---|---|
committer | Holger Cremer <HolgerCremer@gmail.com> | 2015-06-13 01:16:26 +0200 |
commit | bf64a764cc5f4036baa6772733b373f44508f6af (patch) | |
tree | 44d634b71f08834f806e3c5989501fa85a364bef /src/curses-ui/curses-ui.vala | |
parent | df4d78a79f480c93880f11ec72516d3ac76290c1 (diff) | |
download | serial-barcode-scanner-bf64a764cc5f4036baa6772733b373f44508f6af.tar.bz2 |
replace the popup with an overlay over the messagebox - this is much better on very small screens
Diffstat (limited to 'src/curses-ui/curses-ui.vala')
-rw-r--r-- | src/curses-ui/curses-ui.vala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/curses-ui/curses-ui.vala b/src/curses-ui/curses-ui.vala index b3efdd5..28fad08 100644 --- a/src/curses-ui/curses-ui.vala +++ b/src/curses-ui/curses-ui.vala @@ -19,6 +19,7 @@ public class CursesUI { Logo banner; ClockWindow clkwin; StatusPanel statuswin; + MessageBoxOverlay mbOverlay; public CursesUI() { /* unicode support */ @@ -36,7 +37,7 @@ public class CursesUI { Curses.init_pair(1, Curses.Color.GREEN, Curses.Color.BLACK); Curses.init_pair(2, Curses.Color.WHITE, Curses.Color.RED); - /* initialize widgets */ + /* initialize widgets */ banner = new Logo(); statuswin = new StatusPanel(); messages = new MessageBox(); @@ -80,6 +81,11 @@ public class CursesUI { } + public void log_overlay(string title, string message, int closeAfter) { + mbOverlay = new MessageBoxOverlay(title, message, closeAfter); + Timeout.add_seconds(closeAfter, closeMbOverlay); + } + public void dialog_open(string title, string message, int closeAfter=0) { dialog = new Dialog(message, title, closeAfter); if (closeAfter > 0) { @@ -87,6 +93,14 @@ public class CursesUI { } } + bool closeMbOverlay() { + mbOverlay = null; + messages.redraw(); + statuswin.redraw(); + // just call me once + return false; + } + bool close() { dialog_close(); // just call me once |