@ -153,11 +153,11 @@ static uint32_t render_status_block(cairo_t *cairo,
}
}
* x - = width ;
* x - = width ;
if ( block - > border & & block - > border_left > 0 ) {
if ( ( block - > border | | block - > urgent ) & & block - > border_left > 0 ) {
* x - = ( block - > border_left + margin ) ;
* x - = ( block - > border_left + margin ) ;
block_width + = block - > border_left + margin ;
block_width + = block - > border_left + margin ;
}
}
if ( block - > border & & block - > border_right > 0 ) {
if ( ( block - > border | | block - > urgent ) & & block - > border_right > 0 ) {
* x - = ( block - > border_right + margin ) ;
* x - = ( block - > border_right + margin ) ;
block_width + = block - > border_right + margin ;
block_width + = block - > border_right + margin ;
}
}
@ -196,29 +196,38 @@ static uint32_t render_status_block(cairo_t *cairo,
}
}
double pos = * x ;
double pos = * x ;
if ( block - > background ) {
cairo_set_source_u32 ( cairo , block - > background ) ;
uint32_t bg_color = block - > urgent
? config - > colors . urgent_workspace . background : block - > background ;
if ( bg_color ) {
cairo_set_source_u32 ( cairo , bg_color ) ;
cairo_rectangle ( cairo , pos - 0.5 * output - > scale ,
cairo_rectangle ( cairo , pos - 0.5 * output - > scale ,
output - > scale , width , height ) ;
output - > scale , width , height ) ;
cairo_fill ( cairo ) ;
cairo_fill ( cairo ) ;
}
}
if ( block - > border & & block - > border_top > 0 ) {
uint32_t border_color = block - > urgent
render_sharp_line ( cairo , block - > border ,
? config - > colors . urgent_workspace . border : block - > border ;
if ( border_color & & block - > border_top > 0 ) {
render_sharp_line ( cairo , border_color ,
pos - 0.5 * output - > scale , output - > scale ,
pos - 0.5 * output - > scale , output - > scale ,
block_width , block - > border_top ) ;
text _width, block - > border_top ) ;
}
}
if ( b lock- > b order & & block - > border_bottom > 0 ) {
if ( b order_colo r & & block - > border_bottom > 0 ) {
render_sharp_line ( cairo , b lock- > b order,
render_sharp_line ( cairo , b order_colo r,
pos - 0.5 * output - > scale ,
pos - 0.5 * output - > scale ,
height - output - > scale - block - > border_bottom ,
height - output - > scale - block - > border_bottom ,
block _width, block - > border_bottom ) ;
text _width, block - > border_bottom ) ;
}
}
if ( b lock- > b order ! = 0 & & block - > border_left > 0 ) {
if ( b order_colo r ! = 0 & & block - > border_left > 0 ) {
render_sharp_line ( cairo , b lock- > b order,
render_sharp_line ( cairo , b order_colo r,
pos - 0.5 * output - > scale , output - > scale ,
pos - 0.5 * output - > scale , output - > scale ,
block - > border_left , height ) ;
block - > border_left , height ) ;
pos + = block - > border_left + margin ;
}
if ( border_color ! = 0 & & block - > border_right > 0 ) {
render_sharp_line ( cairo , border_color ,
pos - 0.5 * output - > scale + text_width , output - > scale ,
block - > border_right , height ) ;
}
}
double offset = 0 ;
double offset = 0 ;
@ -231,6 +240,7 @@ static uint32_t render_status_block(cairo_t *cairo,
}
}
cairo_move_to ( cairo , offset , height / 2.0 - text_height / 2.0 ) ;
cairo_move_to ( cairo , offset , height / 2.0 - text_height / 2.0 ) ;
uint32_t color = block - > color ? * block - > color : config - > colors . statusline ;
uint32_t color = block - > color ? * block - > color : config - > colors . statusline ;
color = block - > urgent ? config - > colors . urgent_workspace . text : color ;
cairo_set_source_u32 ( cairo , color ) ;
cairo_set_source_u32 ( cairo , color ) ;
pango_printf ( cairo , config - > font , output - > scale ,
pango_printf ( cairo , config - > font , output - > scale ,
block - > markup , " %s " , block - > full_text ) ;
block - > markup , " %s " , block - > full_text ) ;