From c712f57ace5be164369507eb7c29b4dc455fdbe8 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Sun, 16 Sep 2018 02:58:37 +0200 Subject: [PATCH] Reformat ellipsize 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 1aaa546..40207a3 100644 --- a/config.h +++ b/config.h @@ -37,7 +37,7 @@ struct settings defaults = { .history_length = 20, /* max amount of notifications kept in history */ .show_indicators = true, .word_wrap = false, -.ellipsize = middle, +.ellipsize = ELLIPSE_MIDDLE, .ignore_newline = false, .line_height = 0, /* if line height < font height, it will be raised to font height */ .notification_height = 0, /* if notification height < font height and padding, it will be raised */ diff --git a/src/draw.c b/src/draw.c index d6830a3..e1f15c8 100644 --- a/src/draw.c +++ b/src/draw.c @@ -254,13 +254,13 @@ static struct colored_layout *layout_init_shared(cairo_t *c, const struct notifi if (!settings.word_wrap) { PangoEllipsizeMode ellipsize; switch (settings.ellipsize) { - case start: + case ELLIPSE_START: ellipsize = PANGO_ELLIPSIZE_START; break; - case middle: + case ELLIPSE_MIDDLE: ellipsize = PANGO_ELLIPSIZE_MIDDLE; break; - case end: + case ELLIPSE_END: ellipsize = PANGO_ELLIPSIZE_END; break; default: diff --git a/src/settings.c b/src/settings.c index c05d4d5..110b98b 100644 --- a/src/settings.c +++ b/src/settings.c @@ -219,11 +219,11 @@ void load_settings(char *cmdline_config_path) if (strlen(c) == 0) { settings.ellipsize = defaults.ellipsize; } else if (strcmp(c, "start") == 0) { - settings.ellipsize = start; + settings.ellipsize = ELLIPSE_START; } else if (strcmp(c, "middle") == 0) { - settings.ellipsize = middle; + settings.ellipsize = ELLIPSE_MIDDLE; } else if (strcmp(c, "end") == 0) { - settings.ellipsize = end; + settings.ellipsize = ELLIPSE_END; } else { LOG_W("Unknown ellipsize value: '%s'", c); settings.ellipsize = defaults.ellipsize; diff --git a/src/settings.h b/src/settings.h index 0a19f73..afa39c1 100644 --- a/src/settings.h +++ b/src/settings.h @@ -7,7 +7,7 @@ #include "x11/x.h" enum alignment { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }; -enum ellipsize { start, middle, end }; +enum ellipsize { ELLIPSE_START, ELLIPSE_MIDDLE, ELLIPSE_END }; enum icon_position { ICON_LEFT, ICON_RIGHT, ICON_OFF }; enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM }; enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };