From 2a5fe938f6203a46890beac5f44ca902ff10ae12 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Sun, 16 Sep 2018 02:58:33 +0200 Subject: [PATCH] Reformat alignment enum --- config.h | 2 +- src/draw.c | 6 +++--- src/settings.c | 6 +++--- src/settings.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.h b/config.h index d2cf382..1aaa546 100644 --- a/config.h +++ b/config.h @@ -32,7 +32,7 @@ struct settings defaults = { .indicate_hidden = true, /* show count of hidden messages */ .idle_threshold = 0, /* don't timeout notifications when idle for x seconds */ .show_age_threshold = -1, /* show age of notification, when notification is older than x seconds */ -.align = left, /* text alignment [left/center/right] */ +.align = ALIGN_LEFT, /* text alignment ALIGN_[LEFT|CENTER|RIGHT] */ .sticky_history = true, .history_length = 20, /* max amount of notifications kept in history */ .show_indicators = true, diff --git a/src/draw.c b/src/draw.c index cc64653..c08a4e4 100644 --- a/src/draw.c +++ b/src/draw.c @@ -120,14 +120,14 @@ static void layout_setup_pango(PangoLayout *layout, int width) PangoAlignment align; switch (settings.align) { - case left: + case ALIGN_LEFT: default: align = PANGO_ALIGN_LEFT; break; - case center: + case ALIGN_CENTER: align = PANGO_ALIGN_CENTER; break; - case right: + case ALIGN_RIGHT: align = PANGO_ALIGN_RIGHT; break; } diff --git a/src/settings.c b/src/settings.c index a2c38f4..bd8c7bd 100644 --- a/src/settings.c +++ b/src/settings.c @@ -320,11 +320,11 @@ void load_settings(char *cmdline_config_path) if (strlen(c) > 0) { if (strcmp(c, "left") == 0) - settings.align = left; + settings.align = ALIGN_LEFT; else if (strcmp(c, "center") == 0) - settings.align = center; + settings.align = ALIGN_CENTER; else if (strcmp(c, "right") == 0) - settings.align = right; + settings.align = ALIGN_RIGHT; else LOG_W("Unknown alignment value: '%s'", c); g_free(c); diff --git a/src/settings.h b/src/settings.h index 3c50490..249156a 100644 --- a/src/settings.h +++ b/src/settings.h @@ -6,7 +6,7 @@ #include "x11/x.h" -enum alignment { left, center, right }; +enum alignment { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }; enum ellipsize { start, middle, end }; enum icon_position_t { icons_left, icons_right, icons_off }; enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM };