take height into account
This commit is contained in:
6
main.c
6
main.c
@@ -228,10 +228,10 @@ void add_command_handler(int width, int height) {
|
|||||||
arrput(todos, item);
|
arrput(todos, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void view_command_handler(int width, int index) {
|
void view_command_handler(int width, int height, int index) {
|
||||||
TodoItem item = todos[index];
|
TodoItem item = todos[index];
|
||||||
// create an alert in the middle of the screen
|
// create an alert in the middle of the screen
|
||||||
alert(item.title, width, 24);
|
alert(item.title, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mark_command_handler(int index) {
|
void mark_command_handler(int index) {
|
||||||
@@ -362,7 +362,7 @@ int main(int argc, char **argv) {
|
|||||||
add_command_handler(terminal_width, terminal_height);
|
add_command_handler(terminal_width, terminal_height);
|
||||||
break;
|
break;
|
||||||
case VIEW:
|
case VIEW:
|
||||||
view_command_handler(terminal_width, current_line);
|
view_command_handler(terminal_width, terminal_height, current_line);
|
||||||
break;
|
break;
|
||||||
case MARK:
|
case MARK:
|
||||||
case SPACE:
|
case SPACE:
|
||||||
|
|||||||
Reference in New Issue
Block a user