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

git pushed a commit to branch main
in repository eternity.

View the commit online.

commit e2906bcd29a9cdd0ef66637ce55ea118befce56b
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Nov 21 22:07:38 2026 +0000

    border: fix
---
 data/themes/folio/eternity_window.svg         |   2 +-
 data/themes/frequency/eternity_window.svg     |   2 +-
 data/themes/gant/eternity_window.svg          |   2 +-
 data/themes/meson.build                       |   2 +-
 data/themes/midnight/eternity_window.svg      |   2 +-
 data/themes/nocturne/eternity_window.svg      |   2 +-
 data/themes/porcelain/eternity_window.svg     |   2 +-
 data/themes/shared/eternity_alert_parts.edc   |   6 +++-
 data/themes/shared/eternity_common.edc        |  50 ++++++++++++++++++--------
 data/themes/shared/eternity_motion_parts.edc  |   6 ++--
 data/themes/shared/eternity_window_shadow.png | Bin 0 -> 552 bytes
 data/themes/undertow/eternity_window.svg      |   2 +-
 data/themes/voltage/eternity_window.svg       |   2 +-
 meson.build                                   |   2 +-
 src/lib/eternity.h                            |   4 +++
 src/lib/eternity_theme.c                      |  39 ++++++++++++++++++++
 src/lib/eternity_ui.c                         |  11 +++++-
 tests/eternity_render_test.c                  |  30 ++++++++++++++--
 18 files changed, 133 insertions(+), 33 deletions(-)

diff --git a/data/themes/folio/eternity_window.svg b/data/themes/folio/eternity_window.svg
index ef61012..1792654 100644
--- a/data/themes/folio/eternity_window.svg
+++ b/data/themes/folio/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#fffffa"/><stop offset=".45" stop-color="#ddd2bb"/><stop offset="1" stop-color="#b5ac99"/></linearGradient></defs><rect width="480" height="720" fill="#f6efdf"/><rect x=".5" y=".5" width="479" height="719" fill="#f6efdf" stroke="#c9b99c"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#c9b99c"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#fffffa"/><stop offset=".45" stop-color="#ddd2bb"/><stop offset="1" stop-color="#b5ac99"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M13 65h454" stroke="#c9b99c" stroke-opacity=".25" stroke-width=".5"/><path d="M13 76h454" stroke="#c9b99c" stroke-opacity=".25" stroke-width=".5"/><path d=" [...]
diff --git a/data/themes/frequency/eternity_window.svg b/data/themes/frequency/eternity_window.svg
index c655ca8..438e858 100644
--- a/data/themes/frequency/eternity_window.svg
+++ b/data/themes/frequency/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#49524e"/><stop offset=".45" stop-color="#151d1d"/><stop offset="1" stop-color="#111818"/></linearGradient></defs><rect width="480" height="720" fill="#414946"/><rect x=".5" y=".5" width="479" height="719" fill="#414946" stroke="#756b53"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#756b53"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#49524e"/><stop offset=".45" stop-color="#151d1d"/><stop offset="1" stop-color="#111818"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M11 72h458" stroke="#756b53" stroke-opacity=".045"/><path d="M11 76h458" stroke="#756b53" stroke-opacity=".045"/><path d="M11 80h458" stroke="#756b53" strok [...]
diff --git a/data/themes/gant/eternity_window.svg b/data/themes/gant/eternity_window.svg
index b14c56e..6dc8525 100644
--- a/data/themes/gant/eternity_window.svg
+++ b/data/themes/gant/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#517c9c"/><stop offset=".45" stop-color="#36566e"/><stop offset="1" stop-color="#2c475a"/></linearGradient></defs><rect width="480" height="720" fill="#486f8b"/><rect x=".5" y=".5" width="479" height="719" fill="#486f8b" stroke="#294b64"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#294b64"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#517c9c"/><stop offset=".45" stop-color="#36566e"/><stop offset="1" stop-color="#2c475a"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M16 65h448M16 680h448" stroke="#294b64" stroke-width="2"/><path d="M200 697v8" stroke="#294b64" stroke-width="3"/><path d="M208 697v8" stroke="#294b64" stro [...]
diff --git a/data/themes/meson.build b/data/themes/meson.build
index d8d9eea..9b9405d 100644
--- a/data/themes/meson.build
+++ b/data/themes/meson.build
@@ -1,6 +1,6 @@
 edje_cc = find_program('edje_cc')
 shared_dir = meson.current_source_dir() / 'shared'
-shared_sources = files('shared/eternity_motion_parts.edc', 'shared/eternity_motion_programs.edc',
+shared_sources = files('shared/eternity_window_shadow.png', 'shared/eternity_motion_parts.edc', 'shared/eternity_motion_programs.edc',
   'shared/eternity_alert_parts.edc', 'shared/eternity_alert_programs.edc', 'shared/eternity_common.edc', 'shared/eternity_widgets.edc',
   'shared/eternity_analogue.edc', 'shared/eternity_world.edc', 'shared/eternity_alarm.edc',
   'shared/eternity_hour.svg', 'shared/eternity_minute.svg', 'shared/eternity_second.svg', 'shared/eternity_pin.svg')
diff --git a/data/themes/midnight/eternity_window.svg b/data/themes/midnight/eternity_window.svg
index c92cd56..ddd9e84 100644
--- a/data/themes/midnight/eternity_window.svg
+++ b/data/themes/midnight/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#1b3144"/><stop offset=".45" stop-color="#0c1726"/><stop offset="1" stop-color="#0a131f"/></linearGradient></defs><rect width="480" height="720" fill="#182c3d"/><rect x=".5" y=".5" width="479" height="719" fill="#182c3d" stroke="#36515d"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#36515d"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#1b3144"/><stop offset=".45" stop-color="#0c1726"/><stop offset="1" stop-color="#0a131f"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M12 185h6m-3-3v6" stroke="#d4b784"/><path d="M462 365h6m-3-3v6" stroke="#d4b784"/><path d="M12 510h6m-3-3v6" stroke="#d4b784"/><path d="M387 690h6m-3-3v6" s [...]
diff --git a/data/themes/nocturne/eternity_window.svg b/data/themes/nocturne/eternity_window.svg
index f2aabd4..37260eb 100644
--- a/data/themes/nocturne/eternity_window.svg
+++ b/data/themes/nocturne/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#2b314a"/><stop offset=".45" stop-color="#111521"/><stop offset="1" stop-color="#0e111b"/></linearGradient></defs><rect width="480" height="720" fill="#262c42"/><rect x=".5" y=".5" width="479" height="719" fill="#262c42" stroke="#3a435c"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#3a435c"/><cir [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#2b314a"/><stop offset=".45" stop-color="#111521"/><stop offset="1" stop-color="#0e111b"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><circle cx="240" cy="690" r="14" fill="none" stroke="#afa0d5" stroke-opacity=".3"/><circle cx="240" cy="690" r="23" fill="none" stroke="#afa0d5" stroke-opacity=".3"/ [...]
diff --git a/data/themes/porcelain/eternity_window.svg b/data/themes/porcelain/eternity_window.svg
index 5352095..941af5e 100644
--- a/data/themes/porcelain/eternity_window.svg
+++ b/data/themes/porcelain/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#ffffff"/><stop offset=".45" stop-color="#f2ede3"/><stop offset="1" stop-color="#c6c2ba"/></linearGradient></defs><rect width="480" height="720" fill="#fffcf4"/><rect x=".5" y=".5" width="479" height="719" fill="#fffcf4" stroke="#d8ccaf"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#d8ccaf"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#ffffff"/><stop offset=".45" stop-color="#f2ede3"/><stop offset="1" stop-color="#c6c2ba"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M20 70Q0 360 20 670M460 70Q480 360 460 670" fill="none" stroke="#ab8551" stroke-opacity=".5"/><path d="M32 688q8-10 16 0-8 10-16 0Z" fill="none" stroke="#ab [...]
diff --git a/data/themes/shared/eternity_alert_parts.edc b/data/themes/shared/eternity_alert_parts.edc
index fd56f4a..be0f5bc 100644
--- a/data/themes/shared/eternity_alert_parts.edc
+++ b/data/themes/shared/eternity_alert_parts.edc
@@ -1,5 +1,9 @@
 part { name: "alert_glow"; type: RECT; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 0 0 0 0;
+ description { state: "default" 0.0;
+#ifdef ETERNITY_WINDOW_ALERT
+  rel.to: "background";
+#endif
+  offset_scale: 1; color: 0 0 0 0;
   rel1.offset: 16 2; rel2 { relative: 1 0; offset: -17 4; } }
  description { state: "lit" 0.0; inherit: "default" 0.0; color: BRASS; }
 }
diff --git a/data/themes/shared/eternity_common.edc b/data/themes/shared/eternity_common.edc
index f959bfd..fafa032 100644
--- a/data/themes/shared/eternity_common.edc
+++ b/data/themes/shared/eternity_common.edc
@@ -1,4 +1,5 @@
 efl_version: 1 26;
+images { image: "eternity_window_shadow.png" COMP; }
 collections {
 group { name: "eternity/tab/content";
  parts {
@@ -31,80 +32,99 @@ group { name: "eternity/tab/content";
 }
 
 group { name: "eternity/window"; min: 360 300; parts {
+part { name: "eternity.shadow"; type: IMAGE; mouse_events: 0; scale: 1;
+ description { state: "default" 0.0;
+  image.normal: "eternity_window_shadow.png";
+  image.border: 24 24 24 24; image.border_scale: 1;
+ }
+ description { state: "maximized" 0.0; inherit: "default" 0.0; visible: 0; }
+}
 part { name: "background"; type: IMAGE; mouse_events: 0; scale: 1;
  description { state: "default" 0.0; offset_scale: 1; color: 255 255 255 255;
+  rel1.offset: 5 3; rel2.offset: -6 -9;
   image { normal: "eternity_window.svg";  }
-   } }
+   }
+ description { state: "maximized" 0.0; inherit: "default" 0.0;
+  rel1.offset: 0 0; rel2.offset: -1 -1; }
+}
 part { name: "header"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; visible: 0; offset_scale: 1; color: 255 255 255 255;
+ description { state: "default" 0.0; rel.to: "background"; visible: 0; offset_scale: 1; color: 255 255 255 255;
   image { normal: "eternity_header.svg"; border: 16 16 16 16; }
   rel1.offset: 5 5; rel2 { relative: 1 0; offset: -6 49; } } }
 #include "eternity_motion_parts.edc"
+#define ETERNITY_WINDOW_ALERT
 #include "eternity_alert_parts.edc"
+#undef ETERNITY_WINDOW_ALERT
 part { name: "drag"; type: RECT; scale: 1; mouse_events: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 0 0 0 0;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: 0 0 0 0;
  rel1 { relative: 0 0; offset: 54 0; }
  rel2 { relative: 1 0; offset: -130 49; } } }
 part { name: "title"; type: TEXT; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: INK;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: INK;
  rel1 { relative: 0 0; offset: 60 0; }
  rel2 { relative: 1 0; offset: -130 49; }
  text { text: "ETERNITY"; font: TITLE_FONT; size: 14; align: 0 0.5; ellipsis: 1.0; } } }
 part { name: "menu"; type: IMAGE; scale: 1; mouse_events: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
  rel1 { relative: 0 0; offset: 8 4; }
  rel2 { relative: 0 0; offset: 48 39; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: 255 255 255 0; }
  description { state: "pressed" 0.0; inherit: "hover" 0.0; image.normal: "eternity_pressed.svg"; } }
 
 part { name: "menu-text"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: INK;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: INK;
   image { normal: "eternity_icon_menu.svg";  }
   rel1.offset: 18 14; rel2 { relative: 0 0; offset: 37 33; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: ACCENT; }
  description { state: "pressed" 0.0; inherit: "default" 0.0; color: BRASS; } }
 part { name: "minimize"; type: IMAGE; scale: 1; mouse_events: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
  rel1 { relative: 1 0; offset: -126 4; }
  rel2 { relative: 1 0; offset: -86 39; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: 255 255 255 0; }
  description { state: "pressed" 0.0; inherit: "hover" 0.0; image.normal: "eternity_pressed.svg"; } }
 
 part { name: "minimize-text"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: INK;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: INK;
   image { normal: "eternity_icon_minimize.svg";  }
   rel1 { relative: 1 0; offset: -116 14; } rel2 { relative: 1 0; offset: -97 33; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: ACCENT; }
  description { state: "pressed" 0.0; inherit: "default" 0.0; color: BRASS; } }
 part { name: "maximize"; type: IMAGE; scale: 1; mouse_events: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
  rel1 { relative: 1 0; offset: -84 4; }
  rel2 { relative: 1 0; offset: -44 39; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: 255 255 255 0; }
  description { state: "pressed" 0.0; inherit: "hover" 0.0; image.normal: "eternity_pressed.svg"; } }
 
 part { name: "maximize-text"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: INK;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: INK;
   image { normal: "eternity_icon_maximize.svg";  }
   rel1 { relative: 1 0; offset: -74 14; } rel2 { relative: 1 0; offset: -55 33; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: ACCENT; }
  description { state: "pressed" 0.0; inherit: "default" 0.0; color: BRASS; } }
 part { name: "close"; type: IMAGE; scale: 1; mouse_events: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: 255 255 255 0; image { normal: "eternity_hover.svg"; border: 10 10 10 10; }
  rel1 { relative: 1 0; offset: -42 4; }
  rel2 { relative: 1 0; offset: -2 39; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: 255 255 255 0; }
  description { state: "pressed" 0.0; inherit: "hover" 0.0; image.normal: "eternity_pressed.svg"; } }
 
 part { name: "close-text"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: INK;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: INK;
   image { normal: "eternity_icon_close.svg";  }
   rel1 { relative: 1 0; offset: -32 14; } rel2 { relative: 1 0; offset: -13 33; } }  description { state: "hover" 0.0; inherit: "default" 0.0; color: ACCENT; }
  description { state: "pressed" 0.0; inherit: "default" 0.0; color: BRASS; } }
 part { name: "eternity.content"; type: SWALLOW; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; rel1.offset: 14 64; rel2.offset: -15 -20; } }
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; rel1.offset: 14 64; rel2.offset: -15 -20; } }
 part { name: "grip"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: MUTED;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: MUTED;
   image { normal: "eternity_icon_grip.svg";  }
   rel1 { relative: 1 1; offset: -22 -22; } rel2.offset: -4 -4; } }
 part { name: "resize"; type: RECT; scale: 1; mouse_events: 1;
- description { state: "default" 0.0; offset_scale: 1; color: 0 0 0 0;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: 0 0 0 0;
  rel1 { relative: 1 1; offset: -22 -22; }
  rel2 { relative: 1 1; offset: -1 -1; } } }
 } programs {
+program { signal: "eternity,maximized"; source: "eternity";
+ action: STATE_SET "maximized" 0.0; target: "background"; target: "eternity.shadow";
+}
+program { signal: "eternity,restored"; source: "eternity";
+ action: STATE_SET "default" 0.0; target: "background"; target: "eternity.shadow";
+}
 #include "eternity_motion_programs.edc"
 #include "eternity_alert_programs.edc"
 program { signal: "mouse,up,1"; source: "close"; action: STATE_SET "hover" 0.0; target: "close-text"; transition: SINUSOIDAL 0.12; }
diff --git a/data/themes/shared/eternity_motion_parts.edc b/data/themes/shared/eternity_motion_parts.edc
index 54bf082..aba4eff 100644
--- a/data/themes/shared/eternity_motion_parts.edc
+++ b/data/themes/shared/eternity_motion_parts.edc
@@ -1,6 +1,6 @@
 /* Staggered artwork accents, following Eclair's after-program animation pattern. */
 part { name: "motion_0"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: MOTION_DIM;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: MOTION_DIM;
   image.normal: "eternity_motion.svg";
   rel1 { relative: 0 0; offset: 160 23; } rel2 { relative: 0 0; offset: 168 31; } }
  description { state: "lit" 0.0; inherit: "default" 0.0; color: MOTION_LIT;
@@ -8,7 +8,7 @@ part { name: "motion_0"; type: IMAGE; mouse_events: 0; scale: 1;
   rel2.offset: (168 + MOTION_DX) (31 + MOTION_DY); }
 }
 part { name: "motion_1"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: MOTION_DIM;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: MOTION_DIM;
   image.normal: "eternity_motion.svg";
   rel1 { relative: 0 0; offset: 174 23; } rel2 { relative: 0 0; offset: 182 31; } }
  description { state: "lit" 0.0; inherit: "default" 0.0; color: MOTION_LIT;
@@ -16,7 +16,7 @@ part { name: "motion_1"; type: IMAGE; mouse_events: 0; scale: 1;
   rel2.offset: (182 + MOTION_DX) (31 + MOTION_DY); }
 }
 part { name: "motion_2"; type: IMAGE; mouse_events: 0; scale: 1;
- description { state: "default" 0.0; offset_scale: 1; color: MOTION_DIM;
+ description { state: "default" 0.0; rel.to: "background"; offset_scale: 1; color: MOTION_DIM;
   image.normal: "eternity_motion.svg";
   rel1 { relative: 0 0; offset: 188 23; } rel2 { relative: 0 0; offset: 196 31; } }
  description { state: "lit" 0.0; inherit: "default" 0.0; color: MOTION_LIT;
diff --git a/data/themes/shared/eternity_window_shadow.png b/data/themes/shared/eternity_window_shadow.png
new file mode 100644
index 0000000..6c2e5f1
Binary files /dev/null and b/data/themes/shared/eternity_window_shadow.png differ
diff --git a/data/themes/undertow/eternity_window.svg b/data/themes/undertow/eternity_window.svg
index 04d75d9..3f98cca 100644
--- a/data/themes/undertow/eternity_window.svg
+++ b/data/themes/undertow/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#1c444d"/><stop offset=".45" stop-color="#091d2a"/><stop offset="1" stop-color="#071822"/></linearGradient></defs><rect width="480" height="720" fill="#193d45"/><rect x=".5" y=".5" width="479" height="719" fill="#193d45" stroke="#446b71"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#446b71"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#1c444d"/><stop offset=".45" stop-color="#091d2a"/><stop offset="1" stop-color="#071822"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M14 66h452M14 682h452" stroke="#446b71"/><path d="M11 90h4m450 0h4" stroke="#82a7a5" stroke-opacity=".4"/><path d="M11 102h4m450 0h4" stroke="#82a7a5" strok [...]
diff --git a/data/themes/voltage/eternity_window.svg b/data/themes/voltage/eternity_window.svg
index ffc2836..e762a36 100644
--- a/data/themes/voltage/eternity_window.svg
+++ b/data/themes/voltage/eternity_window.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#1a1d32"/><stop offset=".45" stop-color="#0a1020"/><stop offset="1" stop-color="#080d1a"/></linearGradient></defs><rect width="480" height="720" fill="#171a2d"/><rect x=".5" y=".5" width="479" height="719" fill="#171a2d" stroke="#4d9798"/><rect x="8" y="8" width="464" height="704" rx="0" fill="url(#case_depth)" stroke="#4d9798"/><pat [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="480" height="720" viewBox="0 0 480 720"><defs><linearGradient id="case_depth" x2="1" y2="1"><stop stop-color="#1a1d32"/><stop offset=".45" stop-color="#0a1020"/><stop offset="1" stop-color="#080d1a"/></linearGradient></defs><rect width="480" height="720" fill="url(#case_depth)"/><path d="M12 60h105l10-6h60M467 78v104l-6 7v126M15 460v120l10 10v83h100l9-8h58" fill="none" stroke="#5bd9d1"/><path d="M5 88v42m470 460v80l-20 20h-54" fill="none" st [...]
diff --git a/meson.build b/meson.build
index b388667..421dfe2 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
 project('eternity', 'c', version: '0.1.0', meson_version: '>=0.61',
         default_options: ['c_std=gnu99', 'warning_level=2'])
-deps = [dependency('elementary'), dependency('eet'), dependency('ecore-file'), dependency('efreet')]
+deps = [dependency('elementary'), dependency('eet'), dependency('ecore-file'), dependency('ecore-evas'), dependency('efreet')]
 deps += meson.get_compiler('c').find_library('m')
 deps += dependency('intl')
 i18n = import('i18n')
diff --git a/src/lib/eternity.h b/src/lib/eternity.h
index e244440..9c111b8 100644
--- a/src/lib/eternity.h
+++ b/src/lib/eternity.h
@@ -86,6 +86,10 @@ void
 eternity_about_show(void *data, Evas_Object *obj, void *info);
 char *
 eternity_theme_path_get(const char *name);
+void
+eternity_theme_shadow_geometry_update(void *data, Evas *canvas, Evas_Object *frame, void *event);
+void
+eternity_theme_window_state_update(void *data, Evas_Object *window, void *event);
 Eina_Bool
 eternity_theme_set(Eternity *app, const char *name);
 #endif
diff --git a/src/lib/eternity_theme.c b/src/lib/eternity_theme.c
index 577faec..779d4ea 100644
--- a/src/lib/eternity_theme.c
+++ b/src/lib/eternity_theme.c
@@ -1,8 +1,46 @@
 #include "eternity.h"
+#include <Ecore_Evas.h>
 #include <Ecore_File.h>
 #include <stdlib.h>
 #include <string.h>
 
+void
+eternity_theme_shadow_geometry_update(void *data EINA_UNUSED, Evas *canvas,
+                                      Evas_Object *frame, void *event EINA_UNUSED)
+{
+   Ecore_Evas *surface = ecore_evas_ecore_evas_get(canvas);
+   Evas_Object *edje = elm_layout_edje_get(frame);
+   Evas_Coord x, y, width, height, body_width, body_height;
+
+   if (!surface) return;
+   if (!edje_object_part_exists(edje, "eternity.shadow"))
+      {
+         ecore_evas_shadow_geometry_set(surface, 0, 0, 0, 0);
+         return;
+      }
+
+   edje_object_calc_force(edje);
+   evas_object_geometry_get(edje, NULL, NULL, &width, &height);
+   if (edje_object_part_geometry_get(edje, "background", &x, &y, &body_width, &body_height) &&
+       x >= 0 && y >= 0 && body_width > 0 && body_height > 0 &&
+       width >= x + body_width && height >= y + body_height)
+      ecore_evas_shadow_geometry_set(surface, x, width - x - body_width,
+                                    y, height - y - body_height);
+}
+
+void
+eternity_theme_window_state_update(void *data, Evas_Object *window, void *event EINA_UNUSED)
+{
+   Eternity *app = data;
+   Evas_Object *edje = elm_layout_edje_get(app->frame);
+
+   elm_win_alpha_set(window, edje_object_part_exists(edje, "eternity.shadow"));
+   elm_layout_signal_emit(app->frame, elm_win_maximized_get(window) ?
+                          "eternity,maximized" : "eternity,restored", "eternity");
+   edje_object_message_signal_process(edje);
+   eternity_theme_shadow_geometry_update(NULL, evas_object_evas_get(app->frame), app->frame, NULL);
+}
+
 static const Eternity_Theme_Info _eternity_themes[]
     = { { "midnight", N_("Midnight"), "eternity/moon" },
         { "porcelain", N_("Porcelain"), "eternity/leaf" },
@@ -77,6 +115,7 @@ eternity_theme_set(Eternity *app, const char *name)
          return EINA_FALSE;
       }
 
+   eternity_theme_window_state_update(app, app->win, NULL);
    elm_theme_extension_del(app->theme, app->theme_path);
    elm_theme_extension_add(app->theme, path);
    free(app->theme_path);
diff --git a/src/lib/eternity_ui.c b/src/lib/eternity_ui.c
index c077d4e..643beff 100644
--- a/src/lib/eternity_ui.c
+++ b/src/lib/eternity_ui.c
@@ -319,7 +319,8 @@ eternity_ui_add(Eternity *app)
          return EINA_FALSE;
       }
 
-   app->win = elm_win_util_standard_add("eternity", "Eternity");
+   /* The themed shadow needs a transparent canvas behind the frame. */
+   app->win = elm_win_add(NULL, "eternity", ELM_WIN_BASIC);
    if (!app->win)
       {
          free(app->theme_path);
@@ -327,6 +328,8 @@ eternity_ui_add(Eternity *app)
          return EINA_FALSE;
       }
 
+   elm_win_title_set(app->win, "Eternity");
+
    icon = elm_icon_add(app->win);
    if (elm_icon_standard_set(icon, "eternity")
        || elm_image_file_set(icon, ETERNITY_ICON_FILE, NULL))
@@ -356,6 +359,12 @@ eternity_ui_add(Eternity *app)
    elm_win_resize_object_add(app->win, app->frame);
    elm_layout_signal_callback_add(app->frame, "eternity,*", "*", _eternity_ui_window_signal, app);
 
+   evas_object_event_callback_add(app->frame, EVAS_CALLBACK_RESIZE,
+                                  eternity_theme_shadow_geometry_update, NULL);
+   evas_object_smart_callback_add(app->win, "maximized", eternity_theme_window_state_update, app);
+   evas_object_smart_callback_add(app->win, "unmaximized", eternity_theme_window_state_update, app);
+   eternity_theme_window_state_update(app, app->win, NULL);
+
    app->root = elm_box_add(app->frame);
    elm_box_padding_set(app->root, 0, ELM_SCALE_SIZE(8));
    evas_object_size_hint_weight_set(app->root, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/tests/eternity_render_test.c b/tests/eternity_render_test.c
index 3513d7a..cebf944 100644
--- a/tests/eternity_render_test.c
+++ b/tests/eternity_render_test.c
@@ -39,19 +39,43 @@ _eternity_test_square_frame(const char *theme)
    Ecore_Evas *buffer = ecore_evas_buffer_new(240, 240);
    Evas_Object *frame = edje_object_add(ecore_evas_get(buffer));
    const unsigned int *pixels;
+   int x, y, w, h;
 
+   ecore_evas_alpha_set(buffer, EINA_TRUE);
    assert(edje_object_file_set(frame, theme, "eternity/window"));
    evas_object_resize(frame, 240, 240);
    evas_object_show(frame);
    ecore_evas_manual_render(buffer);
 
    pixels = ecore_evas_buffer_pixels_get(buffer);
+   assert(pixels);
+   assert(edje_object_part_geometry_get(frame, "background", &x, &y, &w, &h));
+   assert(x == 5 && y == 3 && w == 230 && h == 229);
+   assert((pixels[0] >> 24) < 255);
+   assert((pixels[y * 240] >> 24) < 255);
+   /* The bottom shadow fades from the case to the transparent canvas edge. */
+   assert((pixels[(y + h) * 240 + 120] >> 24) >
+          (pixels[(y + h + 4) * 240 + 120] >> 24));
+   assert((pixels[(y + h + 4) * 240 + 120] >> 24) > 0);
+   assert((pixels[239 * 240 + 120] >> 24) == 0);
+   /* The case still fills its own corners. */
+   assert((pixels[y * 240 + x] >> 24) == 255);
+   assert((pixels[y * 240 + x + w - 1] >> 24) == 255);
+   assert((pixels[(y + h - 1) * 240 + x] >> 24) == 255);
+   assert((pixels[(y + h - 1) * 240 + x + w - 1] >> 24) == 255);
 
-   /* The case fills its corners; a rounded or chamfered outer case fails. */
+   edje_object_signal_emit(frame, "eternity,maximized", "eternity");
+   edje_object_message_signal_process(frame);
+   ecore_evas_manual_render(buffer);
    assert((pixels[0] >> 24) == 255);
-   assert((pixels[239] >> 24) == 255);
-   assert((pixels[239 * 240] >> 24) == 255);
    assert((pixels[240 * 240 - 1] >> 24) == 255);
+
+   edje_object_signal_emit(frame, "eternity,restored", "eternity");
+   edje_object_message_signal_process(frame);
+   ecore_evas_manual_render(buffer);
+   assert((pixels[(y + h) * 240 + 120] >> 24) > 0);
+   assert((pixels[239 * 240 + 120] >> 24) == 0);
+
    ecore_evas_free(buffer);
 }
 

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

Reply via email to