[maemo-commits] [maemo-commits] r16432 - in projects/haf/trunk/hildon-theme-tools: . src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Oct 17 14:02:44 EEST 2008
- Previous message: [maemo-commits] r16431 - in projects/haf/trunk/hildon-thumbnail: . daemon thumbs
- Next message: [maemo-commits] r16433 - in projects/haf/trunk/hildon-fm: . doc hildon-fm tests
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: danielb Date: 2008-10-17 14:02:43 +0300 (Fri, 17 Oct 2008) New Revision: 16432 Modified: projects/haf/trunk/hildon-theme-tools/ChangeLog projects/haf/trunk/hildon-theme-tools/src/outliner.c Log: added border lines Modified: projects/haf/trunk/hildon-theme-tools/ChangeLog =================================================================== --- projects/haf/trunk/hildon-theme-tools/ChangeLog 2008-10-16 13:56:08 UTC (rev 16431) +++ projects/haf/trunk/hildon-theme-tools/ChangeLog 2008-10-17 11:02:43 UTC (rev 16432) @@ -1,3 +1,8 @@ +2008-10-17 Daniel Borgmann <danielb at openismus.com> + + * src/outliner.c: Implement border lines, as suggested by Tuomas + Kuosmanen. + 2008-10-16 Daniel Borgmann <danielb at openismus.com> * src/common.h: Modified: projects/haf/trunk/hildon-theme-tools/src/outliner.c =================================================================== --- projects/haf/trunk/hildon-theme-tools/src/outliner.c 2008-10-16 13:56:08 UTC (rev 16431) +++ projects/haf/trunk/hildon-theme-tools/src/outliner.c 2008-10-17 11:02:43 UTC (rev 16432) @@ -43,6 +43,8 @@ Element *element = (Element *) iterator->data; GdkPixbuf *image = NULL; GdkPixbuf *border_img = NULL; + GdkPixbuf *h_border_img = NULL; + GdkPixbuf *v_border_img = NULL; if (element->X > templ->Width || element->Y > templ->Height || @@ -64,33 +66,69 @@ else gdk_pixbuf_fill (image, 0x00bb00ff); + /* Create a black outline */ + /* TOP AND BOTTunOM */ + h_border_img = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, element->Width, 1); + gdk_pixbuf_fill (h_border_img, 0x000000ff); + gdk_pixbuf_copy_area (h_border_img, 0, 0, element->Width, 1, + image, 0, 0); + gdk_pixbuf_copy_area (h_border_img, 0, 0, element->Width, 1, + image, 0, element->Height - 1); + + /* LEFT AND RIGHT */ + v_border_img = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 1, element->Height); + gdk_pixbuf_fill (v_border_img, 0x000000ff); + gdk_pixbuf_copy_area (v_border_img, 0, 0, 1, element->Height, + image, 0, 0); + gdk_pixbuf_copy_area (v_border_img, 0, 0, 1, element->Height, + image, element->Width - 1, 0); + if (element->BorderTop > 0) { border_img = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, element->Width, element->BorderTop); - gdk_pixbuf_fill (border_img, 0xffffffff); + gdk_pixbuf_fill (border_img, 0x000000ff); gdk_pixbuf_composite (border_img, image, 0, 0, element->Width, element->BorderTop, - 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 32); + 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 26); + gdk_pixbuf_unref (border_img); + + gdk_pixbuf_copy_area (h_border_img, 0, 0, element->Width, 1, + image, 0, element->BorderTop - 1); } if (element->BorderBottom > 0) { border_img = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, element->Width, element->BorderBottom); - gdk_pixbuf_fill (border_img, 0xffffffff); + gdk_pixbuf_fill (border_img, 0x000000ff); gdk_pixbuf_composite (border_img, image, 0, element->Height - element->BorderBottom, element->Width, element->BorderBottom, - 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 32); + 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 26); + gdk_pixbuf_unref (border_img); + + gdk_pixbuf_copy_area (h_border_img, 0, 0, element->Width, 1, + image, 0, element->Height - element->BorderBottom); } - if (element->BorderLeft > 0) { + if (element->BorderLeft > 0) { border_img = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, element->BorderLeft, element->Height); - gdk_pixbuf_fill (border_img, 0xffffffff); + gdk_pixbuf_fill (border_img, 0x000000ff); gdk_pixbuf_composite (border_img, image, 0, 0, element->BorderLeft, element->Height, - 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 32); + 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 26); + gdk_pixbuf_unref (border_img); + + gdk_pixbuf_copy_area (v_border_img, 0, 0, 1, element->Height, + image, element->BorderLeft - 1, 0); } if (element->BorderRight > 0) { border_img = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, element->BorderRight, element->Height); - gdk_pixbuf_fill (border_img, 0xffffffff); + gdk_pixbuf_fill (border_img, 0x000000ff); gdk_pixbuf_composite (border_img, image, element->Width - element->BorderRight, 0, element->BorderRight, element->Height, - 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 32); + 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 26); + gdk_pixbuf_unref (border_img); + + gdk_pixbuf_copy_area (v_border_img, 0, 0, 1, element->Height, + image, element->Width - element->BorderRight, 0); } + + gdk_pixbuf_unref (h_border_img); + gdk_pixbuf_unref (v_border_img); } if (image != NULL) {
- Previous message: [maemo-commits] r16431 - in projects/haf/trunk/hildon-thumbnail: . daemon thumbs
- Next message: [maemo-commits] r16433 - in projects/haf/trunk/hildon-fm: . doc hildon-fm tests
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]