This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch main
in repository entrance.
View the commit online.
commit d65a07e646860fa1148ebecde3439543f06de10c
Author: Alastair Poole <[email protected]>
AuthorDate: Sun Nov 29 05:43:27 2026 +0000
beautiful.
---
data/themes/atelier/theme.edc | 1 +
data/themes/clock/clock-shadow.png | Bin 0 -> 54852 bytes
data/themes/crazy_lab/theme.edc | 1 +
data/themes/elementary/meson.build | 2 +-
data/themes/elementary/theme.edc | 4 +
data/themes/gadget-daylight.edc | 2 +-
data/themes/gadget-logger.edc | 78 +++++++++++++-
data/themes/gadget-music.edc | 2 +-
data/themes/gadget-notes.edc | 5 +-
data/themes/gadget-sports.edc | 12 ++-
data/themes/gadget-sysinfo.edc | 2 +-
data/themes/gadget-updates.edc | 17 +--
data/themes/gadget-weather.edc | 2 +-
data/themes/greeter-controls.edc | 32 +++++-
data/themes/greeter-parts.edc | 57 +++++++---
data/themes/meson.build | 3 +-
data/themes/midnight/theme.edc | 1 +
data/themes/observatory/theme.edc | 1 +
data/themes/surfaces/gadget-shadow.png | Bin 0 -> 4684 bytes
src/greeter/gadgets/gadgets.c | 52 ++++++++-
src/greeter/gadgets/gadgets.h | 14 +++
src/greeter/gadgets/modules/clock/clock.c | 35 +++---
src/greeter/gadgets/modules/logger/logger.c | 77 +++++++++++--
src/greeter/gadgets/modules/music/music.c | 20 +++-
src/greeter/gadgets/modules/notes/notes.c | 72 +++++++++++--
src/greeter/gadgets/modules/sports/scoreboard.c | 40 +++++--
src/greeter/gadgets/modules/sports/sports.c | 37 ++++---
src/greeter/gadgets/modules/sports/sports.h | 2 +-
src/greeter/gadgets/modules/updates/updates.c | 15 ++-
src/greeter/screensaver/scenes.c | 137 +++++++++++++++++-------
30 files changed, 573 insertions(+), 150 deletions(-)
diff --git a/data/themes/atelier/theme.edc b/data/themes/atelier/theme.edc
index 2d44a7c..64929e6 100644
--- a/data/themes/atelier/theme.edc
+++ b/data/themes/atelier/theme.edc
@@ -29,4 +29,5 @@
#define CLOCK_INNER_RADIUS 79
#define CLOCK_DIAL "eternity_folio_dial.svg"
#define CLOCK_LEFT
+#define LOGGER_TEXT_STYLE "font=Monospace font_size=11 color=#2b3939 wrap=mixed"
#include "../greeter-parts.edc"
diff --git a/data/themes/clock/clock-shadow.png b/data/themes/clock/clock-shadow.png
new file mode 100644
index 0000000..7764663
Binary files /dev/null and b/data/themes/clock/clock-shadow.png differ
diff --git a/data/themes/crazy_lab/theme.edc b/data/themes/crazy_lab/theme.edc
index 488fcbe..ecc3b30 100644
--- a/data/themes/crazy_lab/theme.edc
+++ b/data/themes/crazy_lab/theme.edc
@@ -29,4 +29,5 @@
#define CLOCK_INNER_RADIUS 76
#define CLOCK_DIAL "eternity_frequency_dial.svg"
#define CLOCK_RIGHT
+#define LOGGER_TEXT_STYLE "font=Monospace font_size=11 color=#e8d8ae wrap=mixed"
#include "../greeter-parts.edc"
diff --git a/data/themes/elementary/meson.build b/data/themes/elementary/meson.build
index 439cc74..5870a0f 100644
--- a/data/themes/elementary/meson.build
+++ b/data/themes/elementary/meson.build
@@ -1,7 +1,7 @@
theme_install = entrance_data / 'themes/elementary'
custom_target('elementary-theme', input: 'theme.edc', output: 'theme.edj',
command: [edje_cc, '-id', meson.current_source_dir(), '-id', theme_image_dir, '@INPUT@', '@OUTPUT@'],
- depend_files: theme_parts + files('enlightenment.svg', '../surfaces/curve-12.png', '../surfaces/ring-6.png'),
+ depend_files: theme_parts + theme_surfaces + files('enlightenment.svg'),
install: true, install_dir: theme_install, install_mode: 'rw-r--r--'
)
install_data('metadata.desktop', 'README', 'LICENSE.logo', install_dir: theme_install)
diff --git a/data/themes/elementary/theme.edc b/data/themes/elementary/theme.edc
index 11b2ed0..05840d7 100644
--- a/data/themes/elementary/theme.edc
+++ b/data/themes/elementary/theme.edc
@@ -1,6 +1,10 @@
#define WALL 28 31 35 255
+#define EDGE 66 72 80 255
+#define MUTE 166 174 184 255
+#define CONTROL 62 68 76 255
#define PANEL_SIZE 560 610
#define E_WALLPAPER
#define E_LOGO
#define NATIVE_FORM
+#define LOGGER_TEXT_STYLE "font=Monospace font_size=11 color=#e4e8ee wrap=mixed"
#include "../greeter-parts.edc"
diff --git a/data/themes/gadget-daylight.edc b/data/themes/gadget-daylight.edc
index da1c5b7..3e95412 100644
--- a/data/themes/gadget-daylight.edc
+++ b/data/themes/gadget-daylight.edc
@@ -32,7 +32,7 @@ group { name: "entrance/gadgets/daylight";
item: "edge" DAY_DATA(DAY_EDGE);
}
parts {
- GADGET_SHADOW(DAY_FACE, DAY_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: DAY_EDGE;
image { normal: DAY_FACE; border: DAY_RADIUS; }
diff --git a/data/themes/gadget-logger.edc b/data/themes/gadget-logger.edc
index b9d0d95..0dd9958 100644
--- a/data/themes/gadget-logger.edc
+++ b/data/themes/gadget-logger.edc
@@ -1,3 +1,8 @@
+#ifndef WELL
+#define LOGGER_WELL 21 24 28 255
+#else
+#define LOGGER_WELL WELL
+#endif
#ifdef THEMED_CONTROLS
#define LOGGER_FACE CONTROL_STENCIL
#define LOGGER_RADIUS CONTROL_RADIUS
@@ -16,7 +21,7 @@
group { name: "entrance/gadgets/logger";
parts {
- GADGET_SHADOW(LOGGER_FACE, LOGGER_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: LOGGER_EDGE;
image { normal: LOGGER_FACE; border: LOGGER_RADIUS; }
@@ -65,11 +70,19 @@ group { name: "entrance/gadgets/logger";
rel2 { relative: 1 0; offset: -15 56; }
}
}
- part { name: "logger.messages"; type: SWALLOW;
- description { state: "default" 0.0;
- rel1.offset: 10 63; rel2.offset: -11 -11;
+ part { name: "logger.well"; type: IMAGE; mouse_events: 0;
+ description { state: "default" 0.0; color: LOGGER_WELL;
+ rel1.offset: 10 63; rel2.offset: -11 -24;
+ image { normal: LOGGER_FACE; border: LOGGER_RADIUS; }
}
}
+ part { name: "logger.messages"; type: SWALLOW;
+ description { state: "default" 0.0;
+ rel.to: "logger.well";
+ rel1.offset: 7 6; rel2.offset: -8 -7;
+ }
+ }
+ GADGET_RESIZE_HANDLE
}
}
@@ -79,3 +92,60 @@ group { name: "entrance/gadgets/logger";
#undef LOGGER_INK
#undef LOGGER_EDGE
#undef LOGGER_ACCENT
+
+group { name: "elm/entry/base-noedit-mixedwrap/entrance-log";
+ styles {
+ style { name: "log_text";
+ base: LOGGER_TEXT_STYLE;
+ tag: "br" "\n";
+ }
+ }
+ parts {
+ part { name: "elm.text"; type: TEXTBLOCK; scale: 1;
+ entry_mode: PLAIN; select_mode: DEFAULT; multiline: 1;
+ source: "entrance/log/selection";
+ description { state: "default" 0.0; fixed: 1 0;
+ text { style: "log_text"; min: 0 1; align: 0.0 0.0; }
+ }
+ }
+ }
+}
+group { name: "elm/scroller/entry/entrance-log";
+ parts {
+ part { name: "viewport"; type: RECT; mouse_events: 0;
+ description { state: "default" 0.0; }
+ }
+ part { name: "elm.swallow.content"; type: SWALLOW; clip_to: "viewport";
+ description { state: "default" 0.0; rel2.offset: -9 -1; }
+ }
+ part { name: "track"; type: RECT; mouse_events: 0; scale: 1;
+ description { state: "default" 0.0; color: EDGE;
+ rel1.relative: 1.0 0.0; rel1.offset: -5 0;
+ }
+ }
+ part { name: "elm.dragable.vbar"; type: RECT; scale: 1;
+ dragable { x: 0 0 0; y: 1 1 0; confine: "track"; }
+ description { state: "default" 0.0; color: MUTE;
+ rel.to: "track"; min: 0 12; visible: 0;
+ }
+ description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; }
+ }
+ }
+ programs {
+ program { signal: "elm,action,show,vbar"; source: "elm";
+ action: STATE_SET "visible" 0.0; target: "elm.dragable.vbar";
+ }
+ program { signal: "elm,action,hide,vbar"; source: "elm";
+ action: STATE_SET "default" 0.0; target: "elm.dragable.vbar";
+ }
+ }
+}
+group { name: "entrance/log/selection";
+ parts {
+ part { name: "selection"; type: RECT; mouse_events: 0;
+ description { state: "default" 0.0; color: CONTROL; }
+ }
+ }
+}
+
+#undef LOGGER_WELL
diff --git a/data/themes/gadget-music.edc b/data/themes/gadget-music.edc
index 4f681f7..67690e5 100644
--- a/data/themes/gadget-music.edc
+++ b/data/themes/gadget-music.edc
@@ -44,7 +44,7 @@
}
group { name: "entrance/gadgets/music";
parts {
- GADGET_SHADOW(MUSIC_FACE, MUSIC_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: MUSIC_EDGE;
rel2.relative: 0.99 0.98;
diff --git a/data/themes/gadget-notes.edc b/data/themes/gadget-notes.edc
index bd8bbca..164d854 100644
--- a/data/themes/gadget-notes.edc
+++ b/data/themes/gadget-notes.edc
@@ -43,7 +43,7 @@
group { name: "entrance/gadgets/note";
data.item: "ink" NOTE_INK_HEX;
parts {
- GADGET_SHADOW(NOTE_FACE, NOTE_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: NOTE_EDGE;
image { normal: NOTE_FACE; border: NOTE_RADIUS; }
@@ -94,9 +94,10 @@ group { name: "entrance/gadgets/note";
}
part { name: "note.text"; type: SWALLOW;
description { state: "default" 0.0;
- rel1.relative: 0.085 0.223; rel2.relative: 0.956 0.945;
+ rel1.relative: 0.085 0.223; rel2.relative: 0.956 1.0; rel2.offset: -1 -24;
}
}
+ GADGET_RESIZE_HANDLE
}
}
diff --git a/data/themes/gadget-sports.edc b/data/themes/gadget-sports.edc
index d0641ea..96d8d8a 100644
--- a/data/themes/gadget-sports.edc
+++ b/data/themes/gadget-sports.edc
@@ -27,7 +27,7 @@
group { name: "entrance/gadgets/sports";
parts {
- GADGET_SHADOW(SCORE_FACE, SCORE_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: SCORE_EDGE;
image { normal: SCORE_FACE; border: SCORE_RADIUS; }
@@ -51,14 +51,16 @@ group { name: "entrance/gadgets/sports";
rel2.relative: 1 0.155;
}
}
- part { name: "sports.country"; type: SWALLOW;
+ part { name: "sports.country"; type: SWALLOW; scale: 1;
description { state: "default" 0.0;
- rel1.relative: 0.04 0.17; rel2.relative: 0.46 0.273;
+ rel1.relative: 0.04 0.17; rel2.relative: 0.49 0.273;
+ max: -1 36;
}
}
- part { name: "sports.league"; type: SWALLOW;
+ part { name: "sports.league"; type: SWALLOW; scale: 1;
description { state: "default" 0.0;
- rel1.relative: 0.48 0.17; rel2.relative: 0.96 0.273;
+ rel1.relative: 0.51 0.17; rel2.relative: 0.96 0.273;
+ max: -1 36;
}
}
part { name: "sports.scores"; type: SWALLOW;
diff --git a/data/themes/gadget-sysinfo.edc b/data/themes/gadget-sysinfo.edc
index 3462946..676a4a5 100644
--- a/data/themes/gadget-sysinfo.edc
+++ b/data/themes/gadget-sysinfo.edc
@@ -40,7 +40,7 @@
group { name: "entrance/gadgets/sysinfo";
parts {
- GADGET_SHADOW(SYSINFO_FACE, SYSINFO_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: SYSINFO_EDGE;
rel2.relative: 0.99 0.98;
diff --git a/data/themes/gadget-updates.edc b/data/themes/gadget-updates.edc
index 49e873b..4c6366b 100644
--- a/data/themes/gadget-updates.edc
+++ b/data/themes/gadget-updates.edc
@@ -22,8 +22,13 @@
text { font: UPDATE_FONT; size: SIZE; align: ALIGN 0.5; fit: 1 1; size_range: 8 SIZE; } \
} \
}
-#define UPDATE_SLOT(NAME, X1, Y1, X2, Y2) \
- part { name: NAME; type: SWALLOW; \
+#define UPDATE_SLOT(NAME, CLIP, X1, Y1, X2, Y2) \
+ part { name: CLIP; type: RECT; mouse_events: 0; \
+ description { state: "default" 0.0; \
+ rel1.relative: X1 Y1; rel2.relative: X2 Y2; \
+ } \
+ } \
+ part { name: NAME; type: SWALLOW; clip_to: CLIP; \
description { state: "default" 0.0; \
rel1.relative: X1 Y1; rel2.relative: X2 Y2; \
} \
@@ -31,7 +36,7 @@
group { name: "entrance/gadgets/updates";
parts {
- GADGET_SHADOW(UPDATE_FACE, UPDATE_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: UPDATE_EDGE;
image { normal: UPDATE_FACE; border: UPDATE_RADIUS; }
@@ -100,9 +105,9 @@ group { name: "entrance/gadgets/updates";
}
}
UPDATE_TEXT("updates.percent", 11, UPDATE_INK, 0.79, 0.595, 0.93, 0.705, 1)
- UPDATE_SLOT("updates.check", 0.04, 0.78, 0.33, 0.945)
- UPDATE_SLOT("updates.download", 0.35, 0.78, 0.65, 0.945)
- UPDATE_SLOT("updates.restart", 0.67, 0.78, 0.96, 0.945)
+ UPDATE_SLOT("updates.check", "updates.check.clip", 0.04, 0.78, 0.33, 0.945)
+ UPDATE_SLOT("updates.download", "updates.download.clip", 0.35, 0.78, 0.65, 0.945)
+ UPDATE_SLOT("updates.restart", "updates.restart.clip", 0.67, 0.78, 0.96, 0.945)
}
programs {
program { signal: "progress,stop"; source: "entrance";
diff --git a/data/themes/gadget-weather.edc b/data/themes/gadget-weather.edc
index 237c3df..4ff3f99 100644
--- a/data/themes/gadget-weather.edc
+++ b/data/themes/gadget-weather.edc
@@ -59,7 +59,7 @@ images.image: WEATHER_FACE COMP;
group { name: "entrance/gadgets/weather";
parts {
- GADGET_SHADOW(WEATHER_FACE, WEATHER_RADIUS)
+ GADGET_SHADOW
part { name: "rim"; type: IMAGE; mouse_events: 0;
description { state: "default" 0.0; color: WEATHER_EDGE;
rel2.relative: 0.99 0.98;
diff --git a/data/themes/greeter-controls.edc b/data/themes/greeter-controls.edc
index 46510cb..c2a0588 100644
--- a/data/themes/greeter-controls.edc
+++ b/data/themes/greeter-controls.edc
@@ -262,10 +262,15 @@ group { name: "elm/button/base/hoversel_vertical_entry/entrance-session";
}
}
group { name: "elm/hover/base/hoversel_vertical/entrance-session";
+ data.item: "dismiss" "on";
parts {
- part { name: "outside"; type: RECT;
+ part { name: "outside"; type: RECT; ignore_flags: ON_HOLD;
description { state: "default" 0.0; color: 0 0 0 0; }
}
+ part { name: "menu-opacity"; type: RECT; mouse_events: 0;
+ description { state: "default" 0.0; color: 255 255 255 255; }
+ description { state: "hidden" 0.0; color: 255 255 255 0; }
+ }
part { name: "elm.swallow.offset"; type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 1; align: 0.0 0.0;
@@ -278,14 +283,14 @@ group { name: "elm/hover/base/hoversel_vertical/entrance-session";
rel.to: "elm.swallow.offset"; rel1.relative: 1.0 1.0;
}
}
- part { name: "elm.swallow.slot.top"; type: SWALLOW;
+ part { name: "elm.swallow.slot.top"; type: SWALLOW; clip_to: "menu-opacity";
description { state: "default" 0.0;
fixed: 0 1; align: 0.0 1.0;
rel.to: "elm.swallow.size";
rel2.relative: 1.0 0.0; rel2.offset: -1 -3;
}
}
- part { name: "elm.swallow.slot.bottom"; type: SWALLOW;
+ part { name: "elm.swallow.slot.bottom"; type: SWALLOW; clip_to: "menu-opacity";
description { state: "default" 0.0;
fixed: 0 1; align: 0.0 0.0;
rel.to: "elm.swallow.size";
@@ -294,13 +299,32 @@ group { name: "elm/hover/base/hoversel_vertical/entrance-session";
}
}
programs {
- program { signal: "mouse,up,1"; source: "outside";
+ program { signal: "mouse,clicked,1"; source: "outside";
action: SIGNAL_EMIT "elm,action,dismiss" "elm";
}
+ program { signal: "elm,action,hide"; source: "elm";
+ action: STATE_SET "hidden" 0.0; target: "menu-opacity";
+ transition: DECELERATE 0.12;
+ after: "dismiss-finished";
+ }
+ program { name: "dismiss-finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
+ }
}
}
group { name: "elm/button/base/hoversel_vertical/entrance-radio";
inherit: "elm/button/base/hoversel_vertical/entrance-session";
+ parts {
+ part { name: "elm.text";
+ description { state: "default" 0.0;
+ text { fit: 1 0; size_range: 8 13; min: 0 1; ellipsis: -1; }
+ }
+ description { state: "pressed" 0.0; inherit: "default" 0.0;
+ rel1.offset: 12 6; rel2.offset: -36 -5;
+ }
+ description { state: "disabled" 0.0; inherit: "default" 0.0; color: MUTE; }
+ }
+ }
}
group { name: "elm/button/base/hoversel_vertical_entry/entrance-radio";
inherit: "elm/button/base/hoversel_vertical_entry/entrance-session";
diff --git a/data/themes/greeter-parts.edc b/data/themes/greeter-parts.edc
index 4f0ecf4..3ee1e77 100644
--- a/data/themes/greeter-parts.edc
+++ b/data/themes/greeter-parts.edc
@@ -33,6 +33,7 @@ images {
#ifdef CLOCK_DIAL
images {
+ image: "clock-shadow.png" COMP;
vector: CLOCK_DIAL;
vector: "eternity_hour.svg";
vector: "eternity_minute.svg";
@@ -58,26 +59,44 @@ color_classes {
}
#endif
-/* Stack translucent silhouettes with a longer falloff below the card. */
-#define GADGET_SHADOW_LAYER(NAME, FACE, RADIUS, ALPHA, LEFT, TOP, RIGHT, BOTTOM) \
- part { name: NAME; type: IMAGE; mouse_events: 0; scale: 1; \
- description { state: "default" 0.0; color: 0 0 0 ALPHA; offset_scale: 1; \
- rel.to: "rim"; rel1.offset: LEFT TOP; rel2.offset: RIGHT BOTTOM; \
- image { normal: FACE; border: RADIUS; } \
+images.image: "gadget-shadow.png" COMP;
+
+/* Contact and cast shadows baked at 2× for the gadget cards. */
+
+#define GADGET_SHADOW \
+ part { name: "shadow"; type: IMAGE; mouse_events: 0; scale: 1; \
+ description { state: "default" 0.0; rel.to: "rim"; offset_scale: 1; \
+ rel1.offset: -20 -20; rel2.offset: 19 19; \
+ image.normal: "gadget-shadow.png"; \
+ image.border: 60 60 60 60; \
+ image.border_scale: 1; image.border_scale_by: 0.5; \
+ image.middle: NONE; \
} \
}
-#define GADGET_SHADOW(FACE, RADIUS) \
- GADGET_SHADOW_LAYER("shadow.outer", FACE, RADIUS, 5, -10, -5, 9, 15) \
- GADGET_SHADOW_LAYER("shadow.fade", FACE, RADIUS, 10, -8, -4, 7, 12) \
- GADGET_SHADOW_LAYER("shadow.middle", FACE, RADIUS, 17, -6, -3, 5, 9) \
- GADGET_SHADOW_LAYER("shadow.inner", FACE, RADIUS, 26, -4, -2, 3, 6) \
- GADGET_SHADOW_LAYER("shadow.edge", FACE, RADIUS, 38, -2, -1, 1, 3)
-
#if defined(NATIVE_FORM) || !defined(THEMED_CONTROLS)
images.image: "ring-6.png" COMP;
#endif
+#define RESIZE_DOT(NAME, X1, Y1, X2, Y2) \
+ part { name: NAME; type: RECT; mouse_events: 0; \
+ description { state: "default" 0.0; color: MUTE; \
+ rel1.relative: 1.0 1.0; rel1.offset: X1 Y1; \
+ rel2.offset: X2 Y2; \
+ } \
+ }
+
+#define GADGET_RESIZE_HANDLE \
+ RESIZE_DOT("entrance.resize.top", -8, -17, -6, -15) \
+ RESIZE_DOT("entrance.resize.middle", -8, -12, -6, -10) \
+ RESIZE_DOT("entrance.resize.left", -13, -7, -11, -5) \
+ RESIZE_DOT("entrance.resize.bottom", -8, -7, -6, -5) \
+ part { name: "entrance.resize"; type: RECT; mouse_events: 1; \
+ description { state: "default" 0.0; color: 0 0 0 0; \
+ rel1.relative: 1.0 1.0; rel1.offset: -24 -24; \
+ } \
+ }
+
collections {
#include "gadget-weather.edc"
#include "gadget-sysinfo.edc"
@@ -88,7 +107,8 @@ collections {
#include "gadget-updates.edc"
#include "gadget-notes.edc"
#undef GADGET_SHADOW
- #undef GADGET_SHADOW_LAYER
+ #undef GADGET_RESIZE_HANDLE
+ #undef RESIZE_DOT
#ifdef THEME_SOUNDS
sounds {
sample { name: "entrance-key-tap" RAW; source: "key-tap.wav"; }
@@ -384,6 +404,15 @@ collections {
#endif
}
#ifdef CLOCK_DIAL
+ group { name: "entrance/clock/shadow";
+ parts {
+ part { name: "shadow"; type: IMAGE; mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "clock-shadow.png";
+ }
+ }
+ }
+ }
#include "clock/artwork.edc"
#endif
#ifdef THEMED_CONTROLS
diff --git a/data/themes/meson.build b/data/themes/meson.build
index 312551d..645866d 100644
--- a/data/themes/meson.build
+++ b/data/themes/meson.build
@@ -1,6 +1,6 @@
theme_parts = files('greeter-parts.edc', 'greeter-controls.edc', 'gadget-weather.edc', 'gadget-sysinfo.edc', 'gadget-music.edc', 'gadget-logger.edc', 'gadget-daylight.edc', 'gadget-sports.edc', 'gadget-updates.edc', 'gadget-notes.edc')
clock_image_dir = meson.current_source_dir() / 'clock'
-clock_sources = files('clock/artwork.edc', 'clock/eternity_hour.svg',
+clock_sources = files('clock/artwork.edc', 'clock/clock-shadow.png', 'clock/eternity_hour.svg',
'clock/eternity_minute.svg', 'clock/eternity_second.svg', 'clock/eternity_pin.svg')
theme_surfaces = files([
'surfaces/curve-4.png',
@@ -8,6 +8,7 @@ theme_surfaces = files([
'surfaces/curve-10.png',
'surfaces/curve-12.png',
'surfaces/ring-6.png',
+ 'surfaces/gadget-shadow.png',
'surfaces/button-glow.svg',
'surfaces/background-light.svg',
'surfaces/field-glow-6.svg',
diff --git a/data/themes/midnight/theme.edc b/data/themes/midnight/theme.edc
index 8e8abb0..7eface5 100644
--- a/data/themes/midnight/theme.edc
+++ b/data/themes/midnight/theme.edc
@@ -29,4 +29,5 @@
#define CLOCK_INNER_RADIUS 79
#define CLOCK_DIAL "eternity_elaro-midnight_dial.svg"
#define CLOCK_RIGHT
+#define LOGGER_TEXT_STYLE "font=Monospace font_size=11 color=#e0e9f8 wrap=mixed"
#include "../greeter-parts.edc"
diff --git a/data/themes/observatory/theme.edc b/data/themes/observatory/theme.edc
index 2a64ba1..df1a361 100644
--- a/data/themes/observatory/theme.edc
+++ b/data/themes/observatory/theme.edc
@@ -29,4 +29,5 @@
#define CLOCK_INNER_RADIUS 76
#define CLOCK_DIAL "eternity_undertow_dial.svg"
#define CLOCK_LEFT
+#define LOGGER_TEXT_STYLE "font=Monospace font_size=11 color=#e1ecf5 wrap=mixed"
#include "../greeter-parts.edc"
diff --git a/data/themes/surfaces/gadget-shadow.png b/data/themes/surfaces/gadget-shadow.png
new file mode 100644
index 0000000..5efe978
Binary files /dev/null and b/data/themes/surfaces/gadget-shadow.png differ
diff --git a/src/greeter/gadgets/gadgets.c b/src/greeter/gadgets/gadgets.c
index 7bc5dfb..b349e4c 100644
--- a/src/greeter/gadgets/gadgets.c
+++ b/src/greeter/gadgets/gadgets.c
@@ -17,6 +17,56 @@
#include <stdio.h>
#include <stdlib.h>
+Eina_Bool
+entrance_card_resize_start(Entrance_Card_Resize *resize, Evas_Object *card,
+ Evas_Object *layout, Evas_Object *bounds,
+ const Evas_Event_Mouse_Down *mouse)
+{
+ int bx, by, bw, bh;
+ int x, y, width, height, hx, hy, hw, hh;
+
+ if (!edje_object_part_geometry_get(layout, "entrance.resize", &hx, &hy, &hw, &hh))
+ return EINA_FALSE;
+
+ evas_object_geometry_get(card, &x, &y, &width, &height);
+ if (mouse->canvas.x < x + hx || mouse->canvas.x >= x + hx + hw ||
+ mouse->canvas.y < y + hy || mouse->canvas.y >= y + hy + hh)
+ return EINA_FALSE;
+
+ evas_object_geometry_get(bounds, &bx, &by, &bw, &bh);
+ resize->pointer_x = mouse->canvas.x;
+ resize->pointer_y = mouse->canvas.y;
+ resize->width = width;
+ resize->height = height;
+ resize->max_width = MAX(width, (bx + bw) - x);
+ resize->max_height = MAX(height, (by + bh) - y);
+ resize->active = EINA_TRUE;
+ return EINA_TRUE;
+}
+
+void
+entrance_card_resize_move(Entrance_Card_Resize *resize, Evas_Object *card,
+ const Evas_Event_Mouse_Move *mouse, int min_width, int min_height,
+ int *width, int *height)
+{
+ *width = CLAMP(resize->width + mouse->cur.canvas.x - resize->pointer_x,
+ MIN(min_width, resize->max_width), resize->max_width);
+ *height = CLAMP(resize->height + mouse->cur.canvas.y - resize->pointer_y,
+ MIN(min_height, resize->max_height), resize->max_height);
+ evas_object_resize(card, *width, *height);
+}
+
+void
+entrance_card_position_store(Evas_Object *card, Evas_Object *bounds, double *x, double *y)
+{
+ int bx, by, bw, bh, cx, cy, cw, ch;
+
+ evas_object_geometry_get(bounds, &bx, &by, &bw, &bh);
+ evas_object_geometry_get(card, &cx, &cy, &cw, &ch);
+ if (bw > cw) *x = CLAMP((double)(cx - bx) / (bw - cw), 0.0, 1.0);
+ if (bh > ch) *y = CLAMP((double)(cy - by) / (bh - ch), 0.0, 1.0);
+}
+
struct Entrance_Gadgets
{
Evas_Object *overlay, *popup;
@@ -180,7 +230,7 @@ entrance_gadgets_theme_set(Entrance_Gadgets *gadgets, Evas_Object *layout, const
entrance_logger_theme_set(gadgets->logger, file);
entrance_clock_theme_set(gadgets->clock, layout, file);
entrance_daylight_theme_set(gadgets->daylight, file);
- entrance_sports_theme_set(gadgets->sports, file);
+ entrance_sports_theme_set(gadgets->sports, file, themed);
entrance_updates_theme_set(gadgets->updates, file);
entrance_notes_theme_set(gadgets->notes, file);
}
diff --git a/src/greeter/gadgets/gadgets.h b/src/greeter/gadgets/gadgets.h
index 2d64e00..6c73fc1 100644
--- a/src/greeter/gadgets/gadgets.h
+++ b/src/greeter/gadgets/gadgets.h
@@ -4,6 +4,20 @@
#include "../entrance_power_menu.h"
+typedef struct
+{
+ int pointer_x, pointer_y, width, height, max_width, max_height;
+ Eina_Bool active;
+} Entrance_Card_Resize;
+
+Eina_Bool entrance_card_resize_start(Entrance_Card_Resize *resize, Evas_Object *card,
+ Evas_Object *layout, Evas_Object *bounds,
+ const Evas_Event_Mouse_Down *mouse);
+void entrance_card_resize_move(Entrance_Card_Resize *resize, Evas_Object *card,
+ const Evas_Event_Mouse_Move *mouse, int min_width, int min_height,
+ int *width, int *height);
+void entrance_card_position_store(Evas_Object *card, Evas_Object *bounds, double *x, double *y);
+
typedef struct Entrance_Gadgets Entrance_Gadgets;
Entrance_Gadgets *entrance_gadgets_new(Evas_Object *window, Evas_Object *overlay, Eina_Bool preview,
diff --git a/src/greeter/gadgets/modules/clock/clock.c b/src/greeter/gadgets/modules/clock/clock.c
index 873d53c..036ad79 100644
--- a/src/greeter/gadgets/modules/clock/clock.c
+++ b/src/greeter/gadgets/modules/clock/clock.c
@@ -5,7 +5,6 @@
#include "entrance_constants.h"
#include <math.h>
-#include <stdint.h>
#define CLOCK_SETTINGS "clock"
#define CLOCK_ARTWORK "entrance/clock/artwork"
@@ -25,28 +24,21 @@ struct Entrance_Clock_Gadget
};
static Evas_Object *
-_shadow_add(Evas *canvas)
+_shadow_add(Evas *canvas, const char *theme)
{
- enum { DIAMETER = 128, PADDING = 12, SIDE = DIAMETER + 2 * PADDING };
- Evas_Object *shadow = evas_object_image_filled_add(canvas);
- uint32_t pixels[SIDE * SIDE];
+ const char *group = "entrance/clock/shadow";
+ Evas_Object *shadow = edje_object_add(canvas);
if (!shadow)
return NULL;
+ if (!edje_object_file_set(shadow, theme, group) &&
+ !edje_object_file_set(shadow, DATA_INSTALL_DIR "/themes/midnight/theme.edj", group) &&
+ !edje_object_file_set(shadow, ENTRANCE_CLOCK_BUILD_THEME, group))
+ {
+ evas_object_del(shadow);
+ return NULL;
+ }
- for (int y = 0; y < SIDE; ++y)
- for (int x = 0; x < SIDE; ++x)
- {
- double radius = hypot(x + 0.5 - SIDE / 2.0, y + 0.5 - SIDE / 2.0);
- double fade = CLAMP((DIAMETER / 2.0 + PADDING - radius) / (PADDING + 4), 0, 1);
- unsigned int alpha = 112 * fade * fade;
-
- pixels[y * SIDE + x] = alpha << 24;
- }
-
- evas_object_image_alpha_set(shadow, EINA_TRUE);
- evas_object_image_size_set(shadow, SIDE, SIDE);
- evas_object_image_data_copy_set(shadow, pixels);
evas_object_pass_events_set(shadow, EINA_TRUE);
evas_object_layer_set(shadow, 1);
return shadow;
@@ -119,11 +111,10 @@ _place(Entrance_Clock_Gadget *clock)
evas_object_move(clock->face, left, top);
if (clock->shadow)
{
- int padding = (size * 12 + 64) / 128;
- int offset = (size * 4 + 64) / 128;
+ int padding = (size * 20 + CLOCK_DIAMETER / 2) / CLOCK_DIAMETER;
evas_object_resize(clock->shadow, size + 2 * padding, size + 2 * padding);
- evas_object_move(clock->shadow, left - padding, top - padding + offset);
+ evas_object_move(clock->shadow, left - padding, top - padding);
evas_object_show(clock->shadow);
}
evas_object_show(clock->face);
@@ -220,7 +211,7 @@ _update(Entrance_Clock_Gadget *clock)
return;
evas_object_layer_set(clock->face, 1);
- clock->shadow = _shadow_add(canvas);
+ clock->shadow = _shadow_add(canvas, clock->theme);
if (clock->shadow)
evas_object_stack_below(clock->shadow, clock->face);
evas_object_precise_is_inside_set(clock->face, EINA_TRUE);
diff --git a/src/greeter/gadgets/modules/logger/logger.c b/src/greeter/gadgets/modules/logger/logger.c
index a9e419a..081f27d 100644
--- a/src/greeter/gadgets/modules/logger/logger.c
+++ b/src/greeter/gadgets/modules/logger/logger.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "logger.h"
+#include "../../gadgets.h"
#include <math.h>
#include "../../../entrance_greeter_i18n.h"
@@ -18,11 +19,14 @@
struct Entrance_Logger
{
Evas_Object *window, *bounds, *layout, *entry, *pause;
+ Elm_Theme *entry_theme;
+ char *entry_overlay;
GKeyFile *settings;
Eina_Bool (*save)(void *data);
void *save_data;
double x, y;
- int grab_x, grab_y;
+ int grab_x, grab_y, width, height;
+ Entrance_Card_Resize resize;
Eina_Bool dragging;
Ecore_Exe *process;
Ecore_Event_Handler *output, *exited;
@@ -41,6 +45,20 @@ _apply_theme(Entrance_Logger *logger)
!elm_layout_file_set(logger->layout, DATA_INSTALL_DIR "/themes/elementary/theme.edj",
LOGGER_GROUP))
elm_layout_file_set(logger->layout, ENTRANCE_LOGGER_BUILD_THEME, LOGGER_GROUP);
+ const char *file = NULL;
+ elm_layout_file_get(logger->layout, &file, NULL);
+ if (g_strcmp0(file, logger->entry_overlay) != 0)
+ {
+ if (logger->entry_overlay)
+ elm_theme_overlay_del(logger->entry_theme, logger->entry_overlay);
+ g_free(logger->entry_overlay);
+ logger->entry_overlay = g_strdup(file);
+ if (logger->entry_overlay)
+ elm_theme_overlay_add(logger->entry_theme, logger->entry_overlay);
+ }
+ elm_object_style_set(logger->entry, file && edje_file_group_exists(
+ file, "elm/entry/base-noedit-mixedwrap/entrance-log") ? "entrance-log" : "default");
+ logger->resize.active = logger->dragging = EINA_FALSE;
elm_layout_text_set(logger->layout, "logger.title", _("System Logs"));
elm_layout_content_set(logger->layout, "logger.messages", logger->entry);
elm_layout_content_set(logger->layout, "logger.pause", logger->pause);
@@ -178,7 +196,7 @@ _stop(Entrance_Logger *logger)
g_queue_clear_full(&logger->lines, g_free);
g_string_free(logger->partial, TRUE);
logger->paused = logger->journal = logger->dirty = logger->truncated = EINA_FALSE;
- logger->dragging = EINA_FALSE;
+ logger->dragging = logger->resize.active = EINA_FALSE;
evas_object_del(logger->layout);
logger->layout = NULL;
}
@@ -197,11 +215,21 @@ _pause(void *data, Evas_Object *object EINA_UNUSED, void *event EINA_UNUSED)
}
}
+static void
+_min_size_get(int width, int height, int *min_width, int *min_height)
+{
+ *min_width = MIN(width * 0.47, 760);
+ *min_height = MIN(height * 0.41, 460);
+}
+
static void
_place(Entrance_Logger *logger)
{
Evas_Coord x, y, width, height;
- int card_width, card_height;
+ int card_width, card_height, min_width, min_height;
+
+ if (!logger->layout)
+ return;
if (!logger->layout)
return;
@@ -210,8 +238,9 @@ _place(Entrance_Logger *logger)
if (width <= 0 || height <= 0)
return;
- card_width = MIN(width * 0.47, 760);
- card_height = MIN(height * 0.41, 460);
+ _min_size_get(width, height, &min_width, &min_height);
+ card_width = MIN(width, MAX(logger->width, min_width));
+ card_height = MIN(height, MAX(logger->height, min_height));
evas_object_resize(logger->layout, card_width, card_height);
evas_object_move(logger->layout, x + lround(logger->x * (width - card_width)),
y + lround(logger->y * (height - card_height)));
@@ -231,8 +260,11 @@ _drag_start(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object, void *eve
Evas_Event_Mouse_Down *mouse = event;
Evas_Coord x, y, header_w, header_h;
- if (mouse->button != 1 ||
- !edje_object_part_geometry_get(elm_layout_edje_get(object), "logger.header",
+ if (mouse->button != 1)
+ return;
+ if (entrance_card_resize_start(&logger->resize, object, elm_layout_edje_get(object), logger->bounds, mouse))
+ return;
+ if (!edje_object_part_geometry_get(elm_layout_edje_get(object), "logger.header",
NULL, NULL, &header_w, &header_h))
return;
@@ -248,8 +280,16 @@ _drag_move(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object, void *even
{
Entrance_Logger *logger = data;
Evas_Event_Mouse_Move *mouse = event;
- Evas_Coord x, y, width, height, card_width, card_height;
+ Evas_Coord x, y, width, height, card_width, card_height, min_width, min_height;
+ if (logger->resize.active)
+ {
+ evas_object_geometry_get(logger->bounds, NULL, NULL, &width, &height);
+ _min_size_get(width, height, &min_width, &min_height);
+ entrance_card_resize_move(&logger->resize, object, mouse, min_width, min_height,
+ &logger->width, &logger->height);
+ return;
+ }
if (!logger->dragging)
return;
@@ -265,14 +305,24 @@ _drag_move(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object, void *even
}
static void
-_drag_end(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object EINA_UNUSED, void *event)
+_drag_end(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object, void *event)
{
Entrance_Logger *logger = data;
Evas_Event_Mouse_Up *mouse = event;
- if (!logger->dragging || mouse->button != 1)
+ if ((!logger->dragging && !logger->resize.active) || mouse->button != 1)
return;
+ if (logger->resize.active)
+ {
+ entrance_card_position_store(object, logger->bounds, &logger->x, &logger->y);
+ if (logger->width > 0 && logger->height > 0)
+ {
+ g_key_file_set_integer(logger->settings, LOGGER_SETTINGS, "width", logger->width);
+ g_key_file_set_integer(logger->settings, LOGGER_SETTINGS, "height", logger->height);
+ }
+ }
+ logger->resize.active = EINA_FALSE;
logger->dragging = EINA_FALSE;
g_key_file_set_double(logger->settings, LOGGER_SETTINGS, "x", logger->x);
g_key_file_set_double(logger->settings, LOGGER_SETTINGS, "y", logger->y);
@@ -294,6 +344,7 @@ _start(Entrance_Logger *logger)
logger->entry = elm_entry_add(logger->layout);
elm_entry_editable_set(logger->entry, EINA_FALSE);
elm_entry_scrollable_set(logger->entry, EINA_TRUE);
+ elm_object_theme_set(logger->entry, logger->entry_theme);
elm_entry_line_wrap_set(logger->entry, ELM_WRAP_MIXED);
elm_object_access_info_set(logger->entry, _("Recent system log messages"));
evas_object_show(logger->entry);
@@ -340,9 +391,13 @@ entrance_logger_new(Evas_Object *window, Evas_Object *bounds, GKeyFile *settings
{
Entrance_Logger *logger = g_new0(Entrance_Logger, 1);
+ logger->entry_theme = elm_theme_new();
+ elm_theme_ref_set(logger->entry_theme, elm_theme_default_get());
logger->window = window;
logger->bounds = bounds;
logger->settings = settings;
+ logger->width = g_key_file_get_integer(settings, LOGGER_SETTINGS, "width", NULL);
+ logger->height = g_key_file_get_integer(settings, LOGGER_SETTINGS, "height", NULL);
logger->save = save;
logger->save_data = data;
logger->x = _position(settings, "x", DEFAULT_X);
@@ -421,5 +476,7 @@ entrance_logger_free(Entrance_Logger *logger)
evas_object_event_callback_del_full(logger->bounds, EVAS_CALLBACK_RESIZE, _resize, logger);
_stop(logger);
g_free(logger->theme);
+ elm_theme_free(logger->entry_theme);
+ g_free(logger->entry_overlay);
g_free(logger);
}
diff --git a/src/greeter/gadgets/modules/music/music.c b/src/greeter/gadgets/modules/music/music.c
index fa3e53d..837d2ce 100644
--- a/src/greeter/gadgets/modules/music/music.c
+++ b/src/greeter/gadgets/modules/music/music.c
@@ -23,6 +23,9 @@ typedef struct
} Radio_Station;
/* Broadcaster stream endpoints, ordered by display name. */
+#define LIMBIK_STATION "https://limbikfreq.com/listen/limbik_frequencies/128.mp3"
+#define LIMBIK_STATION_OLD "http://radio.limbikfreq.com:8000/limbik192"
+
static const Radio_Station stations[] = {
{ "Capital · London", "https://media-ice.musicradio.com/CapitalMP3" },
{ "Classic FM", "https://media-ice.musicradio.com/ClassicFMMP3" },
@@ -33,7 +36,7 @@ static const Radio_Station stations[] = {
{ "Heart · London", "https://media-ice.musicradio.com/HeartLondonMP3" },
{ "KEXP · Seattle", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3" },
{ "LBC · London", "https://media-ice.musicradio.com/LBCUKMP3" },
- { "Limbik Frequencies", "http://radio.limbikfreq.com:8000/limbik192" },
+ { "Limbik Frequencies", LIMBIK_STATION },
{ "Radio Paradise · Main Mix", DEFAULT_STATION },
{ "Radio Paradise · Mellow Mix", "https://stream.radioparadise.com/mellow-192" },
{ "Radio Paradise · Rock Mix", "https://stream.radioparadise.com/rock-192" },
@@ -67,7 +70,7 @@ struct Entrance_Music
GstElement *player;
GstBus *bus;
GstTagList *tags;
- Evas_Object *play, *station_picker, *volume_slider, *cover;
+ Evas_Object *play, *station_picker, *hover_parent, *volume_slider, *cover;
Radio_Artwork *artwork;
char *artist, *title;
unsigned int icon_color;
@@ -110,6 +113,8 @@ _place(Entrance_Music *music)
MIN((double)width / base_width, (double)height / base_height));
int card_width = base_width * scale, card_height = base_height * scale;
+ evas_object_move(music->hover_parent, x, y);
+ evas_object_resize(music->hover_parent, width, height);
edje_object_scale_set(music->card, scale);
evas_object_resize(music->card, card_width, card_height);
evas_object_move(music->card, x + lround((width - card_width) * music->x),
@@ -546,15 +551,21 @@ entrance_music_new(Evas_Object *window, Evas_Object *bounds, GKeyFile *settings,
const Radio_Station *default_station = &stations[0];
char *saved = g_key_file_get_string(settings, MUSIC_SETTINGS, "station", NULL);
+ const char *selected = g_strcmp0(saved, LIMBIK_STATION_OLD) == 0 ? LIMBIK_STATION : saved;
+
+ music->hover_parent = elm_box_add(window);
+ evas_object_layer_set(music->hover_parent, 2);
+ evas_object_pass_events_set(music->hover_parent, EINA_TRUE);
+ evas_object_show(music->hover_parent);
music->station_picker = elm_hoversel_add(window);
- elm_hoversel_hover_parent_set(music->station_picker, window);
+ elm_hoversel_hover_parent_set(music->station_picker, music->hover_parent ? music->hover_parent : window);
elm_hoversel_auto_update_set(music->station_picker, EINA_FALSE);
elm_object_access_info_set(music->station_picker, _("Choose a radio station"));
for (size_t i = 0; i < EINA_C_ARRAY_LENGTH(stations); ++i)
{
elm_hoversel_item_add(music->station_picker, stations[i].name,
NULL, ELM_ICON_NONE, NULL, &stations[i]);
- if (g_strcmp0(saved, stations[i].url) == 0)
+ if (g_strcmp0(selected, stations[i].url) == 0)
music->station = &stations[i];
if (g_strcmp0(DEFAULT_STATION, stations[i].url) == 0)
default_station = &stations[i];
@@ -656,6 +667,7 @@ entrance_music_free(Entrance_Music *music)
evas_object_event_callback_del_full(music->bounds, EVAS_CALLBACK_RESIZE, _resize, music);
evas_object_del(music->play);
evas_object_del(music->station_picker);
+ evas_object_del(music->hover_parent);
evas_object_del(music->volume_slider);
evas_object_del(music->cover);
evas_object_del(music->card);
diff --git a/src/greeter/gadgets/modules/notes/notes.c b/src/greeter/gadgets/modules/notes/notes.c
index 8b8148a..8c255d0 100644
--- a/src/greeter/gadgets/modules/notes/notes.c
+++ b/src/greeter/gadgets/modules/notes/notes.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "notes.h"
+#include "../../gadgets.h"
#include "../../../entrance_greeter_i18n.h"
#include "entrance_constants.h"
@@ -13,6 +14,8 @@
#define ACTION_GROUP "elm/button/base/" ACTION_STYLE
#define NOTE_PREFIX "note:"
#define NOTE_LAYER 1
+#define NOTE_MIN_WIDTH 248
+#define NOTE_MIN_HEIGHT 224
typedef struct
{
@@ -20,7 +23,8 @@ typedef struct
Evas_Object *card, *entry, *add, *remove;
char *id;
double x, y;
- int grab_x, grab_y;
+ int grab_x, grab_y, width, height;
+ Entrance_Card_Resize resize;
Eina_Bool dragging, themed, styled;
} Note;
@@ -93,13 +97,14 @@ _changed(void *data, Evas_Object *entry, void *event EINA_UNUSED)
static void
_place(Note *note)
{
- int x, y, w, h;
+ int x, y, w, h, width, height;
evas_object_geometry_get(note->owner->bounds, &x, &y, &w, &h);
if (w <= 0 || h <= 0)
return;
- int width = MIN(w, 248), height = MIN(h, 224);
+ width = MIN(w, MAX(note->width, NOTE_MIN_WIDTH));
+ height = MIN(h, MAX(note->height, NOTE_MIN_HEIGHT));
evas_object_resize(note->card, width, height);
evas_object_move(note->card, x + lround(note->x * (w - width)),
y + lround(note->y * (h - height)));
@@ -125,6 +130,8 @@ _drag_start(void *data, Evas *canvas EINA_UNUSED, Evas_Object *card, void *event
if (mouse->button != 1)
return;
evas_object_raise(card);
+ if (entrance_card_resize_start(¬e->resize, card, card, note->owner->bounds, mouse))
+ return;
if (!edje_object_part_geometry_get(card, "note.header", NULL, NULL, &header_w, &header_h))
return;
evas_object_geometry_get(card, &x, &y, NULL, NULL);
@@ -141,6 +148,12 @@ _drag_move(void *data, Evas *canvas EINA_UNUSED, Evas_Object *card, void *event)
Evas_Event_Mouse_Move *mouse = event;
int x, y, w, h, width, height;
+ if (note->resize.active)
+ {
+ entrance_card_resize_move(¬e->resize, card, mouse, NOTE_MIN_WIDTH, NOTE_MIN_HEIGHT,
+ ¬e->width, ¬e->height);
+ return;
+ }
if (!note->dragging)
return;
evas_object_geometry_get(note->owner->bounds, &x, &y, &w, &h);
@@ -157,16 +170,24 @@ _position_store(Note *note)
{
g_key_file_set_double(note->owner->settings, note->id, "x", note->x);
g_key_file_set_double(note->owner->settings, note->id, "y", note->y);
+ if (note->width > 0 && note->height > 0)
+ {
+ g_key_file_set_integer(note->owner->settings, note->id, "width", note->width);
+ g_key_file_set_integer(note->owner->settings, note->id, "height", note->height);
+ }
}
static void
-_drag_end(void *data, Evas *canvas EINA_UNUSED, Evas_Object *card EINA_UNUSED, void *event)
+_drag_end(void *data, Evas *canvas EINA_UNUSED, Evas_Object *card, void *event)
{
Note *note = data;
Evas_Event_Mouse_Up *mouse = event;
- if (!note->dragging || mouse->button != 1)
+ if ((!note->dragging && !note->resize.active) || mouse->button != 1)
return;
+ if (note->resize.active)
+ entrance_card_position_store(card, note->owner->bounds, ¬e->x, ¬e->y);
+ note->resize.active = EINA_FALSE;
note->dragging = EINA_FALSE;
_position_store(note);
note->owner->dirty = EINA_TRUE;
@@ -196,6 +217,11 @@ _delete(void *data, Evas_Object *object EINA_UNUSED, void *event EINA_UNUSED)
notes->pending_open = NULL;
g_key_file_remove_group(notes->settings, note->id, NULL);
g_ptr_array_remove(notes->items, note);
+ if (!notes->items->len)
+ {
+ notes->enabled = EINA_FALSE;
+ g_key_file_set_boolean(notes->settings, SETTINGS, "enabled", EINA_FALSE);
+ }
notes->dirty = EINA_TRUE;
_save(notes);
}
@@ -210,7 +236,7 @@ _visibility(Note *note)
}
else
{
- note->dragging = EINA_FALSE;
+ note->dragging = note->resize.active = EINA_FALSE;
elm_object_focus_set(note->entry, EINA_FALSE);
evas_object_hide(note->card);
}
@@ -226,7 +252,7 @@ _theme(Note *note)
edje_object_part_unswallow(note->card, note->add);
edje_object_part_unswallow(note->card, note->remove);
note->themed = edje_object_file_set(note->card, file, GROUP);
- note->dragging = EINA_FALSE;
+ note->dragging = note->resize.active = EINA_FALSE;
if (note->themed)
{
elm_object_theme_set(note->add, note->owner->action_theme);
@@ -304,6 +330,8 @@ _note_add(Entrance_Notes *notes, const char *id)
char *markup = elm_entry_utf8_to_markup(text ? text : "");
note->owner = notes;
+ note->width = g_key_file_get_integer(notes->settings, id, "width", NULL);
+ note->height = g_key_file_get_integer(notes->settings, id, "height", NULL);
note->id = g_strdup(id);
_default_position(note, index);
note->x = _position(notes->settings, id, "x", note->x);
@@ -451,12 +479,31 @@ _menu_action_deleted(void *data, Evas *canvas EINA_UNUSED, Evas_Object *object E
g_free(data);
}
+static void
+_note_id_free(void *data, Evas_Object *object EINA_UNUSED, void *event EINA_UNUSED)
+{
+ g_free(data);
+}
+
static void
_find_note(void *data, Evas_Object *picker EINA_UNUSED, void *event)
{
Note_Menu_Action *action = ""
Entrance_Notes *notes = action->notes;
- Note *note = elm_object_item_data_get(event);
+ const char *id = elm_object_item_data_get(event);
+ Note *note = NULL;
+
+ for (unsigned int i = 0; i < notes->items->len; ++i)
+ {
+ Note *candidate = g_ptr_array_index(notes->items, i);
+ if (g_strcmp0(candidate->id, id) == 0)
+ {
+ note = candidate;
+ break;
+ }
+ }
+ if (!note)
+ return;
if (!notes->enabled)
{
@@ -483,6 +530,7 @@ entrance_notes_controls_add(Entrance_Notes *notes, Evas_Object *box,
Evas_Object *check = elm_check_add(row);
elm_object_text_set(check, _("Show notes"));
+ elm_object_disabled_set(check, notes->items->len == 0);
elm_check_state_set(check, notes->enabled);
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0.5);
@@ -517,7 +565,13 @@ entrance_notes_controls_add(Entrance_Notes *notes, Evas_Object *box,
g_utf8_substring(text, 0, MIN(g_utf8_strlen(text, -1), 36)) :
g_strdup_printf(_("Blank note %u"), i + 1);
char *label = elm_entry_utf8_to_markup(preview);
- elm_hoversel_item_add(picker, label, NULL, ELM_ICON_NONE, NULL, note);
+ char *id = g_strdup(note->id);
+ Elm_Object_Item *item = elm_hoversel_item_add(picker, label, NULL, ELM_ICON_NONE,
+ NULL, id);
+ if (item)
+ elm_object_item_del_cb_set(item, _note_id_free);
+ else
+ g_free(id);
free(label);
}
evas_object_size_hint_align_set(picker, EVAS_HINT_FILL, 0.5);
diff --git a/src/greeter/gadgets/modules/sports/scoreboard.c b/src/greeter/gadgets/modules/sports/scoreboard.c
index 8b01766..1bf1404 100644
--- a/src/greeter/gadgets/modules/sports/scoreboard.c
+++ b/src/greeter/gadgets/modules/sports/scoreboard.c
@@ -46,15 +46,37 @@ _match_free(void *data)
static gint
_match_order(gconstpointer a, gconstpointer b)
{
- const Sports_Match *left = *(Sports_Match *const *)a;
- const Sports_Match *right = *(Sports_Match *const *)b;
+ const Sports_Match *left, *right;
+ int order;
- if (left->state != right->state)
- return left->state - right->state;
- if (!left->date || !right->date)
- return (right->date != NULL) - (left->date != NULL);
- int order = g_date_time_compare(left->date, right->date);
- return left->state == MATCH_NEXT ? order : -order;
+ left = *(Sports_Match *const *)a;
+ right = *(Sports_Match *const *)b;
+ if (left->date && right->date)
+ {
+ order = g_date_time_compare(right->date, left->date);
+ if (order) return order;
+ }
+ else if (left->date || right->date)
+ return right->date ? 1 : -1;
+ return left->state - right->state;
+}
+
+static GDateTime *
+_match_date_parse(const char *stamp)
+{
+ GDateTime *date;
+ char *with_seconds;
+
+ date = g_date_time_new_from_iso8601(stamp, NULL);
+ if (date || strlen(stamp) < 17 || stamp[10] != 'T' || stamp[13] != ':' ||
+ !strchr("Z+-", stamp[16]))
+ return date;
+
+ /* ESPN often supplies kickoff times without a seconds field. */
+ with_seconds = g_strdup_printf("%.16s:00%s", stamp, stamp + 16);
+ date = g_date_time_new_from_iso8601(with_seconds, NULL);
+ g_free(with_seconds);
+ return date;
}
static Sports_Match *
@@ -119,7 +141,7 @@ _match_parse(json_object *event)
}
match->detail = _copy_text(detail);
if (*date)
- match->date = g_date_time_new_from_iso8601(date, NULL);
+ match->date = _match_date_parse(date);
return match;
}
diff --git a/src/greeter/gadgets/modules/sports/sports.c b/src/greeter/gadgets/modules/sports/sports.c
index f6e06b3..78cc935 100644
--- a/src/greeter/gadgets/modules/sports/sports.c
+++ b/src/greeter/gadgets/modules/sports/sports.c
@@ -132,11 +132,11 @@ _render(Entrance_Sports *sports)
}
if (!sports->matches->len)
{
- _message(sports, _("No fixtures in the current window."));
+ _message(sports, _("No fixtures today or in the past week."));
return;
}
- for (unsigned int i = 0; i < MIN(sports->matches->len, 60); ++i)
+ for (unsigned int i = 0; i < sports->matches->len; ++i)
{
const Sports_Match *match = g_ptr_array_index(sports->matches, i);
Evas_Object *row = edje_object_add(evas_object_evas_get(sports->rows));
@@ -157,13 +157,16 @@ _render(Entrance_Sports *sports)
if (!sports->failed)
edje_object_signal_emit(row, "match,live", "entrance");
}
- else if (match->state == MATCH_FINAL)
- detail = g_strdup_printf(_("%s · %s"), *match->detail ? match->detail : _("Final"),
- when ? when : "");
else if (match->state == MATCH_NEXT && when)
detail = g_strdup(when);
else
- detail = g_strdup(*match->detail ? match->detail : _("Fixture"));
+ {
+ const char *status;
+
+ status = *match->detail ? match->detail : _("Fixture");
+ if (!*match->detail && match->state == MATCH_FINAL) status = _("Final");
+ detail = when ? g_strdup_printf(_("%s · %s"), status, when) : g_strdup(status);
+ }
edje_object_part_text_set(row, "match.home", match->home);
edje_object_part_text_set(row, "match.away", match->away);
@@ -220,7 +223,7 @@ _chunk(void *data, int type EINA_UNUSED, void *event)
}
/* ESPN's soccer scoreboard accepts one YYYYMMDD date per request. */
-static const int query_offsets[] = { 0, -1, 1 };
+enum { SCORE_HISTORY_DAYS = 7 };
static Eina_Bool _request_day(Entrance_Sports *sports);
static Eina_Bool
@@ -245,7 +248,7 @@ _complete(void *data, int type EINA_UNUSED, void *event)
else
sports->pending = matches;
- if (++sports->query_index < G_N_ELEMENTS(query_offsets))
+ if (++sports->query_index <= SCORE_HISTORY_DAYS)
{
if (!_request_day(sports))
_failed(sports);
@@ -281,7 +284,7 @@ _ca_bundle(void)
static Eina_Bool
_request_day(Entrance_Sports *sports)
{
- g_autoptr(GDateTime) day = g_date_time_add_days(sports->query_day, query_offsets[sports->query_index]);
+ g_autoptr(GDateTime) day = g_date_time_add_days(sports->query_day, -(int)sports->query_index);
g_autofree char *date = g_date_time_format(day, "%Y%m%d");
const League *league = ®ions[sports->region].leagues[sports->competition];
g_autofree char *url = ""
@@ -386,18 +389,25 @@ _country_changed(void *data, Evas_Object *picker, void *event)
static void
_place(Entrance_Sports *sports)
{
- int x, y, w, h;
+ const int base_width = 460, base_height = 440;
+ int x, y, w, h, width, height;
+ double scale, card_scale;
evas_object_geometry_get(sports->bounds, &x, &y, &w, &h);
if (w <= 0 || h <= 0)
return;
- int width = MIN(w, 370), height = MIN(h, 382);
+ scale = elm_config_scale_get();
+ width = MIN(w, lround(base_width * scale));
+ height = MIN(h, lround(base_height * scale));
evas_object_move(sports->hover_parent, x, y);
evas_object_resize(sports->hover_parent, w, h);
evas_object_resize(sports->card, width, height);
evas_object_move(sports->card, x + lround(sports->x * (w - width)),
y + lround(sports->y * (h - height)));
+ evas_object_geometry_get(sports->card, NULL, NULL, &width, &height);
+ card_scale = MIN((double)width / base_width, (double)height / base_height);
+ edje_object_scale_set(sports->card, card_scale);
}
static void
@@ -500,7 +510,7 @@ _update(Entrance_Sports *sports)
}
void
-entrance_sports_theme_set(Entrance_Sports *sports, const char *file)
+entrance_sports_theme_set(Entrance_Sports *sports, const char *file, Eina_Bool themed)
{
if (file)
{
@@ -513,6 +523,8 @@ entrance_sports_theme_set(Entrance_Sports *sports, const char *file)
g_free(sports->theme);
sports->theme = g_strdup(file);
sports->themed = _theme_load(sports->card, sports, CARD);
+ elm_object_style_set(sports->country, themed ? "entrance-radio" : "default");
+ elm_object_style_set(sports->league, themed ? "entrance-radio" : "default");
for (unsigned int i = 0; i < G_N_ELEMENTS(widgets); ++i)
if (sports->themed && edje_object_part_swallow(sports->card, parts[i], widgets[i]))
evas_object_show(widgets[i]);
@@ -567,6 +579,7 @@ entrance_sports_new(Evas_Object *window, Evas_Object *bounds, GKeyFile *settings
/* Hoversels take the hover parent's layer and use its geometry as their bounds. */
sports->hover_parent = elm_box_add(window);
evas_object_layer_set(sports->hover_parent, 2);
+ evas_object_pass_events_set(sports->hover_parent, EINA_TRUE);
evas_object_show(sports->hover_parent);
sports->country = elm_hoversel_add(window);
elm_hoversel_hover_parent_set(sports->country, sports->hover_parent);
diff --git a/src/greeter/gadgets/modules/sports/sports.h b/src/greeter/gadgets/modules/sports/sports.h
index 33229c9..00c7760 100644
--- a/src/greeter/gadgets/modules/sports/sports.h
+++ b/src/greeter/gadgets/modules/sports/sports.h
@@ -8,7 +8,7 @@
typedef struct Entrance_Sports Entrance_Sports;
Entrance_Sports *entrance_sports_new(Evas_Object *window, Evas_Object *bounds, GKeyFile *settings,
Eina_Bool (*save)(void *), void *data);
-void entrance_sports_theme_set(Entrance_Sports *sports, const char *file);
+void entrance_sports_theme_set(Entrance_Sports *sports, const char *file, Eina_Bool themed);
void entrance_sports_controls_add(Entrance_Sports *sports, Evas_Object *box);
void entrance_sports_free(Entrance_Sports *sports);
diff --git a/src/greeter/gadgets/modules/updates/updates.c b/src/greeter/gadgets/modules/updates/updates.c
index 45a3c9d..16a6431 100644
--- a/src/greeter/gadgets/modules/updates/updates.c
+++ b/src/greeter/gadgets/modules/updates/updates.c
@@ -91,15 +91,26 @@ _render(Entrance_Updates *updates)
static void
_place(Entrance_Updates *updates)
{
- int x, y, width, height;
+ const int base_width = 392, base_height = 224;
+ int x, y, width, height, w, h;
+ double scale, card_scale;
+
evas_object_geometry_get(updates->bounds, &x, &y, &width, &height);
if (width <= 0 || height <= 0)
return;
- int w = MIN(width, 330), h = MIN(height, 202);
+ scale = elm_config_scale_get();
+ w = MIN(width, lround(base_width * scale));
+ h = MIN(height, lround(base_height * scale));
evas_object_resize(updates->card, w, h);
evas_object_move(updates->card, x + lround(updates->x * (width - w)),
y + lround(updates->y * (height - h)));
+ evas_object_geometry_get(updates->card, NULL, NULL, &w, &h);
+ card_scale = MIN((double)w / base_width, (double)h / base_height);
+ edje_object_scale_set(updates->card, card_scale);
+ elm_object_scale_set(updates->check, card_scale / scale);
+ elm_object_scale_set(updates->download, card_scale / scale);
+ elm_object_scale_set(updates->restart, card_scale / scale);
}
static void
diff --git a/src/greeter/screensaver/scenes.c b/src/greeter/screensaver/scenes.c
index 020f3be..9d03231 100644
--- a/src/greeter/screensaver/scenes.c
+++ b/src/greeter/screensaver/scenes.c
@@ -29,16 +29,33 @@ _noise(unsigned int seed)
static void
_background(uint32_t *pixels, Color top, Color bottom)
{
+ unsigned int horizontal[W];
+
+ for (int x = 0; x < W; ++x)
+ {
+ int edge = 2 * x - W;
+ horizontal[x] = edge * edge * 64 / (W * W);
+ }
+
for (int y = 0; y < H; ++y)
{
- unsigned int fade = y * 256 / H;
- uint32_t rgb = 0xff000000u |
- ((top.r * (256 - fade) + bottom.r * fade) >> 8) << 16 |
- ((top.g * (256 - fade) + bottom.g * fade) >> 8) << 8 |
- ((top.b * (256 - fade) + bottom.b * fade) >> 8);
+ unsigned int fade = y * 256 / (H - 1);
+ unsigned int r = top.r * (256 - fade) + bottom.r * fade;
+ unsigned int g = top.g * (256 - fade) + bottom.g * fade;
+ unsigned int b = top.b * (256 - fade) + bottom.b * fade;
+ int edge = 2 * y - H;
+ unsigned int vertical = edge * edge * 38 / (H * H);
for (int x = 0; x < W; ++x)
- pixels[y * W + x] = rgb;
+ {
+ unsigned int light = 256 - horizontal[x] - vertical;
+ unsigned int grain = (unsigned int)(_noise(y * W + x) * 65536);
+
+ pixels[y * W + x] = 0xff000000u |
+ ((r * light + grain) >> 16) << 16 |
+ ((g * light + grain) >> 16) << 8 |
+ ((b * light + grain) >> 16);
+ }
}
}
@@ -60,14 +77,20 @@ static void
_glow(uint32_t *pixels, double x, double y, int radius, Color color,
unsigned int alpha)
{
- for (int dy = -radius; dy <= radius; ++dy)
- for (int dx = -radius; dx <= radius; ++dx)
+ int left = fmax(0, floor(x - radius));
+ int right = fmin(W - 1, ceil(x + radius));
+ int top = fmax(0, floor(y - radius));
+ int bottom = fmin(H - 1, ceil(y + radius));
+ double inverse_radius2 = 1.0 / (radius * radius);
+
+ for (int py = top; py <= bottom; ++py)
+ for (int px = left; px <= right; ++px)
{
- int fade = radius * radius - dx * dx - dy * dy;
+ double dx = px - x, dy = py - y;
+ double fade = 1.0 - (dx * dx + dy * dy) * inverse_radius2;
if (fade > 0)
- _plot(pixels, (int)x + dx, (int)y + dy, color,
- alpha * fade / (radius * radius));
+ _plot(pixels, px, py, color, alpha * fade * fade);
}
}
@@ -75,17 +98,20 @@ static void
_line(uint32_t *pixels, double x1, double y1, double x2, double y2,
Color color, unsigned int alpha)
{
- int steps = (int)fmax(fabs(x2 - x1), fabs(y2 - y1)) + 1;
+ double dx = x2 - x1, dy = y2 - y1;
+ int steps = (int)fmax(fabs(dx), fabs(dy)) + 1;
+ int steep = fabs(dy) > fabs(dx);
for (int i = 0; i < steps; ++i)
{
double f = (double)i / steps;
- double x = x1 + f * (x2 - x1);
- double y = y1 + f * (y2 - y1);
- double edge = _fraction(y);
+ double x = x1 + f * dx, y = y1 + f * dy;
+ double edge = _fraction(steep ? x : y);
+ int px = steep ? (int)floor(x) : (int)floor(x + 0.5);
+ int py = steep ? (int)floor(y + 0.5) : (int)floor(y);
- _plot(pixels, (int)floor(x), (int)floor(y), color, alpha * (1 - edge));
- _plot(pixels, (int)floor(x), (int)floor(y) + 1, color, alpha * edge);
+ _plot(pixels, px, py, color, alpha * (1 - edge));
+ _plot(pixels, px + steep, py + !steep, color, alpha * edge);
}
}
@@ -96,46 +122,62 @@ _stars(uint32_t *pixels, double time, unsigned int count)
{
int x = _noise(i + 500) * W;
int y = _noise(i + 900) * H * 0.85;
- double light = 38 + 31 * sin(time * 0.8 + i * 2.7);
+ double light = 44 + 30 * sin(time * 0.8 + i * 2.7);
- _glow(pixels, x, y, 1 + (i % 11 == 0), (Color){176, 204, 242}, light);
+ Color tint = i % 4 ? (Color){176, 204, 242} : (Color){245, 197, 151};
+ _glow(pixels, x, y, 1 + (i % 11 == 0), tint, light);
+ if (i % 23 == 0)
+ _glow(pixels, x, y, 5, tint, light * 0.66);
}
}
static void
_aurora(uint32_t *pixels, double time)
{
- _background(pixels, (Color){3, 8, 24}, (Color){8, 27, 36});
- _stars(pixels, time, 110);
- for (int x = 0; x < W; ++x)
- for (int ribbon = 0; ribbon < 3; ++ribbon)
+ static const Color colors[] = {{105, 95, 224}, {53, 213, 180}, {94, 242, 137}};
+
+ _background(pixels, (Color){4, 8, 27}, (Color){11, 46, 58});
+ _glow(pixels, W * 0.62, H * 0.64, 178, (Color){40, 124, 134}, 63);
+ _stars(pixels, time, 150);
+ for (int ribbon = 0; ribbon < 3; ++ribbon)
+ for (int x = 0; x < W; ++x)
{
- double phase = x * 0.015 + ribbon * 1.1;
- double crest = 81 + ribbon * 28 + 25 * sin(phase + time * 0.21)
- + 14 * sin(phase * 2.2 - time * 0.31);
- int height = 30 + 18 * (1 + sin(phase * 0.8));
- Color color = ribbon == 1 ? (Color){102, 87, 229} : (Color){39, 228, 165};
+ double phase = x * 0.012 + ribbon * 1.3;
+ double crest = 92 + ribbon * 22 + 23 * sin(phase + time * 0.19)
+ + 12 * sin(phase * 2.1 - time * 0.25);
+ double folds = 0.68 + 0.22 * sin(phase * 18 + time * 0.47)
+ + 0.10 * cos(phase * 31 - time * 0.18);
+ int height = 46 + 20 * (1 + sin(phase * 0.83));
for (int y = 0; y < height; ++y)
{
double fade = 1.0 - (double)y / height;
- _plot(pixels, x, crest - y, color, fade * fade * 48);
+ double edge = fmin(1.0, (y + 1) / 4.0);
+ _plot(pixels, x, crest - y, colors[ribbon], fade * fade * edge * folds * 101);
}
}
for (int x = 0; x < W; ++x)
- for (int y = 237 + 17 * sin(x * 0.024) + 6 * sin(x * 0.066); y < H; ++y)
- pixels[y * W + x] = 0xff040b16;
+ {
+ double distant = 223 + 9 * sin(x * 0.024) + 5 * cos(x * 0.065);
+ double near = 249 + 15 * sin(x * 0.018 + 1.1) + 6 * sin(x * 0.061);
+
+ for (int y = distant; y < H; ++y)
+ _plot(pixels, x, y, (Color){9, 22, 38}, 210);
+ for (int y = near; y < H; ++y)
+ _plot(pixels, x, y, (Color){4, 10, 23}, 255);
+ }
}
static void
_orbits(uint32_t *pixels, double time)
{
_background(pixels, (Color){6, 8, 21}, (Color){17, 12, 30});
- _stars(pixels, time, 95);
+ _stars(pixels, time, 125);
double cx = W * (0.50 + 0.12 * sin(time * 0.043));
double cy = H * (0.50 + 0.11 * cos(time * 0.057));
- _glow(pixels, cx, cy, 36, (Color){130, 73, 43}, 45);
+ _glow(pixels, cx, cy, 115, (Color){95, 48, 72}, 55);
+ _glow(pixels, cx, cy, 42, (Color){234, 106, 53}, 89);
_glow(pixels, cx, cy, 12, (Color){252, 166, 89}, 155);
_glow(pixels, cx, cy, 4, (Color){255, 224, 166}, 220);
for (int ring = 0; ring < 5; ++ring)
@@ -152,7 +194,13 @@ _orbits(uint32_t *pixels, double time)
}
double x = cx + cos(angle) * radius;
double y = cy + sin(angle) * radius * 0.45;
- _glow(pixels, x, y, 7, planet, 77);
+ for (int trail = 22; trail > 0; --trail)
+ {
+ double past = angle - trail * 0.016;
+ _glow(pixels, cx + cos(past) * radius, cy + sin(past) * radius * 0.45,
+ 2, planet, (23 - trail) * 2);
+ }
+ _glow(pixels, x, y, 8, planet, 99);
_glow(pixels, x, y, 3, planet, 221);
}
}
@@ -160,7 +208,9 @@ _orbits(uint32_t *pixels, double time)
static void
_embers(uint32_t *pixels, double time)
{
- _background(pixels, (Color){12, 6, 15}, (Color){29, 12, 17});
+ _background(pixels, (Color){14, 7, 21}, (Color){36, 12, 18});
+ _glow(pixels, W * 0.38, H + 12, 179, (Color){144, 43, 33}, 85);
+ _glow(pixels, W * 0.72, H + 24, 156, (Color){110, 36, 56}, 70);
for (unsigned int i = 0; i < 150; ++i)
{
double life = _fraction(_noise(i) + time * (0.024 + 0.031 * _noise(i + 400)));
@@ -179,15 +229,16 @@ static void
_tide(uint32_t *pixels, double time)
{
_background(pixels, (Color){4, 13, 31}, (Color){7, 41, 51});
- for (int wave = 0; wave < 21; ++wave)
+ _glow(pixels, W * 0.55, H * 0.57, 168, (Color){22, 100, 126}, 72);
+ for (int wave = 0; wave < 26; ++wave)
{
double previous = 0;
for (int x = 0; x <= W; x += 4)
{
double phase = x * 0.018 + wave * 0.31;
- double y = 75 + wave * 6 + 16 * sin(phase + time * 0.44)
+ double y = 51 + wave * (4.2 + wave * 0.085) + 16 * sin(phase + time * 0.44)
+ 9 * cos(phase * 1.8 - time * 0.27);
- Color color = {28, 125 + wave * 4, 173 + wave * 3};
+ Color color = {30 + wave * 3, 119 + wave * 4, 161 + wave * 3};
if (x)
_line(pixels, x - 4, previous, x, y, color, 32 + wave * 4);
@@ -229,6 +280,8 @@ _prism(uint32_t *pixels, double time)
double cy = H * (0.49 + 0.10 * cos(time * 0.08));
_background(pixels, (Color){13, 7, 23}, (Color){7, 17, 32});
+ _glow(pixels, cx, cy, 143, (Color){81, 47, 142}, 92);
+ _stars(pixels, time * 0.4, 65);
for (int layer = 0; layer < 15; ++layer)
{
double radius = 16 + layer * 6;
@@ -249,6 +302,7 @@ static void
_meteors(uint32_t *pixels, double time)
{
_background(pixels, (Color){3, 8, 23}, (Color){20, 16, 37});
+ _glow(pixels, W * 0.62, H * 0.52, 177, (Color){74, 64, 136}, 47);
_stars(pixels, time, 155);
for (unsigned int i = 0; i < 12; ++i)
{
@@ -263,6 +317,7 @@ _meteors(uint32_t *pixels, double time)
_line(pixels, x - start, y - start * 0.52, x - start - 6,
y - (start + 6) * 0.52, color, 169 - tail * 14);
}
+ _glow(pixels, x, y, 10, color, 56);
_glow(pixels, x, y, 4, color, 170);
}
}
@@ -271,6 +326,7 @@ static void
_jellyfish(uint32_t *pixels, double time)
{
_background(pixels, (Color){4, 19, 30}, (Color){6, 10, 28});
+ _glow(pixels, W * 0.36, 7, 194, (Color){17, 92, 106}, 62);
_stars(pixels, time * 0.5, 64);
for (unsigned int i = 0; i < 7; ++i)
{
@@ -308,7 +364,9 @@ _night_rain(uint32_t *pixels, double time)
double y = H * (0.56 + 0.44 * _noise(i + 96));
Color color = i % 3 ? (Color){68, 131, 223} : (Color){186, 65, 145};
- _glow(pixels, x, y, 8 + 20 * _noise(i + 84), color, 31);
+ _glow(pixels, x, y, 8 + 20 * _noise(i + 84), color, 43);
+ _line(pixels, x - 13, y + 2, x + 19, y + 2, color, 20);
+ _line(pixels, x - 7, y + 5, x + 12, y + 5, color, 15);
}
for (unsigned int i = 0; i < 165; ++i)
{
@@ -326,6 +384,7 @@ static void
_topography(uint32_t *pixels, double time)
{
_background(pixels, (Color){5, 20, 19}, (Color){11, 35, 28});
+ _glow(pixels, W * 0.52, H * 0.54, 157, (Color){39, 92, 56}, 70);
for (int ring = 0; ring < 30; ++ring)
{
double cx = W * 0.51 + 37 * sin(time * 0.10 + ring * 0.10);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.