Add title_align config directive

Controls the window titles alignment in title bars. Possible values are:
- left
- center
- right

Co-authored-by: Orestis Floros <orestisf1993@gmail.com>
- Made title_align a config directive instead of a command. Helps with
some tree_render() issues we had.
- Made title_max_width the same for all 3 cases.
- Modified title offset calculations and added explanations for each
case.
- Append title_padding to mark_width if a mark exists.

Fixes #1750
This commit is contained in:
Aestek
2018-04-22 03:55:37 +02:00
committed by Orestis Floros
parent dfe89cc4f1
commit 6d82753d53
7 changed files with 70 additions and 4 deletions

View File

@ -318,6 +318,18 @@ CFGFUN(focus_on_window_activation, const char *mode) {
DLOG("Set new focus_on_window_activation mode = %i.\n", config.focus_on_window_activation);
}
CFGFUN(title_align, const char *alignment) {
if (strcmp(alignment, "left") == 0) {
config.title_align = ALIGN_LEFT;
} else if (strcmp(alignment, "center") == 0) {
config.title_align = ALIGN_CENTER;
} else if (strcmp(alignment, "right") == 0) {
config.title_align = ALIGN_RIGHT;
} else {
assert(false);
}
}
CFGFUN(show_marks, const char *value) {
config.show_marks = eval_boolstr(value);
}