Remove temporary highlight pointers
Add an additional check to apoint_update_panel() and todo_update_panel() and only highlight currently selected items if the corresponding panel is active. This allows us to remove all the highlight pointer juggling that we used whenever the panel selection changed. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
146877a7da
commit
70a488a64e
@ -684,7 +684,7 @@ apoint_update_panel (int which_pan)
|
|||||||
if (slctd_date.dd < 10)
|
if (slctd_date.dd < 10)
|
||||||
title_xpos++;
|
title_xpos++;
|
||||||
date = date2sec (slctd_date, 0, 0);
|
date = date2sec (slctd_date, 0, 0);
|
||||||
day_write_pad (date, app_width, app_length, hilt);
|
day_write_pad (date, app_width, app_length, (which_pan == APP) ? hilt : 0);
|
||||||
|
|
||||||
/* Print current date in the top right window corner. */
|
/* Print current date in the top right window corner. */
|
||||||
erase_window_part (win[APP].p, 1, title_lines, win[APP].w - 2,
|
erase_window_part (win[APP].p, 1, title_lines, win[APP].w - 2,
|
||||||
|
@ -52,8 +52,6 @@ main (int argc, char **argv)
|
|||||||
struct day_items_nb inday;
|
struct day_items_nb inday;
|
||||||
int non_interactive;
|
int non_interactive;
|
||||||
int no_data_file = 1;
|
int no_data_file = 1;
|
||||||
int sav_hilt_app = 0;
|
|
||||||
int sav_hilt_tod = 0;
|
|
||||||
int cut_item = 0;
|
int cut_item = 0;
|
||||||
unsigned do_storage = 0;
|
unsigned do_storage = 0;
|
||||||
unsigned do_update = 1;
|
unsigned do_update = 1;
|
||||||
@ -183,37 +181,19 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
case KEY_GENERIC_CHANGE_VIEW:
|
case KEY_GENERIC_CHANGE_VIEW:
|
||||||
wins_reset_status_page ();
|
wins_reset_status_page ();
|
||||||
/* Need to save the previously highlighted event. */
|
|
||||||
switch (wins_slctd ())
|
|
||||||
{
|
|
||||||
case TOD:
|
|
||||||
sav_hilt_tod = todo_hilt ();
|
|
||||||
todo_hilt_set (0);
|
|
||||||
break;
|
|
||||||
case APP:
|
|
||||||
sav_hilt_app = apoint_hilt ();
|
|
||||||
apoint_hilt_set (0);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
wins_slctd_next ();
|
wins_slctd_next ();
|
||||||
|
|
||||||
/* Select the event to highlight. */
|
/* Select the event to highlight. */
|
||||||
switch (wins_slctd ())
|
switch (wins_slctd ())
|
||||||
{
|
{
|
||||||
case TOD:
|
case TOD:
|
||||||
if ((sav_hilt_tod == 0) && (todo_nb () != 0))
|
if ((todo_hilt () == 0) && (todo_nb () > 0))
|
||||||
todo_hilt_set (1);
|
todo_hilt_set (1);
|
||||||
else
|
|
||||||
todo_hilt_set (sav_hilt_tod);
|
|
||||||
break;
|
break;
|
||||||
case APP:
|
case APP:
|
||||||
if ((sav_hilt_app == 0)
|
if ((apoint_hilt () == 0) &&
|
||||||
&& ((inday.nb_events + inday.nb_apoints) != 0))
|
((inday.nb_events + inday.nb_apoints) > 0))
|
||||||
apoint_hilt_set (1);
|
apoint_hilt_set (1);
|
||||||
else
|
|
||||||
apoint_hilt_set (sav_hilt_app);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -568,11 +548,8 @@ main (int argc, char **argv)
|
|||||||
do_storage = !do_storage;
|
do_storage = !do_storage;
|
||||||
if (day_changed)
|
if (day_changed)
|
||||||
{
|
{
|
||||||
sav_hilt_app = 0;
|
apoint_hilt_set (1);
|
||||||
day_changed = !day_changed;
|
day_changed = !day_changed;
|
||||||
if ((wins_slctd () == APP) &&
|
|
||||||
(inday.nb_events + inday.nb_apoints != 0))
|
|
||||||
apoint_hilt_set (1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +437,7 @@ todo_update_panel (int which_pan)
|
|||||||
struct todo *todo = LLIST_TS_GET_DATA (i);
|
struct todo *todo = LLIST_TS_GET_DATA (i);
|
||||||
num_todo++;
|
num_todo++;
|
||||||
t_realpos = num_todo - first;
|
t_realpos = num_todo - first;
|
||||||
incolor = num_todo - hilt;
|
incolor = (which_pan == TOD) ? num_todo - hilt : num_todo;
|
||||||
if (incolor == 0)
|
if (incolor == 0)
|
||||||
msgsav = todo->mesg;
|
msgsav = todo->mesg;
|
||||||
if (t_realpos >= 0 && t_realpos < max_items)
|
if (t_realpos >= 0 && t_realpos < max_items)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user