aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-07-27 16:53:46 +0200
committerache <ache@ache.one>2020-07-27 16:53:46 +0200
commitf9f2f307c60f47f4c48c377d831e48bd683b309e (patch)
treec6112b85286a1a270a1588473df547f1008d3594
parentCenter message preview (diff)
Fix confirm send resize
-rw-r--r--wind.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/wind.c b/wind.c
index 5015a61..e6fb2ed 100644
--- a/wind.c
+++ b/wind.c
@@ -86,13 +86,14 @@ void runtimeHelp(void) {
clear();
}
-int confirmSend(const char* txt, const char* autheur) {
+void showConfirmSend(const char* txt, const char* autheur) {
int x = COLS/6;
int w = (COLS*2)/3;
int nbLignes = showMessagePreview(x, 0, w, txt, 0);
int y = (LINES - nbLignes - 2) / 2;
clear();
+ refresh();
move(y,x);
printw("Voulez-vous vraiment envoyé ce SMS de %d ligne%s à %s ?", nbLignes, nbLignes > 1 ? "s":"", autheur);
y++;
@@ -121,13 +122,20 @@ int confirmSend(const char* txt, const char* autheur) {
printw("%s", line);
}
}
+}
+int confirmSend(const char* txt, const char* autheur) {
+ showConfirmSend(txt, autheur);
int c = 0;
- while( (c = getch()) && c != EOF && !strchr("oyneqOYNEQ", c) ) ;
+ while( (c = getch()) && c != EOF && !strchr("oyneqOYNEQ", c) ) {
+ if (c == KEY_RESIZE) {
+ showConfirmSend(txt, autheur);
+ refresh();
+ continue;
+ }
+ }
clear();
return (c == 'e' || c =='E') ? 2 : (!!strchr("yYoO", c)) ;
}
-
-