summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-09-13 21:24:52 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-09-13 21:31:39 -0400
commitbc930c3f3abebf22ef14ff2ede08f382e29de7a6 (patch)
treebc0ea8d766bc17f7312689ac14fb1cbbadf957b9
parent98dc8bbb95251632cac14c43751f68b4d5474704 (diff)
greeter: A bit of silly eye candy
-rw-r--r--clients/greeter.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/clients/greeter.c b/clients/greeter.c
index 19fda238..f74c3c90 100644
--- a/clients/greeter.c
+++ b/clients/greeter.c
@@ -58,6 +58,7 @@ struct greeter_item {
int x, y, width, height;
int pressed;
const char *name;
+ const char *quote;
const char *username;
};
@@ -122,6 +123,15 @@ greeter_draw_item(struct greeter *greeter,
cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
cairo_move_to(cr, x + item_height + padding, y + item_height / 2);
cairo_show_text(cr, item->name);
+
+ cairo_select_font_face(cr, "Ubuntu",
+ CAIRO_FONT_SLANT_ITALIC,
+ CAIRO_FONT_WEIGHT_NORMAL);
+ cairo_set_font_size (cr, 12);
+
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+ cairo_move_to(cr, x + item_height + padding, y + item_height / 2 + 20);
+ cairo_show_text(cr, item->quote);
}
static void
@@ -277,7 +287,7 @@ greeter_set_background_image(struct greeter *greeter, const char *path)
static void
greeter_add_item(struct greeter *greeter, const char *icon,
- const char *name, const char *username)
+ const char *name, const char *quote, const char *username)
{
struct greeter_item *item;
cairo_surface_t *image;
@@ -300,6 +310,7 @@ greeter_add_item(struct greeter *greeter, const char *icon,
cairo_pattern_set_matrix(item->icon, &matrix);
item->name = strdup(name);
+ item->quote = strdup(quote);
item->username = strdup(username);
wl_list_insert(greeter->item_list.prev, &item->link);
}
@@ -332,23 +343,27 @@ greeter_allocate(struct greeter *greeter, int width, int height)
static const struct {
const char *icon;
const char *name;
+ const char *quote;
const char *username;
} users[] = {
{
"data/leon-kowalsky.png",
"Leon Kowalsky",
+ "\"Let me tell you about my mother.\"",
"leonk"
},
{
"data/roy-batty.png",
"Roy Batty",
+ "\"Gosh, you've... really got some nice toys here.\"",
"batty"
},
{
"data/rick-deckard.png",
"Rick Deckard",
+ "\"I made a bad joke. You're not a replicant.\"",
"rick"
},
};
@@ -370,7 +385,9 @@ int main(int argc, char *argv[])
for (i = 0; i < ARRAY_LENGTH(users); i++)
greeter_add_item(greeter, users[i].icon,
- users[i].name, users[i].username);
+ users[i].name,
+ users[i].quote,
+ users[i].username);
display_get_screen_allocation(display, &allocation);
greeter_allocate(greeter, allocation.width, allocation.height);