desktop-shell/client: Use a proper enum for clock format
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
e8bf959764
commit
f9574f2314
|
@ -40,6 +40,7 @@
|
|||
#include <libgen.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <wayland-client.h>
|
||||
#include "window.h"
|
||||
|
@ -55,6 +56,12 @@
|
|||
|
||||
extern char **environ; /* defined by libc */
|
||||
|
||||
enum clock_format {
|
||||
CLOCK_FORMAT_MINUTES,
|
||||
CLOCK_FORMAT_SECONDS,
|
||||
CLOCK_FORMAT_NONE
|
||||
};
|
||||
|
||||
struct desktop {
|
||||
struct display *display;
|
||||
struct weston_desktop_shell *shell;
|
||||
|
@ -90,7 +97,7 @@ struct panel {
|
|||
struct wl_list launcher_list;
|
||||
struct panel_clock *clock;
|
||||
int painted;
|
||||
int clock_format;
|
||||
enum clock_format clock_format;
|
||||
uint32_t color;
|
||||
};
|
||||
|
||||
|
@ -417,12 +424,6 @@ panel_destroy_clock(struct panel_clock *clock)
|
|||
free(clock);
|
||||
}
|
||||
|
||||
enum {
|
||||
CLOCK_FORMAT_MINUTES,
|
||||
CLOCK_FORMAT_SECONDS,
|
||||
CLOCK_FORMAT_NONE
|
||||
};
|
||||
|
||||
static void
|
||||
panel_add_clock(struct panel *panel)
|
||||
{
|
||||
|
@ -449,6 +450,8 @@ panel_add_clock(struct panel *panel)
|
|||
clock->format_string = "%a %b %d, %I:%M:%S %p";
|
||||
clock->refresh_timer = 1;
|
||||
break;
|
||||
case CLOCK_FORMAT_NONE:
|
||||
assert(!"not reached");
|
||||
}
|
||||
|
||||
clock->clock_task.run = clock_func;
|
||||
|
|
Loading…
Reference in New Issue