summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-05-19Avoid blank space after the last list box itemLukas Fleischer
Automatically scroll down the list box when resizing creates some blank space below the list of items. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-19Resize panels properlyLukas Fleischer
Rewrite the panel resize code and remove the code that reinitializes the caption and the selected item when the window is resized. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-19listbox_resize(): Avoid segmentation faultLukas Fleischer
Only try to fix the visible region if an item is selected. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-19Fix calendar centeringLukas Fleischer
Adjust the positions of the weekly and monthly views inside the calendar panel. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Use an enum for the type field of day_itemLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add default cases to some switch statementsLukas Fleischer
This squelches several compiler warnings. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18day_item_add_exc(): Fix unwanted fall-throughLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Reintroduce heading and separator in appointmentsLukas Fleischer
This re-introduces the heading (showing the POM and the current date) as well as the separating line between events and appointments. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add support for caption rows in list boxesLukas Fleischer
This adds support for rows that cannot be selected. Such rows can be used for section headings and the like. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Remove unused functions border_{,no}color()Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18ui-day: Large-scale refactoringLukas Fleischer
Use the generic list box implementation for the appointments panel. This results in some major changes to how the items are printed. Note that this temporarily removes the heading showing the POM and the date as well as the separating line between events and appointments. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Store appointments for the current day in a vectorLukas Fleischer
This allows for more efficient access to items at specific positions. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add a vector implementationLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18ui-calendar: Use scroll window implementationLukas Fleischer
Make use of the generic scroll window implementation for the calendar view. Note that this is useful despite the panel not needing a scroll bar, since the scroll window functions can be used to draw the panel border and take care of relative positions. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18ui-todo: Large-scale refactoringLukas Fleischer
This is a complete overhaul of the TODO list user interface. The new implementation uses the generic list box panel. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add support for drawing highlighted decorationLukas Fleischer
This allows for drawing selected scroll windows and list boxes with a highlighted border. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18custom.c: Simplify codeLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Remove numbers and whitespace from option menusLukas Fleischer
These are no longer needed since items are no longer accessed via numeric keys. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Reduce flicker when resizing in option menusLukas Fleischer
Do not update the main windows when resizing the terminal in the general options menu or in the notification options menu. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Use generic list box for notification optionsLukas Fleischer
This changes the notification options menu to use the new generic list box implementation. The only user-visible change is that items are now accessed via the arrow and edit key bindings instead of digits. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Use generic list box for general optionsLukas Fleischer
This changes the general options menu to use the new generic list box implementation. The only user-visible change is that items are now accessed via the arrow and edit key bindings instead of digits. This also allows for easily adding more than 10 options to the menu. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add a generic list box implementationLukas Fleischer
This adds a very generic list box implementation. List boxes with items of different heights are supported. Two callback functions to determine the height of every single item and to draw a specific item are used. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Rework scroll window implementationLukas Fleischer
This complete rewrite of the scroll window implementation decouples scroll windows from every other window abstraction layer we use. Note that this leads to some code duplication. The long-term purpose of this rewrite, however, is to eventually make every panel use scroll windows. This makes for a huge cleanup of the UI code. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-13Pass date parameter to ui_day_update_panel()Lukas Fleischer
This allows for drawing appointment panels for days other than the current day. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-08-27Display translated help pagesLukas Fleischer
Use an algorithm similar to gettext's locale resolution to find an appropriate translation to display. Fall back to the English version. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-08-13Redraw screen if command prompt is canceledLukas Fleischer
When pressing escape or entering an empty command, we returned from key_generic_cmd() without updating the screen. Fix this by creating a cleanup section at the bottom of key_generic_cmd() and jump to that section when the command prompt is cancelled. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18Add write and quit commandsLukas Fleischer
This adds following vim-style commands to the command mode: * write * w * quit * q * wq Commands can be suffixed with a "!" to force execution. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18Add support for moving appointmentsLukas Fleischer
This adds an edit option to change an appointment's start time without changing its duration. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18update_start_time(): Allow for moving an itemLukas Fleischer
Add a parameter that specifies whether the duration should be updated when updating the start time of an item. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18Allow for making an appointment punctualLukas Fleischer
This allows for setting an empty end time when editing an item, converting it into a punctual appointment. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18key_generic_help(): Use display_help()Lukas Fleischer
Now that we moved the online help code into a separate function, use that to display the introduction help page when pressing the generic help key binding. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18Split online help code into a separate functionLukas Fleischer
Reintroduce help.c and move the online help code into a new function display_help(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Rename io_file_exist{,s}()Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Add several help topic aliasesLukas Fleischer
Add aliases and choose the right help topic if the user requests help on a key binding or a key binding label. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Allow for getting help on key bindingsLukas Fleischer
In addition to getting help on specific topics, users can type things like ":help s" or ":help ^A" to get help on specific key bindings now. Note that we do not add help texts for these keys here -- we will alias key bindings to already existing topics in a follow-up patch. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Drop legacy online help systemLukas Fleischer
Remove the old online help system and change the generic help key to do the same thing as ":help". This also removes some context-sensitive help. We should think about re-adding support for this later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Add introduction to the new online help systemLukas Fleischer
This adds a very basic explanation of the new help command that can be displayed using ":help intro". This introduction is also added as default page so that users can simply type ":help" instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Add help commandLukas Fleischer
This adds a "help" command to the list of available command mode commands. You can currently type "help", followed by a topic like "add". calcurse will then try to open a file named "add.txt" in the documentation directory and display it in an external pager. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Add command promptLukas Fleischer
This adds support for vim-style command mode. The command mode can be entered with pressing ":" (by default, the key binding is configurable). Currently, no command is supported. Support for various commands will be added later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Add a short format specifier for "%(remaining)"Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Allow extended formats for durationsLukas Fleischer
Use print_datediff() to print durations. This allows for using something like "%(duration:%EH:%M)". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17print_datediff(): Actually print a date differenceLukas Fleischer
Instead of passing a date and printing the date difference between that date and the current date, pass an actual date difference. This allows for using the function in other places, such as for printing item durations. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-17Add %(remaining) style formattingWilliam Pettersson
Adds %(remaining) style formatting, with parameter substitution for %d, %H, %M, %S with E and - variables. Signed-off-by: William Pettersson <william.pettersson@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-16Add -l/--limit optionWilliam Pettersson
Adds the -l/--limit command line option. Limits the number of appointments and/or ToDo items displayed. Signed-off-by: William Pettersson <william.pettersson@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-14Fix a couple of translatable stringsLukas Fleischer
* Remove space before punctuation. * Use "TODO" instead of "ToDo". * Strip some formats to make sure lines are <=80 characters wide. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-14Support punctual appointments in the UILukas Fleischer
Allow for skipping the end date which means that a punctual appointment will be created. Implements FR#25. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-14display_item_date(): Support punctual appointmentsLukas Fleischer
Display appointments having the same starting date as ending date using a specific format that hides the end time ("12:00" instead of "12:00 -> 12:00"). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-14Refactor display_item_date()Lukas Fleischer
Replace nested case differentiations by initializing every single character for each flag separately and joining all characters afterwards. This makes it much easier to extend the function later. Note that the same approach is already used in display_item(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-04Use a macro to determine the size of arraysLukas Fleischer
Use following macro instead of "sizeof(x) / sizeof(x[0])" everywhere: #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-02recur.c: Refactor/Reformat recur_item_find_occurrence()Lukas Fleischer
Fix a couple of whitespace and line breaks. Bail out early instead of using nested if statements. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>