add simplewindow_move() function and use it for statusbar
This commit is contained in:
parent
c1569eedf4
commit
aeee10ea18
13
statusbar.c
13
statusbar.c
|
@ -51,20 +51,17 @@ statusbar_update_position(Statusbar *statusbar)
|
|||
switch(statusbar->position)
|
||||
{
|
||||
case Top:
|
||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
||||
area.x, area.y);
|
||||
simplewindow_move(statusbar->sw, area.x, area.y);
|
||||
break;
|
||||
case Bottom:
|
||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
||||
area.x, area.height - statusbar->height);
|
||||
simplewindow_move(statusbar->sw, area.x, area.height - statusbar->sw->geometry.height);
|
||||
break;
|
||||
case Left:
|
||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
||||
area.x - statusbar->height, (area.y + area.height) - statusbar->width);
|
||||
simplewindow_move(statusbar->sw, area.x - statusbar->sw->geometry.height,
|
||||
(area.y + area.height) - statusbar->sw->geometry.width);
|
||||
break;
|
||||
case Right:
|
||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
||||
area.x + area.width, area.y);
|
||||
simplewindow_move(statusbar->sw, area.x + area.width, area.y);
|
||||
break;
|
||||
case Off:
|
||||
XUnmapWindow(globalconf.display, statusbar->sw->window);
|
||||
|
|
8
window.c
8
window.c
|
@ -227,4 +227,12 @@ simplewindow_delete(SimpleWindow *sw)
|
|||
p_delete(&sw);
|
||||
}
|
||||
|
||||
int
|
||||
simplewindow_move(SimpleWindow *sw, int x, int y)
|
||||
{
|
||||
sw->geometry.x = x;
|
||||
sw->geometry.y = y;
|
||||
XMoveWindow(globalconf.display, sw->window, x, y);
|
||||
}
|
||||
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||
|
|
1
window.h
1
window.h
|
@ -32,6 +32,7 @@ void window_setshape(int, Window);
|
|||
int window_settrans(Window, double);
|
||||
SimpleWindow * simplewindow_new(int, int, int, unsigned int, unsigned int, unsigned int);
|
||||
void simplewindow_delete(SimpleWindow *);
|
||||
int simplewindow_move(SimpleWindow *, int, int);
|
||||
|
||||
#endif
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue