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 4184876808cc3c715c06a68afc6362d34aab20ae
Author: Carsten Haitzler (Rasterman) <[email protected]>
AuthorDate: Fri Feb 20 12:34:21 2026 +0000

    popup - improve scaling and conditions layout
---
 src/e_mod_main.c | 67 ++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 46 insertions(+), 21 deletions(-)

diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index 128d1fe..1cee1fa 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -919,21 +919,20 @@ _forecasts_config_updated(Config_Item *ci)
 static Evas_Object *
 _lb_add(Evas_Object *base, const char *txt)
 {
-   Evas_Object *lb = elm_label_add(base);
-   evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   elm_object_text_set(lb, txt);
-   evas_object_show(lb);
-
-   return lb;
+   Evas_Object *o = elm_label_add(base);
+   evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
+   elm_object_text_set(o, txt);
+   evas_object_show(o);
+   return o;
 }
 
 static void
 _forecasts_popup_content_create(Instance *inst)
 {
-   Evas_Object *base, *bx, *hbx, *fr, *tb, *lb;
+   Evas_Object *base, *bx, *hbx, *fr, *tb, *lb, *sp;
    Evas_Object *rec, *ic, *im;
    char buf[2048], tmp[2048];
-   int row = 0;
+   int row = 0, row0, rownum;
    Evas_Coord w, h;
 
    if (!inst->location) return;
@@ -957,13 +956,18 @@ _forecasts_popup_content_create(Instance *inst)
    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);
-   elm_table_align_set(tb, 0.0, 0.0);
-   elm_table_padding_set(tb, 2, 2);
+   elm_table_padding_set(tb, ELM_SCALE_SIZE(2), ELM_SCALE_SIZE(2));
    evas_object_show(tb);
 
    rec = evas_object_rectangle_add(e_comp->evas);
-   evas_object_size_hint_min_set(rec, 240, 1);
-   elm_table_pack(tb, rec, 0, 0, 2, 1);
+   evas_object_size_hint_weight_set(rec, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(120), 0);
+   elm_table_pack(tb, rec, 0, 0, 1, 1);
+
+   rec = evas_object_rectangle_add(e_comp->evas);
+   evas_object_size_hint_weight_set(rec, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(120), 0);
+   elm_table_pack(tb, rec, 2, 0, 1, 1);
 
    elm_object_content_set(fr, tb);
 
@@ -974,8 +978,9 @@ _forecasts_popup_content_create(Instance *inst)
    if (h > 160) h = 160;
    im = e_widget_image_add_from_object(e_comp->evas, ic,
                                        ELM_SCALE_SIZE(w), ELM_SCALE_SIZE(h));
+   evas_object_size_hint_weight_set(im, EVAS_HINT_EXPAND, 0.0);
+   elm_table_pack(tb, im, 0, row, 3, 1);
    evas_object_show(im);
-   elm_table_pack(tb, im, 0, row, 2, 1);
 
    strcpy(tmp, D_("N/A"));
    if (inst->update_time)
@@ -983,45 +988,65 @@ _forecasts_popup_content_create(Instance *inst)
    snprintf(buf, sizeof(buf), D_("<small>Updated: %s</>"), tmp);
    lb = _lb_add(base, buf);
    evas_object_size_hint_align_set(lb, 1.0, 0.0);
-   elm_table_pack(tb, lb, 0, row++, 2, 1);
+   elm_table_pack(tb, lb, 0, row++, 3, 1);
 
    snprintf(buf, sizeof(buf), "<b>%s</>", inst->location);
    lb = _lb_add(base, buf);
-   evas_object_size_hint_align_set(lb, 0.5, 1.0);
-   elm_table_pack(tb, lb, 0, row++, 2, 1);
+   evas_object_size_hint_align_set(lb, 0.5, 0.5);
+   elm_table_pack(tb, lb, 0, row++, 3, 1);
+
+   row0 = row;
 
    lb = _lb_add(base, D_("Temperature"));
+   evas_object_size_hint_align_set(lb, 1.0, 0.5);
    elm_table_pack(tb, lb, 0, row, 1, 1);
    snprintf(buf, sizeof(buf), "%d°%c", inst->condition.temp, inst->units.temp);
    lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, row++, 1, 1);
+   evas_object_size_hint_align_set(lb, 0.0, 0.5);
+   elm_table_pack(tb, lb, 2, row++, 1, 1);
 
    lb = _lb_add(base, D_("Wind Chill"));
+   evas_object_size_hint_align_set(lb, 1.0, 0.5);
    elm_table_pack(tb, lb, 0, row, 1, 1);
    if (inst->details.wind.can_chill)
      snprintf(buf, sizeof(buf), "%d°%c", inst->details.wind.chill, inst->units.temp);
    else
      snprintf(buf, sizeof(buf), "N/A");
    lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, row++, 1, 1);
+   evas_object_size_hint_align_set(lb, 0.0, 0.5);
+   elm_table_pack(tb, lb, 2, row++, 1, 1);
 
    lb = _lb_add(base, D_("Wind Speed"));
+   evas_object_size_hint_align_set(lb, 1.0, 0.5);
    elm_table_pack(tb, lb, 0, row, 1, 1);
    snprintf(buf, sizeof(buf), "%d %s", inst->details.wind.speed, inst->units.speed);
    lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, row++, 1, 1);
+   evas_object_size_hint_align_set(lb, 0.0, 0.5);
+   elm_table_pack(tb, lb, 2, row++, 1, 1);
 
    lb = _lb_add(base, D_("Humidity"));
+   evas_object_size_hint_align_set(lb, 1.0, 0.5);
    elm_table_pack(tb, lb, 0, row, 1, 1);
    snprintf(buf, sizeof(buf), "%d %%", inst->details.atmosphere.humidity);
    lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, row++, 1, 1);
+   evas_object_size_hint_align_set(lb, 0.0, 0.5);
+   elm_table_pack(tb, lb, 2, row++, 1, 1);
 
    lb = _lb_add(base, D_("Pressure"));
+   evas_object_size_hint_align_set(lb, 1.0, 0.5);
    elm_table_pack(tb, lb, 0, row, 1, 1);
    snprintf(buf, sizeof(buf), "%.2f %s", inst->details.atmosphere.pressure, inst->units.pressure);
    lb = _lb_add(base, buf);
-   elm_table_pack(tb, lb, 1, row++, 1, 1);
+   evas_object_size_hint_align_set(lb, 0.0, 0.5);
+   elm_table_pack(tb, lb, 2, row++, 1, 1);
+
+   rownum = row - row0;
+   sp = elm_separator_add(base);
+   elm_separator_horizontal_set(sp, EINA_FALSE);
+   evas_object_size_hint_weight_set(sp, 0.0, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(sp, 0.5, EVAS_HINT_FILL);
+   elm_table_pack(tb, sp, 1, row0, 1, rownum);
+   evas_object_show(sp);
 
    hbx = elm_box_add(base);
    evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

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

Reply via email to