More accurate rendering of scroll bars. Issue #16

This commit is contained in:
Morgan Aldridge 2021-03-14 13:09:58 -04:00
parent c1c65d7a44
commit 817ec609b9
2 changed files with 33 additions and 9 deletions

View File

@ -649,6 +649,7 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
XGCValues xgcv;
XSetWindowAttributes attributes;
Cursor cursor;
GC fill, outline;
switch( context ){
case C_SBAR_UP:
@ -692,11 +693,19 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
if( t->flags&SCROLL && size<0 ) {
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, win, 1,
Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
DrawArrow( win, context, Scr.Gray3GC, Scr.BlackGC);
if( Scr.flags&SYSTEM8 )
fill = outline = Scr.BlackGC;
else {
fill = Scr.Gray3GC;
outline = Scr.BlackGC;
}
}
else{
DrawArrow( win, context, Scr.Gray4GC, Scr.Gray2GC);
fill = outline = Scr.Gray2GC;
if( !(Scr.flags&SYSTEM8) )
fill = Scr.Gray4GC;
}
DrawArrow( win, context, fill, outline);
}
else{
mask = GCForeground;

View File

@ -1248,7 +1248,10 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
anker = tmp_win->scroll_v[3];
}
if( pushd!=0 ){
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
XSync( dpy, 0 );
}
@ -1289,15 +1292,23 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
break;
case EnterNotify:
if( ev.xcrossing.window==pressedwin ){
if( !isSelect )
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
if( !isSelect ) {
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
}
isSelect = True;
}
break;
case LeaveNotify:
if( ev.xcrossing.window==pressedwin ){
if( isSelect )
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
if( isSelect ) {
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
}
isSelect = False;
}
break;
@ -1329,8 +1340,12 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
}
while( !isEnd );
if( pushd!=0 )
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
if( pushd!=0 ) {
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
}
XSync( dpy, 0 );
}