From: Iain Patterson Date: Mon, 9 Mar 2009 17:40:06 +0000 (+0000) Subject: Cheesy dropshadow X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=53b2aae321aee06fb642d89f616123ea10f953b7;p=pager.git Cheesy dropshadow --- diff --git a/pager.c b/pager.c index e18a3d1..dc476c5 100644 --- a/pager.c +++ b/pager.c @@ -298,6 +298,25 @@ void release(int button, int state, int x, int y) { if (button == drag_button) drag_window = 0; } +void draw_window(Pixmap pixmap, GC gc, client_t *client) { + /* Draw a blob for the window. */ + XFillRectangle(DADisplay, pixmap, gc, client->rect.x, client->rect.y, client->rect.width, client->rect.height); + if (client->rect.width < 2 || client->rect.height < 2) return; + + /* Draw a border around the window. */ + XDrawLine(DADisplay, pixmap, window_border1GC, client->rect.x, client->rect.y, client->rect.x, client->rect.y + client->rect.height - 2); + XDrawLine(DADisplay, pixmap, window_border1GC, client->rect.x + 1, client->rect.y, client->rect.x + client->rect.width - 1, client->rect.y); + XDrawLine(DADisplay, pixmap, window_border2GC, client->rect.x, client->rect.y + client->rect.height - 1, client->rect.x + client->rect.width - 1, client->rect.y + client->rect.height - 1); + XDrawLine(DADisplay, pixmap, window_border2GC, client->rect.x + client->rect.width - 1, client->rect.y + 1, client->rect.x + client->rect.width - 1, client->rect.y + client->rect.height - 2); + + if (dockapp_attr.width <= DOCKAPP_SIZE * 2) return; + if (dockapp_attr.height <= DOCKAPP_SIZE * 2) return; + + /* Draw a drop shadow. */ + XDrawLine(DADisplay, pixmap, dockapp_border2GC, client->rect.x + 1, client->rect.y + client->rect.height, client->rect.x + client->rect.width, client->rect.y + client->rect.height); + XDrawLine(DADisplay, pixmap, dockapp_border2GC, client->rect.x + client->rect.width, client->rect.y + 1, client->rect.x + client->rect.width, client->rect.y + client->rect.height); +} + void page() { Window active_window; Pixmap pixmap; @@ -332,13 +351,7 @@ void page() { else if ((long) clients[i]->window == active_window) gc = active_windowGC; else gc = inactive_windowGC; - XFillRectangle(DADisplay, pixmap, gc, clients[i]->rect.x, clients[i]->rect.y, clients[i]->rect.width, clients[i]->rect.height); - if (clients[i]->rect.width < 2 || clients[i]->rect.height < 2) continue; - - XDrawLine(DADisplay, pixmap, window_border1GC, clients[i]->rect.x, clients[i]->rect.y, clients[i]->rect.x, clients[i]->rect.y + clients[i]->rect.height - 2); - XDrawLine(DADisplay, pixmap, window_border1GC, clients[i]->rect.x + 1, clients[i]->rect.y, clients[i]->rect.x + clients[i]->rect.width - 1, clients[i]->rect.y); - XDrawLine(DADisplay, pixmap, window_border2GC, clients[i]->rect.x, clients[i]->rect.y + clients[i]->rect.height - 1, clients[i]->rect.x + clients[i]->rect.width - 1, clients[i]->rect.y + clients[i]->rect.height - 1); - XDrawLine(DADisplay, pixmap, window_border2GC, clients[i]->rect.x + clients[i]->rect.width - 1, clients[i]->rect.y + 1, clients[i]->rect.x + clients[i]->rect.width - 1, clients[i]->rect.y + clients[i]->rect.height - 2); + draw_window(pixmap, gc, clients[i]); } destroy_clients(&clients, num_clients);