summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/menu.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/menu.c b/src/menu.c
index 9d4e55e..9339c80 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -31,6 +31,8 @@
#include "tk.h"
#include "util.h"
+const int MF_MENU_SIZES_[] = {15, 20, 30};
+
struct _mf_menu {
long seed;
int size;
@@ -54,19 +56,8 @@ _mf_menu_size(void *user_data, int state)
{
struct _mf_menu *menu = (struct _mf_menu *) user_data;
- switch (state) {
- case 0:
- menu->size = 15;
- break;
- case 1:
- menu->size = 20;
- break;
- case 2:
- menu->size = 30;
- break;
- default:
- break;
- }
+ menu->size = MF_MENU_SIZES_[state];
+
return 0;
}