From 4c01d010bf1418d10a2b9800dee900bdf5400765 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 12 Jun 2006 20:45:10 +0000 Subject: [PATCH] Fix centering label in the module. Reset mail count to zero on call to check mail so that we only get total of new mail. During checks, add new mail count to the total. SVN revision: 23399 --- e_mod_main.c | 2 ++ imap.c | 6 ++---- mail.edc | 36 +++++------------------------------- mbox.c | 2 +- mdir.c | 3 ++- pop.c | 2 +- 6 files changed, 13 insertions(+), 38 deletions(-) diff --git a/e_mod_main.c b/e_mod_main.c index defa068..55aa372 100644 --- a/e_mod_main.c +++ b/e_mod_main.c @@ -487,6 +487,8 @@ _mail_cb_check(void *data) int have_imap = 0, have_pop = 0; if (!inst) return 1; + inst->count = 0; + ci = _mail_config_item_get(inst->gcc->id); if (!ci->boxes) return 1; for (l = ci->boxes; l; l = l->next) diff --git a/imap.c b/imap.c index f922501..8188efb 100644 --- a/imap.c +++ b/imap.c @@ -194,8 +194,9 @@ _mail_imap_server_del(void *data, int type, void *event) ecore_con_server_del(is->server); is->server = NULL; + inst = is->data; - inst->count = is->count; + inst->count += is->count; _mail_set_text(inst); return 0; @@ -258,9 +259,6 @@ _mail_imap_server_data(void *data, int type, void *event) is->count += num; ic->config->num_new = num; ic->config->num_total = total; - inst = is->data; - inst->count = num; - _mail_set_text(inst); if ((num > 0) && (ic->config->use_exec) && (ic->config->exec)) _mail_start_exe(ic->config); diff --git a/mail.edc b/mail.edc index 0a163d5..2bac160 100644 --- a/mail.edc +++ b/mail.edc @@ -16,32 +16,10 @@ collections max: 128 128; parts { - part - { - name: "clip"; - type: RECT; - mouse_events: 1; - description - { - state: "default" 0.0; - color: 255 255 255 255; - rel1 - { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 - { - relative: 1.0 1.0; - offset: -1 -1; - } - } - } part { name: "logo"; type: IMAGE; - clip_to: "clip"; mouse_events: 1; description { @@ -78,14 +56,13 @@ collections { name: "new_label"; type: TEXT; - clip_to: "clip"; - effect: SOFT_SHADOW; + effect: OUTLINE_SOFT_SHADOW; mouse_events: 1; description { state: "default" 0.0; - color: 0 0 0 255; - color3: 255 255 255 42; + color: 255 255 255 255; + color3: 0 0 0 32; visible: 0; rel1 { @@ -103,10 +80,9 @@ collections { text: ""; font: "VeraBold"; - size: 14; + size: 16; min: 1 1; - align: 0.5 0.5; - text_class: "module_large"; + align: 1.0 0.5; } } description @@ -114,8 +90,6 @@ collections state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - color: 0 0 0 255; - color3: 255 255 255 42; } } } diff --git a/mbox.c b/mbox.c index a828244..9371414 100644 --- a/mbox.c +++ b/mbox.c @@ -105,7 +105,7 @@ _mail_mbox_check_mail(void *data, Ecore_File_Monitor *monitor, Ecore_File_Event fclose(f); inst = mb->data; - inst->count = mb->config->num_new; + inst->count += mb->config->num_new; _mail_set_text(inst); if ((mb->config->num_new > 0) && (mb->config->use_exec) && (mb->config->exec)) _mail_start_exe(mb->config); diff --git a/mdir.c b/mdir.c index 0d8047b..766fea8 100644 --- a/mdir.c +++ b/mdir.c @@ -75,8 +75,9 @@ _mail_mdir_check_mail(void *data, Ecore_File_Monitor *monitor, Ecore_File_Event mc->config->num_total = _mail_mdir_get_files(mc->config->cur_path); mc->config->num_new = _mail_mdir_get_files(mc->config->new_path); + inst = mc->data; - inst->count = mc->config->num_new; + inst->count += mc->config->num_new; _mail_set_text(inst); if ((mc->config->num_new > 0) && (mc->config->use_exec) && (mc->config->exec)) _mail_start_exe(mc->config); diff --git a/pop.c b/pop.c index 7a9a169..244cef4 100644 --- a/pop.c +++ b/pop.c @@ -192,7 +192,7 @@ _mail_pop_server_data(void *data, int type, void *event) pc->config->num_new = num; pc->config->num_total = num; } - inst->count = num; + inst->count += num; _mail_pop_client_quit(pc); if ((num > 0) && (pc->config->use_exec) && (pc->config->exec)) _mail_start_exe(pc->config);