- char * title = "Window's geometry:\n\n";
- char * h_title = "Height to save: ";
- char h_value[6 + 1]; /* 6: int16_t value max strlen */
- int test = sprintf(h_value, "%d", win->target_height);
- exit_trouble(test < 0, __func__, "sprintf");
- char * h_plus = " (width in cells)\n\n";
- char * h_minus = " (negative diff: cells to screen width)\n\n";
- char * h_type = (1 == win->target_height_type) ? h_minus : h_plus;
- char * w_title = "Width to save: ";
- char w_value[6 + 1];
- test = sprintf(w_value, "%d", win->target_width);
- exit_trouble(test < 0, __func__, "sprintf");
- char * w_plus = "(height in cells)\n\n";
- char * w_minus = " (negative diff: cells to screen height)\n\n";
- char * w_type = (1 == win->target_width_type) ? w_minus : w_plus;
- char * breaks_title = "Linebreak type: ";
- char * breaks_type = (1 == win->linebreak) ? "wide" : "long";
- breaks_type = (2 == win->linebreak) ? "compact" : breaks_type;
- uint16_t text_size = strlen(title)
- + strlen(h_title) + strlen(h_value) + strlen(h_type)
- + strlen(w_title) + strlen(w_value) + strlen(w_type)
- + strlen(breaks_title) + strlen(breaks_type);
+ char * sep = "/";
+ char * newlines = "\n\n";
+ char * value_prefix = "): ";
+ char * title = "Window's geometry:\n\nShift up/down with ";
+ char * key_shift_b = get_keyname_to_command("shift_b");
+ char * key_shift_f = get_keyname_to_command("shift_f");
+ char * height = winconf_geom_helper(win, 'v', sep, newlines, value_prefix);
+ char * width = winconf_geom_helper(win, 'h', sep, newlines, value_prefix);
+ char * breaks_title = "Linebreak type (toggle with ";
+ char * key_to_break = get_keyname_to_command("to_break");
+ char * breaks_type = "long";
+ if (win->linebreak)
+ {
+ breaks_type = (1 == win->linebreak) ? "wide" : "compact";
+ }
+ uint16_t text_size = strlen(title) + strlen(key_shift_b) + strlen(sep)
+ + strlen(key_shift_f) + strlen(newlines)
+ + strlen(height) + strlen(width)
+ + strlen(breaks_title) + strlen(key_to_break)
+ + strlen(value_prefix) + strlen(breaks_type);