diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index 55cbd001..fb53069e 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -60,6 +60,8 @@ extern char **environ; /* defined by libc */ enum clock_format { CLOCK_FORMAT_MINUTES, CLOCK_FORMAT_SECONDS, + CLOCK_FORMAT_MINUTES_24H, + CLOCK_FORMAT_SECONDS_24H, CLOCK_FORMAT_NONE }; @@ -464,6 +466,14 @@ panel_add_clock(struct panel *panel) clock->format_string = "%a %b %d, %I:%M:%S %p"; clock->refresh_timer = 1; break; + case CLOCK_FORMAT_MINUTES_24H: + clock->format_string = "%a %b %d, %H:%M"; + clock->refresh_timer = 60; + break; + case CLOCK_FORMAT_SECONDS_24H: + clock->format_string = "%a %b %d, %H:%M:%S"; + clock->refresh_timer = 1; + break; case CLOCK_FORMAT_NONE: assert(!"not reached"); } @@ -502,7 +512,7 @@ panel_resize_handler(struct widget *widget, if (panel->clock_format == CLOCK_FORMAT_SECONDS) w = 170; - else /* CLOCK_FORMAT_MINUTES */ + else /* CLOCK_FORMAT_MINUTES and 24H versions */ w = 150; if (horizontal) @@ -549,6 +559,8 @@ panel_configure(void *data, width = 32; break; case CLOCK_FORMAT_MINUTES: + case CLOCK_FORMAT_MINUTES_24H: + case CLOCK_FORMAT_SECONDS_24H: width = 150; break; case CLOCK_FORMAT_SECONDS: @@ -1505,6 +1517,10 @@ parse_clock_format(struct desktop *desktop, struct weston_config_section *s) desktop->clock_format = CLOCK_FORMAT_MINUTES; else if (strcmp(clock_format, "seconds") == 0) desktop->clock_format = CLOCK_FORMAT_SECONDS; + else if (strcmp(clock_format, "minutes-24h") == 0) + desktop->clock_format = CLOCK_FORMAT_MINUTES_24H; + else if (strcmp(clock_format, "seconds-24h") == 0) + desktop->clock_format = CLOCK_FORMAT_SECONDS_24H; else if (strcmp(clock_format, "none") == 0) desktop->clock_format = CLOCK_FORMAT_NONE; else diff --git a/man/weston.ini.man b/man/weston.ini.man index 9319e6c7..8935de17 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -379,7 +379,9 @@ digit pairs are in order alpha, red, green, and blue. sets the panel clock format (string). Can be .BR "none" "," .BR "minutes" "," -.BR "seconds" "." +.BR "seconds" "," +.BR "minutes-24h" "," +.BR "seconds-24h" "." By default, minutes format is used. .TP 7 .BI "panel-color=" 0xAARRGGBB