diff options
author | phil9 <telephil9@gmail.com> | 2022-04-06 16:46:58 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2022-04-06 16:46:58 +0000 |
commit | 63f8dc808490ef038ce868eba62983290e38489d (patch) | |
tree | 06b050b7a993a3e89fca82b205652261c7117078 /sys/src/cmd/mothra/libpanel/scrollbar.c | |
parent | aba0c7fceac419c426da85b3f5d4bfe82d410e00 (diff) |
mothra: make scrollbar style consistent with other applications
Scrollbar was drawn using a wide dark gutter over a white background
whereas other applications (window, sam, ...) use a thinner scrollbar with an
inverse colorscheme.
This makes the scrollbar more consistent with other 9front applications.
Diffstat (limited to 'sys/src/cmd/mothra/libpanel/scrollbar.c')
-rw-r--r-- | sys/src/cmd/mothra/libpanel/scrollbar.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/src/cmd/mothra/libpanel/scrollbar.c b/sys/src/cmd/mothra/libpanel/scrollbar.c index 18daaf43a..d36fa4f1e 100644 --- a/sys/src/cmd/mothra/libpanel/scrollbar.c +++ b/sys/src/cmd/mothra/libpanel/scrollbar.c @@ -12,12 +12,12 @@ struct Scrollbar{ Rectangle interior; Point minsize; }; -#define SBWID 15 /* should come from draw.c? */ +#define SBWID 8 /* should come from draw.c? */ void pl_drawscrollbar(Panel *p){ Scrollbar *sp; sp=p->data; sp->interior=pl_outline(p->b, p->r, SUP); /* SUP was p->state */ - pl_sliderupd(p->b, sp->interior, sp->dir, sp->lo, sp->hi); + pl_scrollupd(p->b, sp->interior, sp->lo, sp->hi); } int pl_hitscrollbar(Panel *g, Mouse *m){ int oldstate, pos, len, dy; @@ -49,8 +49,7 @@ int pl_hitscrollbar(Panel *g, Mouse *m){ switch(m->buttons){ case 1: dy=pos*(sp->hi-sp->lo)/len; - pl_sliderupd(g->b, sp->interior, sp->dir, sp->lo-dy, - sp->hi-dy); + pl_scrollupd(g->b, sp->interior, sp->lo-dy, sp->hi-dy); break; case 2: if(g->scrollee && g->scrollee->scroll) @@ -59,8 +58,7 @@ int pl_hitscrollbar(Panel *g, Mouse *m){ break; case 4: dy=pos*(sp->hi-sp->lo)/len; - pl_sliderupd(g->b, sp->interior, sp->dir, sp->lo+dy, - sp->hi+dy); + pl_scrollupd(g->b, sp->interior, sp->lo+dy, sp->hi+dy); break; } } @@ -94,7 +92,6 @@ void pl_setscrollbarscrollbar(Panel *p, int lo, int hi, int len){ sp=p->data; ul=p->r.min; size=subpt(p->r.max, p->r.min); - pl_interior(p->state, &ul, &size); mylen=sp->dir==HORIZ?size.x:size.y; if(len==0) len=1; sp->lo=lo*mylen/len; |