Don't indent switch labels
This commit is contained in:
parent
5b2a6e57b7
commit
0ad63d2c2c
@ -349,81 +349,81 @@ void notification_init(notification *n)
|
|||||||
char *icon_tmp;
|
char *icon_tmp;
|
||||||
|
|
||||||
switch(substr[1]) {
|
switch(substr[1]) {
|
||||||
case 'a':
|
case 'a':
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
n->appname,
|
n->appname,
|
||||||
MARKUP_NO);
|
MARKUP_NO);
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
n->summary,
|
n->summary,
|
||||||
n->markup);
|
n->markup);
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
n->body,
|
n->body,
|
||||||
n->markup);
|
n->markup);
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
icon_tmp = g_strdup(n->icon);
|
icon_tmp = g_strdup(n->icon);
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
icon_tmp ? basename(icon_tmp) : "",
|
icon_tmp ? basename(icon_tmp) : "",
|
||||||
MARKUP_NO);
|
MARKUP_NO);
|
||||||
g_free(icon_tmp);
|
g_free(icon_tmp);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
n->icon ? n->icon : "",
|
n->icon ? n->icon : "",
|
||||||
MARKUP_NO);
|
MARKUP_NO);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if (n->progress != -1)
|
if (n->progress != -1)
|
||||||
sprintf(pg, "[%3d%%]", n->progress);
|
sprintf(pg, "[%3d%%]", n->progress);
|
||||||
|
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
n->progress != -1 ? pg : "",
|
n->progress != -1 ? pg : "",
|
||||||
MARKUP_NO);
|
MARKUP_NO);
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
if (n->progress != -1)
|
if (n->progress != -1)
|
||||||
sprintf(pg, "%d", n->progress);
|
sprintf(pg, "%d", n->progress);
|
||||||
|
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
n->progress != -1 ? pg : "",
|
n->progress != -1 ? pg : "",
|
||||||
MARKUP_NO);
|
MARKUP_NO);
|
||||||
break;
|
break;
|
||||||
case '%':
|
case '%':
|
||||||
notification_replace_single_field(
|
notification_replace_single_field(
|
||||||
&n->msg,
|
&n->msg,
|
||||||
&substr,
|
&substr,
|
||||||
"%",
|
"%",
|
||||||
MARKUP_NO);
|
MARKUP_NO);
|
||||||
break;
|
break;
|
||||||
case '\0':
|
case '\0':
|
||||||
fprintf(stderr, "WARNING: format_string has trailing %% character."
|
fprintf(stderr, "WARNING: format_string has trailing %% character."
|
||||||
"To escape it use %%%%.");
|
"To escape it use %%%%.");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "WARNING: format_string %%%c"
|
fprintf(stderr, "WARNING: format_string %%%c"
|
||||||
" is unknown\n", substr[1]);
|
" is unknown\n", substr[1]);
|
||||||
// shift substr pointer forward,
|
// shift substr pointer forward,
|
||||||
// as we can't interpret the format string
|
// as we can't interpret the format string
|
||||||
substr++;
|
substr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
118
src/x11/x.c
118
src/x11/x.c
@ -121,20 +121,20 @@ static color_t calculate_foreground_color(color_t bg)
|
|||||||
static color_t x_get_separator_color(colored_layout *cl, colored_layout *cl_next)
|
static color_t x_get_separator_color(colored_layout *cl, colored_layout *cl_next)
|
||||||
{
|
{
|
||||||
switch (settings.sep_color) {
|
switch (settings.sep_color) {
|
||||||
case FRAME:
|
case FRAME:
|
||||||
if (cl_next->n->urgency > cl->n->urgency)
|
if (cl_next->n->urgency > cl->n->urgency)
|
||||||
return cl_next->frame;
|
return cl_next->frame;
|
||||||
else
|
else
|
||||||
return cl->frame;
|
return cl->frame;
|
||||||
case CUSTOM:
|
case CUSTOM:
|
||||||
return x_string_to_color_t(settings.sep_custom_color_str);
|
return x_string_to_color_t(settings.sep_custom_color_str);
|
||||||
case FOREGROUND:
|
case FOREGROUND:
|
||||||
return cl->fg;
|
return cl->fg;
|
||||||
case AUTO:
|
case AUTO:
|
||||||
return calculate_foreground_color(cl->bg);
|
return calculate_foreground_color(cl->bg);
|
||||||
default:
|
default:
|
||||||
printf("Unknown separator color type. Please file a Bugreport.\n");
|
printf("Unknown separator color type. Please file a Bugreport.\n");
|
||||||
return cl->fg;
|
return cl->fg;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,16 +158,16 @@ static void r_setup_pango_layout(PangoLayout *layout, int width)
|
|||||||
|
|
||||||
PangoAlignment align;
|
PangoAlignment align;
|
||||||
switch (settings.align) {
|
switch (settings.align) {
|
||||||
case left:
|
case left:
|
||||||
default:
|
default:
|
||||||
align = PANGO_ALIGN_LEFT;
|
align = PANGO_ALIGN_LEFT;
|
||||||
break;
|
break;
|
||||||
case center:
|
case center:
|
||||||
align = PANGO_ALIGN_CENTER;
|
align = PANGO_ALIGN_CENTER;
|
||||||
break;
|
break;
|
||||||
case right:
|
case right:
|
||||||
align = PANGO_ALIGN_RIGHT;
|
align = PANGO_ALIGN_RIGHT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pango_layout_set_alignment(layout, align);
|
pango_layout_set_alignment(layout, align);
|
||||||
|
|
||||||
@ -410,17 +410,17 @@ static colored_layout *r_init_shared(cairo_t *c, notification *n)
|
|||||||
if (!settings.word_wrap) {
|
if (!settings.word_wrap) {
|
||||||
PangoEllipsizeMode ellipsize;
|
PangoEllipsizeMode ellipsize;
|
||||||
switch (settings.ellipsize) {
|
switch (settings.ellipsize) {
|
||||||
case start:
|
case start:
|
||||||
ellipsize = PANGO_ELLIPSIZE_START;
|
ellipsize = PANGO_ELLIPSIZE_START;
|
||||||
break;
|
break;
|
||||||
case middle:
|
case middle:
|
||||||
ellipsize = PANGO_ELLIPSIZE_MIDDLE;
|
ellipsize = PANGO_ELLIPSIZE_MIDDLE;
|
||||||
break;
|
break;
|
||||||
case end:
|
case end:
|
||||||
ellipsize = PANGO_ELLIPSIZE_END;
|
ellipsize = PANGO_ELLIPSIZE_END;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
pango_layout_set_ellipsize(cl->l, ellipsize);
|
pango_layout_set_ellipsize(cl->l, ellipsize);
|
||||||
}
|
}
|
||||||
@ -771,30 +771,30 @@ static KeySym x_numlock_mod()
|
|||||||
* could count as 'using implementation details',
|
* could count as 'using implementation details',
|
||||||
* so use this large switch. */
|
* so use this large switch. */
|
||||||
switch (mod) {
|
switch (mod) {
|
||||||
case ShiftMapIndex:
|
case ShiftMapIndex:
|
||||||
sym = ShiftMask;
|
sym = ShiftMask;
|
||||||
goto end;
|
goto end;
|
||||||
case LockMapIndex:
|
case LockMapIndex:
|
||||||
sym = LockMask;
|
sym = LockMask;
|
||||||
goto end;
|
goto end;
|
||||||
case ControlMapIndex:
|
case ControlMapIndex:
|
||||||
sym = ControlMask;
|
sym = ControlMask;
|
||||||
goto end;
|
goto end;
|
||||||
case Mod1MapIndex:
|
case Mod1MapIndex:
|
||||||
sym = Mod1Mask;
|
sym = Mod1Mask;
|
||||||
goto end;
|
goto end;
|
||||||
case Mod2MapIndex:
|
case Mod2MapIndex:
|
||||||
sym = Mod2Mask;
|
sym = Mod2Mask;
|
||||||
goto end;
|
goto end;
|
||||||
case Mod3MapIndex:
|
case Mod3MapIndex:
|
||||||
sym = Mod3Mask;
|
sym = Mod3Mask;
|
||||||
goto end;
|
goto end;
|
||||||
case Mod4MapIndex:
|
case Mod4MapIndex:
|
||||||
sym = Mod4Mask;
|
sym = Mod4Mask;
|
||||||
goto end;
|
goto end;
|
||||||
case Mod5MapIndex:
|
case Mod5MapIndex:
|
||||||
sym = Mod5Mask;
|
sym = Mod5Mask;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user