This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enlightenment-module-forecasts.

View the commit online.

commit 31e2c6b3d001a27165901c252f581ed95db95bc0
Author: Carsten Haitzler (Rasterman) <[email protected]>
AuthorDate: Fri Feb 20 13:42:01 2026 +0000

    make today tomorrow items a func and remove frame
    
    less buy - no need for high and low labels. put high temp above, low
    temp below, icon to left, day name at top. nicer look with less busy
    frames
---
 src/e_mod_main.c | 139 ++++++++++++++++++++++++-------------------------------
 1 file changed, 61 insertions(+), 78 deletions(-)

diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index 1cee1fa..8755f6e 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -4,7 +4,7 @@
 
 char *strptime(const char *s, const char *format, struct tm *tm);
 
-#define FORECASTS    2
+#define FORECASTS    5
 #define KM_TO_MI     1.609344
 #define MB_TO_IN     33.864
 
@@ -926,12 +926,56 @@ _lb_add(Evas_Object *base, const char *txt)
    return o;
 }
 
+static Evas_Object *
+_day_hi_lo_add(Evas_Object *base, const char *day, int lo, int hi, char unit, const char *code)
+{
+  Evas_Object *o, *tb;
+  char buf[256];
+
+  tb = o = elm_table_add(base);
+  elm_table_padding_set(o, ELM_SCALE_SIZE(2), ELM_SCALE_SIZE(2));
+  evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+  snprintf(buf, sizeof(buf), "<b>%s</>", day);
+  o = _lb_add(base, buf);
+  evas_object_size_hint_weight_set(o, 0.0, 0.0);
+  evas_object_size_hint_align_set(o, 0.5, 0.5);
+  elm_table_pack(tb, o, 0, 0, 2, 1);
+
+  o = _forecasts_popup_icon_create(e_comp->evas, code);
+  o = e_widget_image_add_from_object(e_comp->evas, o,
+                                     ELM_SCALE_SIZE(24),
+                                     ELM_SCALE_SIZE(24));
+  evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+  evas_object_size_hint_align_set(o, 1.0, 0.5);
+  elm_table_pack(tb, o, 0, 1, 1, 2);
+  evas_object_show(o);
+
+  if ((hi != TEMP_MIN_OUT_OF_RANGE) && (hi != TEMP_MAX_OUT_OF_RANGE))
+    snprintf(buf, sizeof(buf), "%i°%c", hi, unit);
+  else
+    snprintf(buf, sizeof(buf), D_("N/A"));
+  o = _lb_add(base, buf);
+  evas_object_size_hint_align_set(o, 0.0, 0.5);
+  elm_table_pack(tb, o, 1, 1, 1, 1);
+
+  if ((lo != TEMP_MIN_OUT_OF_RANGE) && (lo != TEMP_MAX_OUT_OF_RANGE))
+    snprintf(buf, sizeof(buf), "%i°%c", lo, unit);
+  else
+    snprintf(buf, sizeof(buf), D_("N/A"));
+  o = _lb_add(base, buf);
+  evas_object_size_hint_align_set(o, 0.0, 0.5);
+  elm_table_pack(tb, o, 1, 2, 1, 1);
+
+  return tb;
+}
+
 static void
 _forecasts_popup_content_create(Instance *inst)
 {
    Evas_Object *base, *bx, *hbx, *fr, *tb, *lb, *sp;
    Evas_Object *rec, *ic, *im;
-   char buf[2048], tmp[2048];
+   char buf[256], tmp[32];
    int row = 0, row0, rownum;
    Evas_Coord w, h;
 
@@ -982,7 +1026,7 @@ _forecasts_popup_content_create(Instance *inst)
    elm_table_pack(tb, im, 0, row, 3, 1);
    evas_object_show(im);
 
-   strcpy(tmp, D_("N/A"));
+   snprintf(tmp, sizeof(tmp), D_("N/A"));
    if (inst->update_time)
      _timestamp_local(inst->update_time, tmp, sizeof(tmp));
    snprintf(buf, sizeof(buf), D_("<small>Updated: %s</>"), tmp);
@@ -1051,87 +1095,26 @@ _forecasts_popup_content_create(Instance *inst)
    hbx = elm_box_add(base);
    evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   elm_box_horizontal_set(hbx, 1);
-   evas_object_show(hbx);
+   elm_box_horizontal_set(hbx, EINA_TRUE);
+   elm_box_homogeneous_set(hbx, EINA_TRUE);
    elm_box_pack_end(bx, hbx);
+   evas_object_show(hbx);
 
-   fr = elm_frame_add(base);
-   evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   elm_object_text_set(fr, D_("Today"));
+   fr = _day_hi_lo_add(base, D_("Today"),
+                       inst->forecast[0].low,
+                       inst->forecast[0].high,
+                       inst->units.temp,
+                       inst->forecast[0].code);
+   elm_box_pack_end(hbx, fr);
    evas_object_show(fr);
 
-   tb = elm_table_add(base);
-   evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   evas_object_show(tb);
-   elm_object_content_set(fr, tb);
-
-   ic = _forecasts_popup_icon_create(e_comp->evas,
-                                     inst->forecast[0].code);
-   im = e_widget_image_add_from_object(e_comp->evas, ic,
-                                       ELM_SCALE_SIZE(24), ELM_SCALE_SIZE(24));
-   evas_object_size_hint_weight_set(im, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_show(im);
-   elm_table_pack(tb, im, 0, 0, 2, 1);
-
-   lb = _lb_add(base, D_("High"));
-   elm_table_pack(tb, lb, 0, 1, 1, 1);
-   if (inst->forecast[0].high != TEMP_MIN_OUT_OF_RANGE && inst->forecast[0].high != TEMP_MAX_OUT_OF_RANGE)
-     snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[0].high, inst->units.temp);
-   else
-     snprintf(buf, sizeof(buf), D_("N/A"));
-   lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 0, 2, 1, 1);
-
-   lb = _lb_add(base, D_("Low"));
-   elm_table_pack(tb, lb, 1, 1, 1, 1);
-   if (inst->forecast[0].low != TEMP_MIN_OUT_OF_RANGE && inst->forecast[0].low != TEMP_MAX_OUT_OF_RANGE)
-     snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[0].low, inst->units.temp);
-   else
-     snprintf(buf, sizeof(buf), D_("N/A"));
-   lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, 2, 1, 1);
+   fr = _day_hi_lo_add(base, D_("Tomorrow"),
+                       inst->forecast[1].low,
+                       inst->forecast[1].high,
+                       inst->units.temp,
+                       inst->forecast[1].code);
    elm_box_pack_end(hbx, fr);
-
-   fr = elm_frame_add(base);
-   evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   elm_object_text_set(fr, D_("Tomorrow"));
    evas_object_show(fr);
-   elm_box_pack_end(hbx, fr);
-
-   tb = elm_table_add(base);
-   evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   evas_object_show(tb);
-   elm_object_content_set(fr, tb);
-
-   ic = _forecasts_popup_icon_create(e_comp->evas,
-                                     inst->forecast[1].code);
-   im = e_widget_image_add_from_object(e_comp->evas, ic,
-                                       ELM_SCALE_SIZE(24), ELM_SCALE_SIZE(24));
-   evas_object_size_hint_weight_set(im, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_show(im);
-   elm_table_pack(tb, im, 0, 0, 2, 1);
-
-   lb = _lb_add(base, D_("High"));
-   elm_table_pack(tb, lb, 0, 1, 1, 1);
-   if (inst->forecast[1].high != TEMP_MIN_OUT_OF_RANGE && inst->forecast[1].high != TEMP_MAX_OUT_OF_RANGE)
-     snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[1].high, inst->units.temp);
-   else
-     snprintf(buf, sizeof(buf), D_("N/A"));
-   lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 0, 2, 1, 1);
-
-   lb = _lb_add(base, D_("Low"));
-   elm_table_pack(tb, lb, 1, 1, 1, 1);
-   if (inst->forecast[1].low != TEMP_MIN_OUT_OF_RANGE && inst->forecast[1].low != TEMP_MAX_OUT_OF_RANGE)
-     snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[1].low, inst->units.temp);
-   else
-     snprintf(buf, sizeof(buf), D_("N/A"));
-   lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, 2, 1, 1);
 
    e_gadcon_popup_content_set(inst->popup, bx);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to