mirror of
https://github.com/davatorium/rofi.git
synced 2025-02-10 15:44:41 -05:00
Allow dragging scrollbar.
This commit is contained in:
parent
6a8a367cbd
commit
ae043d5246
2 changed files with 9 additions and 1 deletions
|
@ -1190,6 +1190,14 @@ MenuReturn menu ( Switcher *sw, char **input, char *prompt,
|
||||||
}
|
}
|
||||||
state.update = TRUE;
|
state.update = TRUE;
|
||||||
}
|
}
|
||||||
|
else if ( ev.type == MotionNotify ) {
|
||||||
|
while ( XCheckTypedEvent ( display, MotionNotify, &ev ) ) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
XMotionEvent xme = ev.xmotion;
|
||||||
|
state.selected = scrollbar_clicked ( state.scrollbar, xme.y );
|
||||||
|
state.update = TRUE;
|
||||||
|
}
|
||||||
// Button press event.
|
// Button press event.
|
||||||
else if ( ev.type == ButtonPress ) {
|
else if ( ev.type == ButtonPress ) {
|
||||||
while ( XCheckTypedEvent ( display, ButtonPress, &ev ) ) {
|
while ( XCheckTypedEvent ( display, ButtonPress, &ev ) ) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ scrollbar *scrollbar_create ( Window parent, XVisualInfo *vinfo, Colormap map,
|
||||||
sb->window = XCreateWindow ( display, sb->parent, sb->x, sb->y, sb->w, sb->h, 0, vinfo->depth,
|
sb->window = XCreateWindow ( display, sb->parent, sb->x, sb->y, sb->w, sb->h, 0, vinfo->depth,
|
||||||
InputOutput, vinfo->visual, CWColormap | CWBorderPixel | CWBackPixel, &attr );
|
InputOutput, vinfo->visual, CWColormap | CWBorderPixel | CWBackPixel, &attr );
|
||||||
|
|
||||||
XSelectInput ( display, sb->window, ExposureMask | ButtonPressMask );
|
XSelectInput ( display, sb->window, ExposureMask | ButtonPressMask | Button1MotionMask );
|
||||||
sb->gc = XCreateGC ( display, sb->window, 0, 0 );
|
sb->gc = XCreateGC ( display, sb->window, 0, 0 );
|
||||||
XSetForeground ( display, sb->gc, color_separator ( display ) );
|
XSetForeground ( display, sb->gc, color_separator ( display ) );
|
||||||
//XSetFillStyle ( display, sb->gc, FillSolid);
|
//XSetFillStyle ( display, sb->gc, FillSolid);
|
||||||
|
|
Loading…
Add table
Reference in a new issue