summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2024-11-15 13:12:21 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2024-11-15 13:12:21 +0000
commitae58853c01a2c1ba5f25057625b07899fb2645e7 (patch)
tree8afe016bbff385b3ea46f1ebb8be3d46449ff480 /usr.bin/tmux/window.c
parent3989fb3ccf3fa91bf09d92e8e7e721d5454f5264 (diff)
Add two new style parameters, width and pad, which apply to scrollbars.
From Michael Grant, GitHub issue 4241.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index f30a30ffd91..0a840366219 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.297 2024/11/15 09:01:16 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.298 2024/11/15 13:12:20 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -596,9 +596,10 @@ window_get_active_at(struct window *w, u_int x, u_int y)
if (pane_scrollbars == PANE_SCROLLBARS_ALWAYS ||
(pane_scrollbars == PANE_SCROLLBARS_MODAL &&
- window_pane_mode(wp) != WINDOW_PANE_NO_MODE))
- sb_w = PANE_SCROLLBARS_WIDTH;
- else
+ window_pane_mode(wp) != WINDOW_PANE_NO_MODE)) {
+ sb_w = wp->scrollbar_style.width +
+ wp->scrollbar_style.pad;
+ } else
sb_w = 0;
if (sb_pos == PANE_SCROLLBARS_LEFT) {
@@ -961,6 +962,9 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->control_bg = -1;
wp->control_fg = -1;
+ style_set_scrollbar_style_from_option(&wp->scrollbar_style,
+ wp->options);
+
colour_palette_init(&wp->palette);
colour_palette_from_option(&wp->palette, wp->options);