summaryrefslogtreecommitdiffstats
path: root/friendfinder/gui.c
diff options
context:
space:
mode:
authorPatrick Hornecker2010-02-05 12:10:24 +0100
committerPatrick Hornecker2010-02-05 12:10:24 +0100
commit946bec656d8219eaa2db9b31a36db8f9d3a87f88 (patch)
treec5bd6994e086b56baa3216f475f54d389a8fcda4 /friendfinder/gui.c
parentbarcode working with libpng version < 1.2.42 (diff)
downloadfriendfinder-946bec656d8219eaa2db9b31a36db8f9d3a87f88.tar.gz
friendfinder-946bec656d8219eaa2db9b31a36db8f9d3a87f88.tar.xz
friendfinder-946bec656d8219eaa2db9b31a36db8f9d3a87f88.zip
barcode gui improvement
Diffstat (limited to 'friendfinder/gui.c')
-rw-r--r--friendfinder/gui.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/friendfinder/gui.c b/friendfinder/gui.c
index 9dfb1c0..e26e1ba 100644
--- a/friendfinder/gui.c
+++ b/friendfinder/gui.c
@@ -28,9 +28,7 @@ double current_lon = 7.840171;
const char *msg_text, *key, *ip = NULL, *nickname = NULL, *partner_nickname = NULL;
char *from = NULL, *to = NULL, *current_msg, *last_msg;
-static Evas_Object *win, *bbx, *map;
-
-
+static Evas_Object *win, *bbx, *map, *img, *bcb;
static void on_cancel(void *data, Evas_Object *obj, void *event_info)
{
@@ -112,7 +110,14 @@ static void create_barcode(void *data, Evas_Object *obj, void *event_info)
}
else return;
- Evas_Object *img = elm_image_add(win);
+ if (img != NULL)
+ {
+ evas_object_del(img);
+ //evas_object_hide(img);
+ //free(img);
+ }
+
+ img = elm_image_add(win);
elm_image_file_set(img, "barcode.png", "");
evas_object_size_hint_weight_set(img, 1.0, 1.0);
evas_object_size_hint_align_set(img, -1.0, -1.0);
@@ -157,7 +162,18 @@ static void on_barcode(void *data, Evas_Object *obj, void *event_info)
{
enable_chat = 0;
disable_map_bubbles();
- init_barcode();
+ init_barcode();
+
+ if (img != NULL)
+ {
+ img = elm_image_add(win);
+ elm_image_file_set(img, "barcode.png", "");
+ evas_object_size_hint_weight_set(img, 1.0, 1.0);
+ evas_object_size_hint_align_set(img, -1.0, -1.0);
+ evas_object_resize(img, w*0.5, h*0.5);
+ elm_box_pack_end(bcb, img);
+ evas_object_show(img);
+ }
}
static void on_message(void *data, Evas_Object *obj, void *event_info)
@@ -466,7 +482,7 @@ void init_barcode()
evas_object_resize(bx4, w*0.6, h*0.6);
evas_object_move(bx4, w*0.2, h*0.15);
evas_object_show(bx4);
-
+ bcb = bx4;
bt = elm_button_add(win);
elm_button_label_set(bt, "Generate barcode");