1. Added Feature to strikethrough TODO items
2. Requires adding -DNCURSES_WIDECHAR=1 to CFLAGS in src/Makefile 3. Made change so that priority cannot be changed on Completed TODO items. Signed-off-by: gaurav-cheema <toasterbathbombv2@gmail.com>
This commit is contained in:
parent
a665819060
commit
f4f5d4fd43
@ -228,8 +228,29 @@ void ui_todo_draw(int n, WINDOW *win, int y, int hilt, void *cb_data)
|
|||||||
}
|
}
|
||||||
mesg = buf;
|
mesg = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* wbuf stores the wide char string
|
||||||
|
requires 4 extra chars: <X . space nullchar> */
|
||||||
|
// have to add CFLAG: -DNCURSES_WIDECHAR=1
|
||||||
|
wchar_t wbuf[(strlen(mesg)+2)*2];
|
||||||
|
if (todo->completed) {
|
||||||
|
wcscpy(wbuf, L"X");
|
||||||
|
todo->note ? wcscat(wbuf, L">") : wcscat(wbuf, L".");
|
||||||
|
wcscat(wbuf, L" ");
|
||||||
|
|
||||||
|
wchar_t temp[2];
|
||||||
|
temp[1] = L'\0';
|
||||||
|
|
||||||
|
for (size_t i = 0; i < strlen(mesg); i++) {
|
||||||
|
mbstowcs(&temp[0], &mesg[i], 1);
|
||||||
|
wcscat(wbuf, L"\u0336");
|
||||||
|
wcscat(wbuf, temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mvwprintw(win, y, 0, "%s%s", mark, mesg);
|
if (todo->completed) {
|
||||||
|
mvwaddnwstr(win, y, 0, wbuf, -1);
|
||||||
|
} else { mvwprintw(win, y, 0, "%s%s", mark, mesg); }
|
||||||
|
|
||||||
if (hilt)
|
if (hilt)
|
||||||
custom_remove_attr(win, ATTR_HIGHEST);
|
custom_remove_attr(win, ATTR_HIGHEST);
|
||||||
@ -295,6 +316,9 @@ void ui_todo_chg_priority(int diff)
|
|||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (item->completed)
|
||||||
|
return;
|
||||||
|
|
||||||
int id = item->id + diff;
|
int id = item->id + diff;
|
||||||
struct todo *item_new;
|
struct todo *item_new;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user