notification bar created

This commit is contained in:
Frederic Culot 2006-09-09 20:09:43 +00:00
parent 9a5dc44fff
commit ece0f2d248

View File

@ -1,4 +1,4 @@
/* $calcurse: calcurse.c,v 1.13 2006/09/08 09:47:17 culot Exp $ */ /* $calcurse: calcurse.c,v 1.14 2006/09/09 20:09:43 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -49,6 +49,7 @@
#include "recur.h" #include "recur.h"
#include "todo.h" #include "todo.h"
#include "args.h" #include "args.h"
#include "notify.h"
/* Variables for calendar */ /* Variables for calendar */
@ -87,8 +88,9 @@ bool week_begins_on_monday;
/* /*
* Variables to handle calcurse windows * Variables to handle calcurse windows
*/ */
int x_cal, y_cal, x_app, y_app, x_tod, y_tod, x_bar, y_bar; int x_cal, y_cal, x_app, y_app, x_tod, y_tod, x_bar, y_bar, x_not, y_not;
int nl_cal, nc_cal, nl_app, nc_app, nl_tod, nc_tod, nl_bar, nc_bar; int nl_cal, nc_cal, nl_app, nc_app, nl_tod, nc_tod;
int nl_bar, nc_bar, nl_not, nc_not;
int which_pan = 0; int which_pan = 0;
enum window_number {CALENDAR, APPOINTMENT, TODO}; enum window_number {CALENDAR, APPOINTMENT, TODO};
@ -171,6 +173,7 @@ int main(int argc, char **argv)
init_vars(colr); init_vars(colr);
init_wins(); init_wins();
notify_init_bar(nl_not, nc_not, y_not, x_not);
reset_status_page(); reset_status_page();
update_windows(which_pan); update_windows(which_pan);
@ -572,6 +575,7 @@ void update_windows(int surrounded_window)
sel_year, sel_day, day, month, year, sel_year, sel_day, day, month, year,
week_begins_on_monday); week_begins_on_monday);
status_bar(surrounded_window, colr, nc_bar, nl_bar); status_bar(surrounded_window, colr, nc_bar, nl_bar);
notify_update_bar();
wmove(swin, 0, 0); wmove(swin, 0, 0);
doupdate(); doupdate();
} }
@ -584,22 +588,24 @@ void get_screen_config(void)
/* Get the screen configuration */ /* Get the screen configuration */
getmaxyx(stdscr, row, col); getmaxyx(stdscr, row, col);
/* window size definition */ /* fixed values for status, notification bars and calendar */
nl_bar = 2; y_bar = row - nl_bar; nl_bar = 2; nc_bar = col;
nc_bar = col; x_bar = 0; y_bar = row - nl_bar; x_bar = 0;
nl_not = 1; nc_not = col;
y_not = y_bar - 1; x_not = 0;
nl_cal = 12; nl_cal = 12;
nc_cal = 30; nc_cal = 30;
if (layout <= 4) { /* APPOINTMENT is the biggest panel */ if (layout <= 4) { /* APPOINTMENT is the biggest panel */
nc_app = col - nc_cal; nc_app = col - nc_cal;
nl_app = row - nl_bar; nl_app = row - (nl_bar + nl_not);
nc_tod = nc_cal; nc_tod = nc_cal;
nl_tod = row - (nl_cal + nl_bar); nl_tod = row - (nl_cal + nl_bar + nl_not);
} else { /* TODO is the biggest panel */ } else { /* TODO is the biggest panel */
nc_tod = col - nc_cal; nc_tod = col - nc_cal;
nl_tod = row - nl_bar; nl_tod = row - (nl_bar + nl_not);
nc_app = nc_cal; nc_app = nc_cal;
nl_app = row - (nl_cal + nl_bar); nl_app = row - (nl_cal + nl_bar + nl_not);
} }
/* defining the layout */ /* defining the layout */
@ -696,6 +702,7 @@ void reinit_wins(void)
delwin(twin); delwin(twin);
get_screen_config(); get_screen_config();
init_wins(); init_wins();
notify_reinit_bar(nl_not, nc_not, y_not, x_not);
update_windows(which_pan); update_windows(which_pan);
} }