mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-15 22:05:24 -05:00
config: rename scrollback-indicator-style to scrollback-indicator-position
This commit is contained in:
parent
aca5a64954
commit
718e5b4a77
6 changed files with 19 additions and 19 deletions
|
|
@ -20,7 +20,7 @@
|
|||
* Mouse cursor is now always a `left_ptr` when inside the margins, to
|
||||
indicate it is not possible to start a selection.
|
||||
* Scrollback position indicator. This feature is optional and
|
||||
controlled by the **scrollback-indicator-style** and
|
||||
controlled by the **scrollback-indicator-position** and
|
||||
**scrollback-indicator-format** options in `footrc`
|
||||
(https://codeberg.org/dnkl/foot/issues/42).
|
||||
|
||||
|
|
|
|||
12
config.c
12
config.c
|
|
@ -291,15 +291,15 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
|||
conf->scrollback.lines = lines;
|
||||
}
|
||||
|
||||
else if (strcmp(key, "scrollback-indicator-style") == 0) {
|
||||
else if (strcmp(key, "scrollback-indicator-position") == 0) {
|
||||
if (strcmp(value, "none") == 0)
|
||||
conf->scrollback.indicator.style = SCROLLBACK_INDICATOR_STYLE_NONE;
|
||||
conf->scrollback.indicator.position = SCROLLBACK_INDICATOR_POSITION_NONE;
|
||||
else if (strcmp(value, "fixed") == 0)
|
||||
conf->scrollback.indicator.style = SCROLLBACK_INDICATOR_STYLE_FIXED;
|
||||
conf->scrollback.indicator.position = SCROLLBACK_INDICATOR_POSITION_FIXED;
|
||||
else if (strcmp(value, "relative") == 0)
|
||||
conf->scrollback.indicator.style = SCROLLBACK_INDICATOR_STYLE_RELATIVE;
|
||||
conf->scrollback.indicator.position = SCROLLBACK_INDICATOR_POSITION_RELATIVE;
|
||||
else {
|
||||
LOG_ERR("%s:%d: scrollback-indicator-style must be one of "
|
||||
LOG_ERR("%s:%d: scrollback-indicator-position must be one of "
|
||||
"'none', 'fixed' or 'moving'",
|
||||
path, lineno);
|
||||
return false;
|
||||
|
|
@ -950,7 +950,7 @@ config_load(struct config *conf, const char *conf_path)
|
|||
.scrollback = {
|
||||
.lines = 1000,
|
||||
.indicator = {
|
||||
.style = SCROLLBACK_INDICATOR_STYLE_RELATIVE,
|
||||
.position = SCROLLBACK_INDICATOR_POSITION_RELATIVE,
|
||||
.format = SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
8
config.h
8
config.h
|
|
@ -44,10 +44,10 @@ struct config {
|
|||
|
||||
struct {
|
||||
enum {
|
||||
SCROLLBACK_INDICATOR_STYLE_NONE,
|
||||
SCROLLBACK_INDICATOR_STYLE_FIXED,
|
||||
SCROLLBACK_INDICATOR_STYLE_RELATIVE
|
||||
} style;
|
||||
SCROLLBACK_INDICATOR_POSITION_NONE,
|
||||
SCROLLBACK_INDICATOR_POSITION_FIXED,
|
||||
SCROLLBACK_INDICATOR_POSITION_RELATIVE
|
||||
} position;
|
||||
|
||||
enum {
|
||||
SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE,
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ in this order:
|
|||
*scrollback*
|
||||
Number of scrollback lines. Default: _1000_.
|
||||
|
||||
*scrollback-indicator-style*
|
||||
*scrollback-indicator-position*
|
||||
Configures the style of the scrollback position indicator. One of
|
||||
*none*, *fixed* or *relative*. *none* disables the indicator
|
||||
completely. *fixed* always renders the indicator near the top at
|
||||
|
|
@ -79,7 +79,7 @@ in this order:
|
|||
*scrollback-indicator-format*
|
||||
Which format to use when displaying the scrollback position
|
||||
indicator. Either _percentage_ or _line_. This option is ignored
|
||||
if *scrollback-indicator-style=none*. Default: _percentage_.
|
||||
if *scrollback-indicator-position=none*. Default: _percentage_.
|
||||
|
||||
*workers*
|
||||
Number of threads to use for rendering. Set to 0 to disable
|
||||
|
|
|
|||
2
footrc
2
footrc
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# font=monospace
|
||||
# scrollback=1000
|
||||
# scrollback-indicator-style=relative
|
||||
# scrollback-indicator-position=relative
|
||||
# scrollback-indicator-format=percentage
|
||||
# geometry=700x500
|
||||
# pad=2x2
|
||||
|
|
|
|||
10
render.c
10
render.c
|
|
@ -1290,7 +1290,7 @@ render_csd(struct terminal *term)
|
|||
static void
|
||||
render_scrollback_position(struct terminal *term)
|
||||
{
|
||||
if (term->conf->scrollback.indicator.style == SCROLLBACK_INDICATOR_STYLE_NONE)
|
||||
if (term->conf->scrollback.indicator.position == SCROLLBACK_INDICATOR_POSITION_NONE)
|
||||
return;
|
||||
|
||||
struct wayland *wayl = term->wl;
|
||||
|
|
@ -1414,16 +1414,16 @@ render_scrollback_position(struct terminal *term)
|
|||
|
||||
/* *Where* to render - parent relative coordinates */
|
||||
int surf_top = 0;
|
||||
switch (term->conf->scrollback.indicator.style) {
|
||||
case SCROLLBACK_INDICATOR_STYLE_NONE:
|
||||
switch (term->conf->scrollback.indicator.position) {
|
||||
case SCROLLBACK_INDICATOR_POSITION_NONE:
|
||||
assert(false);
|
||||
return;
|
||||
|
||||
case SCROLLBACK_INDICATOR_STYLE_FIXED:
|
||||
case SCROLLBACK_INDICATOR_POSITION_FIXED:
|
||||
surf_top = term->cell_height - margin;
|
||||
break;
|
||||
|
||||
case SCROLLBACK_INDICATOR_STYLE_RELATIVE: {
|
||||
case SCROLLBACK_INDICATOR_POSITION_RELATIVE: {
|
||||
int lines = term->rows - 3; /* Avoid using first and two last rows */
|
||||
assert(lines > 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue