Reformat ellipsize enum

This commit is contained in:
Benedikt Heine 2018-09-16 02:58:37 +02:00
parent c5d552856f
commit c712f57ace
4 changed files with 8 additions and 8 deletions

View File

@ -37,7 +37,7 @@ struct settings defaults = {
.history_length = 20, /* max amount of notifications kept in history */ .history_length = 20, /* max amount of notifications kept in history */
.show_indicators = true, .show_indicators = true,
.word_wrap = false, .word_wrap = false,
.ellipsize = middle, .ellipsize = ELLIPSE_MIDDLE,
.ignore_newline = false, .ignore_newline = false,
.line_height = 0, /* if line height < font height, it will be raised to font height */ .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 */ .notification_height = 0, /* if notification height < font height and padding, it will be raised */

View File

@ -254,13 +254,13 @@ static struct colored_layout *layout_init_shared(cairo_t *c, const struct notifi
if (!settings.word_wrap) { if (!settings.word_wrap) {
PangoEllipsizeMode ellipsize; PangoEllipsizeMode ellipsize;
switch (settings.ellipsize) { switch (settings.ellipsize) {
case start: case ELLIPSE_START:
ellipsize = PANGO_ELLIPSIZE_START; ellipsize = PANGO_ELLIPSIZE_START;
break; break;
case middle: case ELLIPSE_MIDDLE:
ellipsize = PANGO_ELLIPSIZE_MIDDLE; ellipsize = PANGO_ELLIPSIZE_MIDDLE;
break; break;
case end: case ELLIPSE_END:
ellipsize = PANGO_ELLIPSIZE_END; ellipsize = PANGO_ELLIPSIZE_END;
break; break;
default: default:

View File

@ -219,11 +219,11 @@ void load_settings(char *cmdline_config_path)
if (strlen(c) == 0) { if (strlen(c) == 0) {
settings.ellipsize = defaults.ellipsize; settings.ellipsize = defaults.ellipsize;
} else if (strcmp(c, "start") == 0) { } else if (strcmp(c, "start") == 0) {
settings.ellipsize = start; settings.ellipsize = ELLIPSE_START;
} else if (strcmp(c, "middle") == 0) { } else if (strcmp(c, "middle") == 0) {
settings.ellipsize = middle; settings.ellipsize = ELLIPSE_MIDDLE;
} else if (strcmp(c, "end") == 0) { } else if (strcmp(c, "end") == 0) {
settings.ellipsize = end; settings.ellipsize = ELLIPSE_END;
} else { } else {
LOG_W("Unknown ellipsize value: '%s'", c); LOG_W("Unknown ellipsize value: '%s'", c);
settings.ellipsize = defaults.ellipsize; settings.ellipsize = defaults.ellipsize;

View File

@ -7,7 +7,7 @@
#include "x11/x.h" #include "x11/x.h"
enum alignment { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }; 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 icon_position { ICON_LEFT, ICON_RIGHT, ICON_OFF };
enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM }; enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM };
enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD }; enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };