Add two new style parameters, width and pad, which apply to scrollbars.

From Michael Grant, GitHub issue 4241.
This commit is contained in:
nicm
2024-11-15 13:12:20 +00:00
parent d6883c0266
commit 350a151ee4
9 changed files with 166 additions and 61 deletions

18
tmux.h
View File

@ -863,6 +863,10 @@ struct style_range {
};
TAILQ_HEAD(style_ranges, style_range);
/* Default style width and pad. */
#define STYLE_WIDTH_DEFAULT -1
#define STYLE_PAD_DEFAULT -1
/* Style default. */
enum style_default_type {
STYLE_DEFAULT_BASE,
@ -883,6 +887,9 @@ struct style {
u_int range_argument;
char range_string[16];
int width;
int pad;
enum style_default_type default_type;
};
@ -1164,6 +1171,8 @@ struct window_pane {
int control_bg;
int control_fg;
struct style scrollbar_style;
TAILQ_ENTRY(window_pane) entry; /* link in list of all panes */
TAILQ_ENTRY(window_pane) sentry; /* link in list of last visited */
RB_ENTRY(window_pane) tree_entry;
@ -1268,9 +1277,10 @@ TAILQ_HEAD(winlink_stack, winlink);
#define PANE_SCROLLBARS_RIGHT 0
#define PANE_SCROLLBARS_LEFT 1
/* Pane scrollbars width and padding. */
#define PANE_SCROLLBARS_WIDTH 1
#define PANE_SCROLLBARS_PADDING 0
/* Pane scrollbars width, padding and fill character. */
#define PANE_SCROLLBARS_DEFAULT_PADDING 0
#define PANE_SCROLLBARS_DEFAULT_WIDTH 1
#define PANE_SCROLLBARS_CHARACTER ' '
/* True if screen in alternate screen. */
#define SCREEN_IS_ALTERNATE(s) ((s)->saved_grid != NULL)
@ -3469,6 +3479,8 @@ void style_apply(struct grid_cell *, struct options *,
const char *, struct format_tree *);
void style_set(struct style *, const struct grid_cell *);
void style_copy(struct style *, struct style *);
void style_set_scrollbar_style_from_option(struct style *,
struct options *);
/* spawn.c */
struct winlink *spawn_window(struct spawn_context *, char **);