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

git pushed a commit to branch main
in repository equation.

View the commit online.

commit 8436aa05f459bc48c5d5712b8b486a71a653bf68
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Nov 21 19:33:39 2026 +0000

    window: spacing and element sizings.
---
 data/themes/common/groups/equation_display.edc     |   2 +-
 data/themes/common/groups/equation_frame.edc       |  36 ++++++++++-----------
 .../common/images/equation_window_shadow.png       | Bin 8140 -> 4707 bytes
 src/fe-efl/equation_ui.c                           |   8 ++---
 src/fe-efl/equation_window.c                       |  31 ++++++++++++++++++
 tests/equation_theme_test.c                        |   9 ++++--
 tests/equation_ui_test.c                           |   8 +++++
 tools/equation_shadows.py                          |   8 ++---
 8 files changed, 72 insertions(+), 30 deletions(-)

diff --git a/data/themes/common/groups/equation_display.edc b/data/themes/common/groups/equation_display.edc
index e57b4dd..e548028 100644
--- a/data/themes/common/groups/equation_display.edc
+++ b/data/themes/common/groups/equation_display.edc
@@ -1,6 +1,6 @@
 /* A shared result contract; Crazy Lab supplies real glass cathode artwork. */
 group { name: "equation/display";
- min: 260 108;
+ min: 260 96;
  parts {
   part { name: "panel"; type: IMAGE; mouse_events: 0;
    description { state: "default" 0.0; image.normal: "equation_display.svg"; image.border: 18 18 18 18; }
diff --git a/data/themes/common/groups/equation_frame.edc b/data/themes/common/groups/equation_frame.edc
index 534373a..950b24d 100644
--- a/data/themes/common/groups/equation_frame.edc
+++ b/data/themes/common/groups/equation_frame.edc
@@ -1,7 +1,7 @@
 /* Native client decorations: hit surfaces, widget controls, content swallow. */
 group { name: "equation/frame";
  parts {
-  /* Shared 2x nine-slice: generous alpha padding keeps the penumbra unclipped. */
+  /* Shared 2x nine-slice: tight padding contains the soft shadow. */
   part { name: "equation.shadow"; type: IMAGE; scale: 1; mouse_events: 0;
    description { state: "default" 0.0;
     image.normal: "equation_window_shadow.png";
@@ -10,68 +10,68 @@ group { name: "equation/frame";
    description { state: "maximized" 0.0; inherit: "default" 0.0; visible: 0; }
   }
   part { name: "body"; type: IMAGE; scale: 1; mouse_events: 0;
-   description { state: "default" 0.0; offset_scale: 1; rel1.offset: 18 12; rel2.offset: -19 -27; image.normal: "equation_body.svg"; image.border: 24 24 72 24; }
+   description { state: "default" 0.0; offset_scale: 1; rel1.offset: 8 5; rel2.offset: -9 -13; image.normal: "equation_body.svg"; image.border: 24 24 56 24; }
    description { state: "maximized" 0.0; inherit: "default" 0.0; rel1.offset: 0 0; rel2.offset: -1 -1; }
   }
   part { name: "header_rule"; type: IMAGE; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body";
-    rel1.offset: 15 63; rel2 { relative: 1 0; offset: -16 65; }
+    rel1.offset: 13 49; rel2 { relative: 1 0; offset: -14 51; }
     image.normal: "equation_rule.svg";
     fill.size { relative: 0 0; offset: 32 4; }
    }
   }
   part { name: "header_shadow_0"; type: RECT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 40;
-    rel1 { relative: 0 0; offset: 15 66; } rel2 { relative: 1 0; offset: -16 66; } }
+    rel1 { relative: 0 0; offset: 13 52; } rel2 { relative: 1 0; offset: -14 52; } }
   }
   part { name: "header_shadow_1"; type: RECT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 28;
-    rel1 { relative: 0 0; offset: 15 67; } rel2 { relative: 1 0; offset: -16 67; } }
+    rel1 { relative: 0 0; offset: 13 53; } rel2 { relative: 1 0; offset: -14 53; } }
   }
   part { name: "header_shadow_2"; type: RECT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 18;
-    rel1 { relative: 0 0; offset: 15 68; } rel2 { relative: 1 0; offset: -16 68; } }
+    rel1 { relative: 0 0; offset: 13 54; } rel2 { relative: 1 0; offset: -14 54; } }
   }
   part { name: "header_shadow_3"; type: RECT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 10;
-    rel1 { relative: 0 0; offset: 15 69; } rel2 { relative: 1 0; offset: -16 69; } }
+    rel1 { relative: 0 0; offset: 13 55; } rel2 { relative: 1 0; offset: -14 55; } }
   }
   part { name: "header_shadow_4"; type: RECT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 5;
-    rel1 { relative: 0 0; offset: 15 70; } rel2 { relative: 1 0; offset: -16 70; } }
+    rel1 { relative: 0 0; offset: 13 56; } rel2 { relative: 1 0; offset: -14 56; } }
   }
   part { name: "header_shadow_5"; type: RECT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 2;
-    rel1 { relative: 0 0; offset: 15 71; } rel2 { relative: 1 0; offset: -16 71; } }
+    rel1 { relative: 0 0; offset: 13 57; } rel2 { relative: 1 0; offset: -14 57; } }
   }
   part { name: "equation.move"; type: RECT;
    scale: 1; description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 0;
-    rel1.offset: 6 6; rel2 { relative: 1 0; offset: -7 61; } }
+    rel1.offset: 6 6; rel2 { relative: 1 0; offset: -7 47; } }
   }
   part { name: "equation.title"; type: TEXT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body";
-    rel1.offset: 63 12; rel2 { relative: 1 0; offset: -125 34; } color: INK;
+    rel1.offset: 55 7; rel2 { relative: 1 0; offset: -125 27; } color: INK;
     text { font: "Sans:style=Bold"; size: 15; align: 0 0.5; min: 0 1; ellipsis: 1; } }
-   description { state: "dialog" 0.0; inherit: "default" 0.0; rel1.offset: 25 12; rel2.offset: -65 34; }
+   description { state: "dialog" 0.0; inherit: "default" 0.0; rel1.offset: 22 7; rel2.offset: -65 27; }
   }
   part { name: "equation.subtitle"; type: TEXT; scale: 1; mouse_events: 0;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body";
-    rel1.offset: 63 35; rel2 { relative: 1 0; offset: -115 50; } color: MUTE;
+    rel1.offset: 55 27; rel2 { relative: 1 0; offset: -115 41; } color: MUTE;
     text { text: THEME_SUBTITLE; font: "Monospace"; size: 7; align: 0 0.5; ellipsis: 1; } }
-   description { state: "dialog" 0.0; inherit: "default" 0.0; rel1.offset: 25 35; }
+   description { state: "dialog" 0.0; inherit: "default" 0.0; rel1.offset: 22 27; }
   }
   part { name: "equation.menu"; type: SWALLOW; scale: 1;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body";
-    rel1 { relative: 0 0; offset: 19 14; } rel2 { relative: 0 0; offset: 50 47; } }
+    rel1 { relative: 0 0; offset: 13 8; } rel2 { relative: 0 0; offset: 44 39; } }
   }
   part { name: "equation.controls"; type: SWALLOW; scale: 1;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body";
-    rel1 { relative: 1 0; offset: -110 14; } rel2 { relative: 1 0; offset: -17 47; } }
-   description { state: "dialog" 0.0; inherit: "default" 0.0; rel1.offset: -49 14; }
+    rel1 { relative: 1 0; offset: -110 8; } rel2 { relative: 1 0; offset: -17 39; } }
+   description { state: "dialog" 0.0; inherit: "default" 0.0; rel1.offset: -49 8; }
   }
   part { name: "equation.content"; type: SWALLOW; scale: 1;
    description { state: "default" 0.0; offset_scale: 1; rel.to: "body";
-    rel1.offset: 18 80; rel2.offset: -19 -19; } }
+    rel1.offset: 12 64; rel2.offset: -13 -13; } }
 #define GRIP(n,x1,y1,x2,y2,ox1,oy1,ox2,oy2) \
   part { name: n; type: RECT; scale: 1; description { state: "default" 0.0; offset_scale: 1; rel.to: "body"; color: 0 0 0 0; rel1 { relative: x1 y1; offset: ox1 oy1; } rel2 { relative: x2 y2; offset: ox2 oy2; } } }
   GRIP("top",0,0,1,0, 7,0,-8,6)
diff --git a/data/themes/common/images/equation_window_shadow.png b/data/themes/common/images/equation_window_shadow.png
index c7d745b..c666bb0 100644
Binary files a/data/themes/common/images/equation_window_shadow.png and b/data/themes/common/images/equation_window_shadow.png differ
diff --git a/src/fe-efl/equation_ui.c b/src/fe-efl/equation_ui.c
index d834446..de3c75e 100644
--- a/src/fe-efl/equation_ui.c
+++ b/src/fe-efl/equation_ui.c
@@ -573,7 +573,7 @@ equation_ui_show(void)
    evas_object_data_set(ui->window, "equation_ui", ui);
    evas_object_event_callback_add(ui->window, EVAS_CALLBACK_DEL, equation_ui_free, ui);
    Evas_Object *box = ui->box = elm_box_add(ui->window);
-   elm_box_padding_set(box, 0, 5);
+   elm_box_padding_set(box, 0, ELM_SCALE_SIZE(3));
    elm_box_align_set(box, 0.5, 0);
    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    equation_window_content_set(ui->window, box);
@@ -622,7 +622,7 @@ equation_ui_show(void)
    elm_entry_cnp_mode_set(ui->entry, ELM_CNP_MODE_PLAINTEXT);
    ui->base_box = elm_box_add(box);
    elm_box_horizontal_set(ui->base_box, EINA_TRUE);
-   elm_box_padding_set(ui->base_box, 8, 0);
+   elm_box_padding_set(ui->base_box, ELM_SCALE_SIZE(5), 0);
    elm_box_pack_end(ui->base_box, equation_label(ui, ui->base_box, _("Input base:")));
    const char *base_labels[] = { _("Decimal (10)"), _("Hex (16)"), _("Binary (2)") };
    const char *base_names[]
@@ -650,7 +650,7 @@ equation_ui_show(void)
    elm_layout_file_set(ui->display, ui->theme_path, "equation/display");
    evas_object_size_hint_weight_set(ui->display, EVAS_HINT_EXPAND, 0);
    evas_object_size_hint_align_set(ui->display, EVAS_HINT_FILL, 0.5);
-   evas_object_size_hint_min_set(ui->display, 0, ELM_SCALE_SIZE(108));
+   evas_object_size_hint_min_set(ui->display, 0, ELM_SCALE_SIZE(96));
    elm_box_pack_end(box, ui->display);
    evas_object_show(ui->display);
    ui->copy = elm_button_add(ui->display);
@@ -693,7 +693,7 @@ equation_ui_show(void)
    equation_result_rows_theme(ui);
    Evas_Object *keypads = elm_box_add(box);
    elm_box_horizontal_set(keypads, EINA_TRUE);
-   elm_box_padding_set(keypads, ELM_SCALE_SIZE(8), 0);
+   elm_box_padding_set(keypads, ELM_SCALE_SIZE(5), 0);
    evas_object_size_hint_weight_set(keypads, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(keypads, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, keypads);
diff --git a/src/fe-efl/equation_window.c b/src/fe-efl/equation_window.c
index 694c8bf..b1cb749 100644
--- a/src/fe-efl/equation_window.c
+++ b/src/fe-efl/equation_window.c
@@ -4,6 +4,7 @@
 
 #include "equation_window.h"
 #include "equation_intl.h"
+#include <Ecore_Evas.h>
 #include <stdint.h>
 #include <stdlib.h>
 
@@ -53,6 +54,29 @@ equation_window_resize(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object
      data, (Elm_Win_Move_Resize_Mode)(intptr_t)evas_object_data_get(object, "equation_resize"));
 }
 
+static void
+equation_window_shadow_update(void *data, Evas *canvas, Evas_Object *object EINA_UNUSED,
+                              void *event EINA_UNUSED)
+{
+   Equation_Window *chrome = data;
+   Ecore_Evas *surface = ecore_evas_ecore_evas_get(canvas);
+   if (!surface) return;
+   if (elm_win_maximized_get(chrome->window))
+     {
+        ecore_evas_shadow_geometry_set(surface, 0, 0, 0, 0);
+        return;
+     }
+   Evas_Object *edje = elm_layout_edje_get(chrome->frame);
+   edje_object_calc_force(edje);
+   int width, height, x, y, body_width, body_height;
+   evas_object_geometry_get(edje, NULL, NULL, &width, &height);
+   if (edje_object_part_geometry_get(edje, "body", &x, &y, &body_width, &body_height)
+       && x >= 0 && y >= 0 && body_width > 0 && body_height > 0
+       && x + body_width <= width && y + body_height <= height)
+     ecore_evas_shadow_geometry_set(surface, x, width - x - body_width,
+                                   y, height - y - body_height);
+}
+
 static void
 equation_window_state_changed(void *data, Evas_Object *object EINA_UNUSED, void *event EINA_UNUSED)
 {
@@ -60,6 +84,9 @@ equation_window_state_changed(void *data, Evas_Object *object EINA_UNUSED, void
    elm_layout_signal_emit(
      chrome->frame,
      elm_win_maximized_get(chrome->window) ? "equation,maximized" : "equation,restored", "equation");
+   Evas_Object *edje = elm_layout_edje_get(chrome->frame);
+   edje_object_message_signal_process(edje);
+   equation_window_shadow_update(chrome, evas_object_evas_get(chrome->frame), chrome->frame, NULL);
 }
 
 static void
@@ -160,6 +187,8 @@ equation_window_add(Evas_Object *parent, const char *title, const char *path, El
      }
    evas_object_size_hint_weight_set(chrome->frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(chrome->window, chrome->frame);
+   evas_object_event_callback_add(elm_layout_edje_get(chrome->frame), EVAS_CALLBACK_RESIZE,
+                                  equation_window_shadow_update, chrome);
    chrome->controls = elm_box_add(chrome->window);
    elm_box_horizontal_set(chrome->controls, EINA_TRUE);
    elm_box_padding_set(chrome->controls, 3, 0);
@@ -182,6 +211,8 @@ equation_window_add(Evas_Object *parent, const char *title, const char *path, El
                                   chrome);
    evas_object_smart_callback_add(chrome->window, "unmaximized", equation_window_state_changed,
                                   chrome);
+   evas_object_event_callback_add(chrome->window, EVAS_CALLBACK_SHOW,
+                                  equation_window_shadow_update, chrome);
    evas_object_event_callback_add(chrome->window, EVAS_CALLBACK_DEL, equation_window_free, chrome);
    return chrome->window;
 }
diff --git a/tests/equation_theme_test.c b/tests/equation_theme_test.c
index 6bad4b4..a49d5f3 100644
--- a/tests/equation_theme_test.c
+++ b/tests/equation_theme_test.c
@@ -98,7 +98,9 @@ main(int argc, char **argv)
                      edje_object_part_geometry_get(object, "body", &bx, &by, &bw, &bh);
                      edje_object_part_geometry_get(object, "equation.menu", &mx, &my, &mw, &mh);
                      edje_object_part_geometry_get(object, "equation.title", &tx, &ty, &tw, &th);
-                     if (bx <= 0 || by <= 0 || mx < bx || mx + mw > tx || my < by || my + mh > by + bh)
+                     if (bx != 8 * scale || by != 5 * scale || bw != (480 - 16) * scale
+                         || bh != (790 - 17) * scale || mx < bx || mx + mw > tx
+                         || my < by || my + mh > by + bh)
                        {
                           fprintf(stderr, "Invalid shadow inset or menu/title order: %s at %d\n", argv[i],
                                   scale);
@@ -120,7 +122,8 @@ main(int argc, char **argv)
                      edje_object_message_signal_process(object);
                      edje_object_calc_force(object);
                      edje_object_part_geometry_get(object, "body", &bx, &by, &bw, &bh);
-                     if (bx <= 0 || by <= 0)
+                     if (bx != 8 * scale || by != 5 * scale || bw != (480 - 16) * scale
+                         || bh != (790 - 17) * scale)
                        {
                           fprintf(stderr, "Restored shadow margin missing\n");
                           failed++;
@@ -129,7 +132,7 @@ main(int argc, char **argv)
              }
            if (!strcmp(group, "equation/display") && edje_object_part_exists(object, "tube_0"))
              {
-                const int sizes[][2] = { { 360, 108 }, { 660, 108 }, { 1200, 108 }, { 660, 142 }, { 660, 300 } };
+                const int sizes[][2] = { { 360, 96 }, { 660, 96 }, { 1200, 108 }, { 660, 142 }, { 660, 300 } };
                 for (int scale = 1; scale <= 2; ++scale)
                   {
                      edje_object_scale_set(object, scale);
diff --git a/tests/equation_ui_test.c b/tests/equation_ui_test.c
index 4db35a6..4172cdf 100644
--- a/tests/equation_ui_test.c
+++ b/tests/equation_ui_test.c
@@ -246,6 +246,14 @@ main(int argc, char **argv)
         equation_click(about);
         EQUATION_CHECK(!ui->menu && ui->about && elm_win_borderless_get(ui->about));
         equation_pump();
+        int left, right, top, bottom, about_left, about_right, about_top, about_bottom;
+        ecore_evas_shadow_geometry_get(ecore_evas_ecore_evas_get(canvas),
+                                       &left, &right, &top, &bottom);
+        ecore_evas_shadow_geometry_get(ecore_evas_ecore_evas_get(evas_object_evas_get(ui->about)),
+                                       &about_left, &about_right, &about_top, &about_bottom);
+        EQUATION_CHECK(left > 0 && right > 0 && top > 0 && bottom > 0);
+        EQUATION_CHECK(left == about_left && right == about_right
+                       && top == about_top && bottom == about_bottom);
         if (argc > 1)
           {
              char path[PATH_MAX];
diff --git a/tools/equation_shadows.py b/tools/equation_shadows.py
index 5a3195f..b36ae19 100644
--- a/tools/equation_shadows.py
+++ b/tools/equation_shadows.py
@@ -6,16 +6,16 @@ from pathlib import Path
 from PIL import Image, ImageDraw, ImageFilter
 
 # Render at 2x so corners stay smooth at fractional desktop scales. The panel
-# footprint matches the frame's 18/12/18/26 logical-pixel transparent margins.
+# footprint matches the frame's 8/5/8/12 logical-pixel transparent margins.
 scale = 2
 size = 192
 mask = Image.new('L', (size * scale, size * scale))
 ImageDraw.Draw(mask).rounded_rectangle(
-    (18 * scale, 17 * scale, (size - 19) * scale, (size - 22) * scale),
-    radius=14 * scale,
+    (8 * scale, 8 * scale, (size - 9) * scale, (size - 10) * scale),
+    radius=16 * scale,
     fill=125,
 )
-mask = mask.filter(ImageFilter.GaussianBlur(8 * scale))
+mask = mask.filter(ImageFilter.GaussianBlur(3 * scale))
 image = Image.new('RGBA', mask.size)
 image.putalpha(mask)
 output = (

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

Reply via email to