]> granicus.if.org Git - neomutt/commitdiff
autocrypt dialog
authorRichard Russon <rich@flatcap.org>
Tue, 15 Oct 2019 11:23:50 +0000 (12:23 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 27 Oct 2019 03:31:20 +0000 (03:31 +0000)
autocrypt/autocrypt_acct_menu.c

index 495248b76c40d46b0041ef733549ff329021208d..38617f49b5e26224a496ae3ff068462121d77fe1 100644 (file)
@@ -36,6 +36,7 @@
 #include "mutt.h"
 #include "autocrypt.h"
 #include "curs_lib.h"
+#include "dialog.h"
 #include "format_flags.h"
 #include "globals.h"
 #include "keymap.h"
@@ -271,10 +272,30 @@ void mutt_autocrypt_account_menu(void)
   if (mutt_autocrypt_init(false))
     return;
 
+  struct MuttWindow *root = mutt_window_new(MUTT_WIN_ORIENT_VERTICAL, MUTT_WIN_SIZE_MAXIMISE, MUTT_WIN_SIZE_UNLIMITED, MUTT_WIN_SIZE_UNLIMITED);
+  root->name = "autocrypt-root";
+  struct MuttWindow *pager = mutt_window_new(MUTT_WIN_ORIENT_VERTICAL, MUTT_WIN_SIZE_MAXIMISE, MUTT_WIN_SIZE_UNLIMITED, MUTT_WIN_SIZE_UNLIMITED);
+  pager->name = "autocrypt-pager";
+  struct MuttWindow *pbar = mutt_window_new(MUTT_WIN_ORIENT_VERTICAL, MUTT_WIN_SIZE_FIXED, 1, MUTT_WIN_SIZE_UNLIMITED);
+  pbar->name = "autocrypt-bar";
+
+  struct Dialog *dialog = mutt_mem_calloc(1, sizeof (*dialog));
+  dialog->root = root;
+
+  mutt_window_add_child(root, pager);
+  mutt_window_add_child(root, pbar);
+
+  dialog_push(dialog);
+  win_dump();
+
   struct Menu *menu = create_menu();
   if (!menu)
     return;
 
+  menu->pagelen = pager->state.rows;
+  menu->indexwin = pager;
+  menu->statuswin = pbar;
+
   bool done = false;
   while (!done)
   {
@@ -289,6 +310,9 @@ void mutt_autocrypt_account_menu(void)
         {
           menu_free(&menu);
           menu = create_menu();
+          menu->pagelen = pager->state.rows;
+          menu->indexwin = pager;
+          menu->statuswin = pbar;
         }
         break;
 
@@ -307,6 +331,9 @@ void mutt_autocrypt_account_menu(void)
           {
             menu_free(&menu);
             menu = create_menu();
+            menu->pagelen = pager->state.rows;
+            menu->indexwin = pager;
+            menu->statuswin = pbar;
           }
         }
         break;
@@ -332,4 +359,6 @@ void mutt_autocrypt_account_menu(void)
   }
 
   menu_free(&menu);
+  dialog_pop();
+  mutt_window_free(&root);
 }