mirror of https://github.com/davatorium/rofi.git
Hopefully fix border with margin setting
This commit is contained in:
parent
495dfb4c20
commit
c96e95c766
|
@ -107,7 +107,7 @@ void widget_draw ( widget *widget, cairo_t *d )
|
||||||
cairo_paint( d ) ;
|
cairo_paint( d ) ;
|
||||||
|
|
||||||
// Set new x/y possition.
|
// Set new x/y possition.
|
||||||
cairo_translate ( d, widget->x, widget->y );
|
cairo_translate ( d, widget->x+margin_left, widget->y+margin_top );
|
||||||
|
|
||||||
int left = distance_get_pixel ( widget->border.left, ORIENTATION_HORIZONTAL );
|
int left = distance_get_pixel ( widget->border.left, ORIENTATION_HORIZONTAL );
|
||||||
int top = distance_get_pixel ( widget->border.top, ORIENTATION_HORIZONTAL );
|
int top = distance_get_pixel ( widget->border.top, ORIENTATION_HORIZONTAL );
|
||||||
|
@ -117,25 +117,32 @@ void widget_draw ( widget *widget, cairo_t *d )
|
||||||
if ( left > 0 ) {
|
if ( left > 0 ) {
|
||||||
cairo_set_line_width ( d, left );
|
cairo_set_line_width ( d, left );
|
||||||
cairo_move_to ( d, left/2.0, 0 );
|
cairo_move_to ( d, left/2.0, 0 );
|
||||||
cairo_line_to ( d, left/2.0, widget->h-margin_bottom);
|
cairo_line_to ( d, left/2.0, widget->h-margin_bottom-bottom-margin_top);
|
||||||
cairo_stroke ( d );
|
cairo_stroke ( d );
|
||||||
}
|
}
|
||||||
if ( right > 0 ) {
|
if ( right > 0 ) {
|
||||||
cairo_set_line_width ( d, right );
|
cairo_set_line_width ( d, right );
|
||||||
cairo_move_to ( d, widget->w -right/2.0, 0 );
|
cairo_move_to ( d,
|
||||||
cairo_line_to ( d, widget->w -right/2.0, widget->h );
|
widget->w - margin_right -margin_left- right/2.0, 0 );
|
||||||
|
cairo_line_to ( d,
|
||||||
|
widget->w - margin_right -margin_left- right/2.0,
|
||||||
|
widget->h-margin_bottom-bottom-margin_top );
|
||||||
cairo_stroke ( d );
|
cairo_stroke ( d );
|
||||||
}
|
}
|
||||||
if ( top > 0 ) {
|
if ( top > 0 ) {
|
||||||
cairo_set_line_width ( d, top );
|
cairo_set_line_width ( d, top );
|
||||||
cairo_move_to ( d, 0, top/2.0 );
|
cairo_move_to ( d, 0, top/2.0 );
|
||||||
cairo_line_to ( d, widget->w, top/2.0 );
|
cairo_line_to ( d, widget->w-margin_right-margin_left-right, top/2.0 );
|
||||||
cairo_stroke ( d );
|
cairo_stroke ( d );
|
||||||
}
|
}
|
||||||
if ( bottom > 0 ) {
|
if ( bottom > 0 ) {
|
||||||
cairo_set_line_width ( d, bottom );
|
cairo_set_line_width ( d, bottom );
|
||||||
cairo_move_to ( d, 0, widget->h-bottom/2.0);
|
cairo_move_to ( d,
|
||||||
cairo_line_to ( d, widget->w, widget->h-bottom/2.0);
|
0,
|
||||||
|
widget->h-bottom/2.0-margin_bottom-margin_top);
|
||||||
|
cairo_line_to ( d,
|
||||||
|
widget->w-margin_right-margin_left-right,
|
||||||
|
widget->h-bottom/2.0-margin_bottom-margin_top);
|
||||||
cairo_stroke ( d );
|
cairo_stroke ( d );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue