summaryrefslogtreecommitdiffstats
path: root/source/scrollbar.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2015-09-17 17:32:51 +0200
committerDave Davenport <qball@gmpclient.org>2015-09-17 17:32:51 +0200
commit4c970fe4da46b2b463a59acdb4ec807cf83c61c4 (patch)
treef07824a93a3b32e6557700be14b5bacdd45f8c6c /source/scrollbar.c
parent558bb3863059d353f8a106979360a66c91325bdb (diff)
Properly resize content when window is resized.
Diffstat (limited to 'source/scrollbar.c')
-rw-r--r--source/scrollbar.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/scrollbar.c b/source/scrollbar.c
index 24660985..3396af72 100644
--- a/source/scrollbar.c
+++ b/source/scrollbar.c
@@ -131,6 +131,18 @@ void scrollbar_draw ( scrollbar *sb )
XFillRectangle ( display, sb->window, sb->gc, config.line_margin, y, sb->w - config.line_margin, height );
}
}
+void scrollbar_resize ( scrollbar *sb, int w, int h )
+{
+ if ( sb != NULL ) {
+ if(h > 0 ) {
+ sb->h = h;
+ }
+ if(w > 0 ) {
+ sb->w = w;
+ }
+ XResizeWindow ( display, sb->window, sb->w, sb->h );
+ }
+}
unsigned int scrollbar_clicked ( scrollbar *sb, int y )
{