Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions ttyplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
#endif

// Window size
#define WIDTH_MIN 68
#define WIDTH_MIN 44
#define WIDTH_CLOCK_MIN 68
Comment thread
edgar-bonet marked this conversation as resolved.
Outdated
#define WIDTH_MARGIN 4
#define HEIGHT_MIN 5
#define HEIGHT_MARGIN 4
Expand Down Expand Up @@ -532,15 +533,17 @@ static void paint_plot(void) {

mvaddstr(height - 1, width - strlen(verstring) - 1, verstring);

const char *clock_display;
if (fake_clock) {
clock_display = "Thu Jan 1 00:00:00 1970 ";
} else {
lt = localtime(&now.tv_sec);
asctime_r(lt, ls);
clock_display = ls;
if (width >= WIDTH_CLOCK_MIN) {
const char *clock_display;
if (fake_clock) {
clock_display = "Thu Jan 1 00:00:00 1970 ";
Comment thread
edgar-bonet marked this conversation as resolved.
Outdated
} else {
lt = localtime(&now.tv_sec);
asctime_r(lt, ls);
clock_display = ls;
}
mvaddstr(height - 2, width - strlen(clock_display), clock_display);
}
mvaddstr(height - 2, width - strlen(clock_display), clock_display);

if (colors[TEXT_COLOR] != -1)
attroff(COLOR_PAIR(TEXT_COLOR + 1));
Expand Down
Loading