aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Jonglez <baptiste--git@jonglez.org>2012-05-02 16:19:31 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-02 17:11:19 +0200
commit6f80d84d5e65f5187579a016ad8858aeda50cad9 (patch)
tree8785671cd8f664bae116177a4275d69881e19b84
parent0a352fe5190c7ba40dec2c29bafd181c1984bb95 (diff)
downloadcalcurse-6f80d84d5e65f5187579a016ad8858aeda50cad9.tar.gz
calcurse-6f80d84d5e65f5187579a016ad8858aeda50cad9.zip
Various code cleanup
Remove obsolete bits of code that weren't thrown away by b5c1981; simplify some others areas of the code. Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/wins.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/wins.c b/src/wins.c
index 3501b21..a1004d2 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -646,9 +646,6 @@ static unsigned status_page;
void
wins_status_bar (void)
{
-#define NB_PANELS 3 /* 3 panels: CALENDAR, APPOINTMENT, TODO */
- const int pos[NB_PANELS] = { 0, 0, 0 };
-
struct binding help = {_("Help"), KEY_GENERIC_HELP};
struct binding quit = {_("Quit"), KEY_GENERIC_QUIT};
struct binding save = {_("Save"), KEY_GENERIC_SAVE};
@@ -731,8 +728,8 @@ wins_status_bar (void)
}
keys_display_bindings_bar (win[STA].p, bindings, bindings_size,
- pos[active_panel] + (KEYS_CMDS_PER_LINE * 2 - 1) *
- (status_page - 1), KEYS_CMDS_PER_LINE * 2, &othr);
+ (KEYS_CMDS_PER_LINE * 2 - 1) * (status_page - 1),
+ KEYS_CMDS_PER_LINE * 2, &othr);
}
/* Erase status bar. */
@@ -764,10 +761,7 @@ wins_other_status_page (int panel)
/* NOTREACHED */
}
max_page = nb_item / (KEYS_CMDS_PER_LINE * 2 - 1) + 1;
- if (status_page < max_page)
- status_page++;
- else
- status_page = 1;
+ status_page = (status_page % max_page) + 1;
}
/* Reset the status bar page. */
@@ -780,5 +774,3 @@ wins_reset_status_page (void)
#undef NB_CAL_CMDS
#undef NB_APP_CMDS
#undef NB_TOD_CMDS
-#undef TOTAL_CMDS
-#undef CMDS_PER_LINE