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)
|
switch(statusbar->position)
|
||||||
{
|
{
|
||||||
case Top:
|
case Top:
|
||||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
simplewindow_move(statusbar->sw, area.x, area.y);
|
||||||
area.x, area.y);
|
|
||||||
break;
|
break;
|
||||||
case Bottom:
|
case Bottom:
|
||||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
simplewindow_move(statusbar->sw, area.x, area.height - statusbar->sw->geometry.height);
|
||||||
area.x, area.height - statusbar->height);
|
|
||||||
break;
|
break;
|
||||||
case Left:
|
case Left:
|
||||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
simplewindow_move(statusbar->sw, area.x - statusbar->sw->geometry.height,
|
||||||
area.x - statusbar->height, (area.y + area.height) - statusbar->width);
|
(area.y + area.height) - statusbar->sw->geometry.width);
|
||||||
break;
|
break;
|
||||||
case Right:
|
case Right:
|
||||||
XMoveWindow(globalconf.display, statusbar->sw->window,
|
simplewindow_move(statusbar->sw, area.x + area.width, area.y);
|
||||||
area.x + area.width, area.y);
|
|
||||||
break;
|
break;
|
||||||
case Off:
|
case Off:
|
||||||
XUnmapWindow(globalconf.display, statusbar->sw->window);
|
XUnmapWindow(globalconf.display, statusbar->sw->window);
|
||||||
|
|
8
window.c
8
window.c
|
@ -227,4 +227,12 @@ simplewindow_delete(SimpleWindow *sw)
|
||||||
p_delete(&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
|
// 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);
|
int window_settrans(Window, double);
|
||||||
SimpleWindow * simplewindow_new(int, int, int, unsigned int, unsigned int, unsigned int);
|
SimpleWindow * simplewindow_new(int, int, int, unsigned int, unsigned int, unsigned int);
|
||||||
void simplewindow_delete(SimpleWindow *);
|
void simplewindow_delete(SimpleWindow *);
|
||||||
|
int simplewindow_move(SimpleWindow *, int, int);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue