summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-11-18 01:07:34 +0000
committersabetts <sabetts>2006-11-18 01:07:34 +0000
commit8bcab4f3c98bb4a22389ab46224f727d6cbb0bdf (patch)
treecbe2d0eb93288af97986f389b9862367cebb5c0e /src
parent6c7e56dbc82d498d18f67108f436d678d57baaee (diff)
downloadratpoison-8bcab4f3c98bb4a22389ab46224f727d6cbb0bdf.zip
(bar_y): take into account screen padding
(bar_x): likewise
Diffstat (limited to 'src')
-rw-r--r--src/bar.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bar.c b/src/bar.c
index 769b3b7..01ecfcd 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -98,17 +98,17 @@ bar_x (rp_screen *s, int width)
case NorthWestGravity:
case WestGravity:
case SouthWestGravity:
- x = s->left;
+ x = s->left + defaults.padding_left;
break;
case NorthGravity:
case CenterGravity:
case SouthGravity:
- x = s->left + (s->width - width - defaults.bar_border_width * 2) / 2;
+ x = s->left + (s->width - width - defaults.bar_border_width * 2) / 2 - defaults.padding_right;
break;
case NorthEastGravity:
case EastGravity:
case SouthEastGravity:
- x = s->left + s->width - width - defaults.bar_border_width * 2;
+ x = s->left + s->width - width - defaults.bar_border_width * 2 - defaults.padding_right;
break;
}
@@ -125,19 +125,21 @@ bar_y (rp_screen *s, int height)
case NorthEastGravity:
case NorthGravity:
case NorthWestGravity:
- y = s->top;
+ y = s->top + defaults.padding_top;
break;
case EastGravity:
case CenterGravity:
case WestGravity:
y = s->top + (s->height - height
- - defaults.bar_border_width * 2) / 2;
+ - defaults.bar_border_width * 2) / 2
+ - defaults.padding_top;
break;
case SouthEastGravity:
case SouthGravity:
case SouthWestGravity:
y = s->top + (s->height - height
- - defaults.bar_border_width * 2);
+ - defaults.bar_border_width * 2)
+ - defaults.padding_top;
break;
}