Added System6 configuration setting and first pass at forcing monochrome styling. Issue #18

This commit is contained in:
Morgan Aldridge 2021-03-21 16:28:17 -04:00
parent 708a30f602
commit 1d99100814
5 changed files with 32 additions and 18 deletions

View File

@ -489,7 +489,7 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
if( on_off ){ if( on_off ){
for( lp=4; lp<16; lp+=2 ){ for( lp=4; lp<16; lp+=2 ){
if( Scr.d_depth>1 ){ if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ){
if( Scr.flags&SYSTEM8 ) if( Scr.flags&SYSTEM8 )
DrawShadowBox( 4, lp-1, t->frame_w-14, 2, t->title_w, 1, DrawShadowBox( 4, lp-1, t->frame_w-14, 2, t->title_w, 1,
Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL ); Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL );
@ -515,7 +515,7 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
dispgc = Scr.BlackGC; dispgc = Scr.BlackGC;
} }
else{ else{
if( Scr.d_depth>1 ) dispgc = Scr.Gray3GC; if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) dispgc = Scr.Gray3GC;
else dispgc = Scr.BlackGC; else dispgc = Scr.BlackGC;
} }
if( t->flags&CLOSER ) DrawCloseBox( t, on_off ); if( t->flags&CLOSER ) DrawCloseBox( t, on_off );
@ -524,7 +524,7 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
XDRAWSTRING( dpy, t->title_w, WINDOWFONT, dispgc, (t->frame_w-w)/2, XDRAWSTRING( dpy, t->title_w, WINDOWFONT, dispgc, (t->frame_w-w)/2,
TITLE_HEIGHT/2-offset, t->name, titlelength ); TITLE_HEIGHT/2-offset, t->name, titlelength );
if( Scr.d_depth<2 && !on_off ){ if( (Scr.d_depth<2 || Scr.flags&SYSTEM6) && !on_off ){
xgcv.function = GXor; xgcv.function = GXor;
mask = GCFunction; mask = GCFunction;
XChangeGC( dpy, Scr.BlackGC, mask, &xgcv ); XChangeGC( dpy, Scr.BlackGC, mask, &xgcv );
@ -761,7 +761,7 @@ void DrawSbarBar( MlvwmWindow *t, int context, Bool on_off )
if( on_off ){ if( on_off ){
if( t->flags&SCROLL && size<0 ){ if( t->flags&SCROLL && size<0 ){
if( Scr.flags&SYSTEM8 ){ if( Scr.flags&SYSTEM8 && !(Scr.flags&SYSTEM6) ){
Pixmap bgpix; Pixmap bgpix;
bgpix = XCreatePixmap( dpy, Scr.Root, width_f, bgpix = XCreatePixmap( dpy, Scr.Root, width_f,
height_f, Scr.d_depth ); height_f, Scr.d_depth );

View File

@ -478,6 +478,16 @@ void SetMenuFlush( char *line, FILE *fp )
Scr.flush_time *= 1000; Scr.flush_time *= 1000;
} }
void SetSystem6( char *line, FILE *fp )
{
if( Scr.d_depth<2)
DrawErrMsgOnMenu( "Option is assumed ", "System6" );
else if( Scr.flags&SYSTEM8 )
DrawErrMsgOnMenu( "Option cannot be used with System8 ", "System6" );
else
Scr.flags |= SYSTEM6;
}
void SetSystem8( char *line, FILE *fp ) void SetSystem8( char *line, FILE *fp )
{ {
XGCValues gcv; XGCValues gcv;
@ -486,6 +496,8 @@ void SetSystem8( char *line, FILE *fp )
if( Scr.d_depth<2 ) if( Scr.d_depth<2 )
DrawErrMsgOnMenu( "Can't use option ", "System8" ); DrawErrMsgOnMenu( "Can't use option ", "System8" );
else if( Scr.flags&SYSTEM6 )
DrawErrMsgOnMenu( "Option cannot be used with System6 ", "System8" );
else{ else{
Scr.flags |= SYSTEM8; Scr.flags |= SYSTEM8;
gcm = GCForeground; gcm = GCForeground;
@ -748,6 +760,7 @@ config_func main_config[]={
{ "StickyHide", SetStickyHide }, { "StickyHide", SetStickyHide },
{ "Style", SetStyles }, { "Style", SetStyles },
{ "Swallow", SetSwallow }, { "Swallow", SetSwallow },
{ "System6", SetSystem6 },
{ "System8", SetSystem8 }, { "System8", SetSystem8 },
{ "OpaqueMove", SetOpaqueMove }, { "OpaqueMove", SetOpaqueMove },
{ "OpaqueResize", SetOpaqueResize }, { "OpaqueResize", SetOpaqueResize },

View File

@ -68,7 +68,7 @@ void RedrawMenu( MenuLabel *m, Bool onoroff )
tmp_f_GC = Scr.BlackGC; tmp_f_GC = Scr.BlackGC;
tmp_b_GC = Scr.WhiteGC; tmp_b_GC = Scr.WhiteGC;
} }
if( !(m->flags&ACTIVE) && Scr.d_depth>1 ) if( !(m->flags&ACTIVE) && Scr.d_depth>1 && !(Scr.flags&SYSTEM6) )
tmp_f_GC = Scr.Gray3GC; tmp_f_GC = Scr.Gray3GC;
if( !m->xpm ){ if( !m->xpm ){
if( m->LabelStr ){ if( m->LabelStr ){
@ -77,7 +77,7 @@ void RedrawMenu( MenuLabel *m, Bool onoroff )
(MENUB_H-2)/2-offset, (MENUB_H-2)/2-offset,
m->LabelStr, strlen(m->LabelStr) ); m->LabelStr, strlen(m->LabelStr) );
/* Mask String for Mono Display */ /* Mask String for Mono Display */
if( !(m->flags&ACTIVE) && Scr.d_depth<2 ){ if( !(m->flags&ACTIVE) && (Scr.d_depth<2 || Scr.flags&SYSTEM6) ){
if( onoroff ) gcv.function = GXand; if( onoroff ) gcv.function = GXand;
else gcv.function = GXor; else gcv.function = GXor;
gcm = GCFunction; gcm = GCFunction;
@ -225,7 +225,7 @@ MenuLabel *DrawMenuItem( MenuLabel *ml, int sel, Bool on )
s_tmpGC = Scr.BlackGC; s_tmpGC = Scr.BlackGC;
} }
if( mi->mode&STRGRAY && Scr.d_depth>2 ) if( mi->mode&STRGRAY && Scr.d_depth>2 && !(Scr.flags&SYSTEM6) )
s_tmpGC = Scr.Gray3GC; s_tmpGC = Scr.Gray3GC;
XFillRectangle( dpy, ml->PullWin, r_tmpGC, XFillRectangle( dpy, ml->PullWin, r_tmpGC,
0+(Scr.flags&SYSTEM8?1:0), top_y, 0+(Scr.flags&SYSTEM8?1:0), top_y,
@ -283,7 +283,7 @@ MenuLabel *DrawMenuItem( MenuLabel *ml, int sel, Bool on )
top_y+ml->ItemHeight/2-offset, top_y+ml->ItemHeight/2-offset,
mi->label, strlen(mi->label) ); mi->label, strlen(mi->label) );
/* Mask String for Mono Display */ /* Mask String for Mono Display */
if( mi->mode&STRGRAY && Scr.d_depth<2 ){ if( mi->mode&STRGRAY && (Scr.d_depth<2 || Scr.flags&SYSTEM6) ){
if( on ) gcv.function = GXand; if( on ) gcv.function = GXand;
else gcv.function = GXor; else gcv.function = GXor;
gcm = GCFunction; gcm = GCFunction;
@ -297,7 +297,7 @@ MenuLabel *DrawMenuItem( MenuLabel *ml, int sel, Bool on )
} }
} }
if( mi->label && mi->label[0]=='\0' ){ if( mi->label && mi->label[0]=='\0' ){
if( Scr.d_depth>1 ){ if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ){
if( Scr.flags&SYSTEM8 ){ if( Scr.flags&SYSTEM8 ){
XDrawLine( dpy, ml->PullWin, Scr.Gray2GC, XDrawLine( dpy, ml->PullWin, Scr.Gray2GC,
2, top_y+ml->ItemHeight/2, 2, top_y+ml->ItemHeight/2,

View File

@ -213,7 +213,7 @@ void InitGCs( void )
gcv.subwindow_mode = IncludeInferiors; gcv.subwindow_mode = IncludeInferiors;
gcv.line_width = 1; gcv.line_width = 1;
if( Scr.d_depth>1 ) if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) )
gcv.foreground = GetColor( "#777777" ); gcv.foreground = GetColor( "#777777" );
else else
gcv.foreground = WhitePixel( dpy, Scr.screen ); gcv.foreground = WhitePixel( dpy, Scr.screen );
@ -236,32 +236,32 @@ void InitGCs( void )
gcv.background = BlackPixel( dpy, Scr.screen ); gcv.background = BlackPixel( dpy, Scr.screen );
Scr.WhiteGC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.WhiteGC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#444444" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#444444" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.Gray1GC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.Gray1GC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#777777" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#777777" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.Gray2GC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.Gray2GC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#bbbbbb" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#bbbbbb" );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#aaaaaa" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#aaaaaa" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.Gray3GC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.Gray3GC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#e0e0e0" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#e0e0e0" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.Gray4GC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.Gray4GC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#3333ff" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#3333ff" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.MenuSelectBlueGC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.MenuSelectBlueGC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#dddddd" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#dddddd" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.MenuBlueGC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.MenuBlueGC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
if( Scr.d_depth>1 ) gcv.foreground = GetColor( "#ccccff" ); if( Scr.d_depth>1 && !(Scr.flags&SYSTEM6) ) gcv.foreground = GetColor( "#ccccff" );
gcv.background = WhitePixel( dpy, Scr.screen ); gcv.background = WhitePixel( dpy, Scr.screen );
Scr.ScrollBlueGC = XCreateGC( dpy, Scr.Root, gcm, &gcv ); Scr.ScrollBlueGC = XCreateGC( dpy, Scr.Root, gcm, &gcv );
} }

View File

@ -142,6 +142,7 @@ typedef struct ScreenInfo
#define ONECLICKMENU 0x00010000 #define ONECLICKMENU 0x00010000
#define DEBUGOUT 0x00020000 #define DEBUGOUT 0x00020000
#define ROUNDEDCORNERS 0x00040000 #define ROUNDEDCORNERS 0x00040000
#define SYSTEM6 0x00080000
#ifdef USE_LOCALE #ifdef USE_LOCALE
#define MENUBARFONT Scr.MenuBarFs #define MENUBARFONT Scr.MenuBarFs