This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch main
in repository elaro.
View the commit online.
commit 34b3109f722b8cf23995de11374cbc4d2745a31c
Author: Alastair Poole <[email protected]>
AuthorDate: Tue Nov 24 05:33:11 2026 +0000
fe: drop shadow
---
data/meson.build | 5 ++--
data/themes/widgets.edc | 29 ++++++++++++++-----
data/themes/window-shadow.png | Bin 0 -> 552 bytes
src/fe-efl/meson.build | 2 +-
src/fe-efl/ui/elaro_ui.c | 7 +----
src/fe-efl/ui/elaro_ui_private.h | 2 +-
src/fe-efl/ui/elaro_ui_theme.h | 1 +
src/fe-efl/ui/elaro_ui_util.c | 12 +-------
src/fe-efl/ui/elaro_ui_util.h | 2 ++
src/fe-efl/ui/elaro_ui_window.c | 61 ++++++++++++++++++++++++++++++++++++++-
10 files changed, 92 insertions(+), 29 deletions(-)
diff --git a/data/meson.build b/data/meson.build
index 8750e49..542a982 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -21,8 +21,9 @@ foreach name : ['midnight', 'porcelain', 'verdigris', 'ember']
elaro_assets += custom_target(name + '.edj',
input : 'themes' / name / (name + '.edc'),
output : name + '.edj',
- depend_files : theme_icons + files('themes/widgets.edc', 'themes/progress.edc'),
- command : [edje_cc, '-id', meson.current_source_dir() / 'themes' / name, '@INPUT@', '@OUTPUT@'],
+ depend_files : theme_icons + files('themes/widgets.edc', 'themes/progress.edc', 'themes/window-shadow.png'),
+ command : [edje_cc, '-id', meson.current_source_dir() / 'themes' / name,
+ '-id', meson.current_source_dir() / 'themes', '@INPUT@', '@OUTPUT@'],
build_by_default : true,
install : true,
install_dir : get_option('datadir') / 'elaro')
diff --git a/data/themes/widgets.edc b/data/themes/widgets.edc
index 0da5e40..7cb60b1 100644
--- a/data/themes/widgets.edc
+++ b/data/themes/widgets.edc
@@ -1,20 +1,30 @@
/* Shared contracts. Each EDC supplies its own palette and icon artwork. */
#include "progress.edc"
group { name: "elaro/frame";
+ images.image: "window-shadow.png" COMP;
parts {
+ part { name: "shadow"; type: IMAGE; mouse_events: 0; scale: 1;
+ description { state: "default" 0.0; image.normal: "window-shadow.png";
+ image.border: 24 24 24 24; image.border_scale: 1; }
+ description { state: "expanded" 0.0; inherit: "default" 0.0; visible: 0; }
+ }
part { name: "edge"; type: RECT; mouse_events: 0;
- scale: 1; description { offset_scale: 1; state: "default" 0.0; color: EDGE; } }
+ scale: 1; description { offset_scale: 1; state: "default" 0.0; color: EDGE;
+ rel1.offset: 5 3; rel2.offset: -6 -9; }
+ description { state: "expanded" 0.0; inherit: "default" 0.0;
+ rel1.offset: 0 0; rel2.offset: -1 -1; }
+ }
part { name: "surface"; type: RECT; mouse_events: 0;
- scale: 1; description { offset_scale: 1; state: "default" 0.0; rel1.offset: 1 1; rel2.offset: -2 -2; color: BG; } }
+ scale: 1; description { offset_scale: 1; state: "default" 0.0; rel.to: "edge"; rel1.offset: 1 1; rel2.offset: -2 -2; color: BG; } }
part { name: "accent"; type: RECT; mouse_events: 0;
- scale: 1; description { offset_scale: 1; state: "default" 0.0; rel1.offset: 1 1; rel2 { relative: 1 0; offset: -2 2; } color: ACCENT; } }
+ scale: 1; description { offset_scale: 1; state: "default" 0.0; rel.to: "edge"; rel1.offset: 1 1; rel2 { relative: 1 0; offset: -2 2; } color: ACCENT; } }
/* A real hit surface below the header's controls initiates window moves. */
part { name: "move"; type: RECT;
- scale: 1; description { offset_scale: 1; state: "default" 0.0; color: 0 0 0 0;
+ scale: 1; description { offset_scale: 1; state: "default" 0.0; color: 0 0 0 0; rel.to: "edge";
rel1.offset: 5 5; rel2 { relative: 1 0; offset: -5 39; } }
}
part { name: "elaro.content"; type: SWALLOW;
- scale: 1; description { offset_scale: 1; state: "default" 0.0; rel1.offset: 5 5; rel2.offset: -5 -5; } }
+ scale: 1; description { offset_scale: 1; state: "default" 0.0; rel.to: "edge"; rel1.offset: 5 5; rel2.offset: -5 -5; } }
#define GRIP(n, x1, y1, x2, y2, ox1, oy1, ox2, oy2) \
part { name: n; type: RECT; scale: 1; description { offset_scale: 1; state: "default" 0.0; color: 0 0 0 0; rel1 { relative: x1 y1; offset: ox1 oy1; } rel2 { relative: x2 y2; offset: ox2 oy2; } } }
GRIP("top", 0,0,1,0, 5,0,-5,4)
@@ -26,14 +36,19 @@ group { name: "elaro/frame";
GRIP("bl", 0,1,0,1, 0,-5,4,-1)
GRIP("br", 1,1,1,1, -5,-5,-1,-1)
}
-
+ programs {
+ program { signal: "elaro,expanded"; source: "elaro";
+ action: STATE_SET "expanded" 0.0; target: "edge"; target: "shadow"; }
+ program { signal: "elaro,restored"; source: "elaro";
+ action: STATE_SET "default" 0.0; target: "edge"; target: "shadow"; }
+ }
}
group { name: "elaro/dialog/frame";
inherit: "elaro/frame";
parts {
part { name: "move"; mouse_events: 0; }
part { name: "elaro.content";
- description { state: "default" 0.0; rel1.offset: 3 3; rel2.offset: -4 -4; }
+ description { state: "default" 0.0; rel.to: "edge"; rel1.offset: 3 3; rel2.offset: -4 -4; }
}
}
}
diff --git a/data/themes/window-shadow.png b/data/themes/window-shadow.png
new file mode 100644
index 0000000..6c2e5f1
Binary files /dev/null and b/data/themes/window-shadow.png differ
diff --git a/src/fe-efl/meson.build b/src/fe-efl/meson.build
index 2793949..96bce11 100644
--- a/src/fe-efl/meson.build
+++ b/src/fe-efl/meson.build
@@ -1,5 +1,5 @@
elementary_dep = declare_dependency(dependencies : [
- dependency('elementary', version : '>=1.26'), intl_dep])
+ dependency('elementary', version : '>=1.26'), dependency('ecore-evas'), intl_dep])
eet_dep = dependency('eet')
ecore_file_dep = dependency('ecore-file')
efreet_dep = dependency('efreet')
diff --git a/src/fe-efl/ui/elaro_ui.c b/src/fe-efl/ui/elaro_ui.c
index e247f92..e882d64 100644
--- a/src/fe-efl/ui/elaro_ui.c
+++ b/src/fe-efl/ui/elaro_ui.c
@@ -244,11 +244,6 @@ elaro_ui_run(int argc, char **argv)
elm_win_borderless_set(ui.win, EINA_TRUE);
elm_win_title_set(ui.win, _("Elaro — IRC"));
- ui.background = ""
- evas_object_size_hint_weight_set(ui.background, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(ui.win, ui.background);
- evas_object_show(ui.background);
-
icon = elm_icon_add(ui.win);
if (!elm_icon_standard_set(icon, "elaro"))
@@ -267,7 +262,6 @@ elaro_ui_run(int argc, char **argv)
elm_win_icon_object_set(ui.win, icon);
evas_object_smart_callback_add(ui.win, "delete,request", _close_window_cb, &ui);
box = ui.content = elm_box_add(ui.win);
- elaro_ui_opacity_apply(&ui);
elm_box_padding_set(box, 0, 0);
elaro_ui_expand(box);
ui.frame = elm_layout_add(ui.win);
@@ -276,6 +270,7 @@ elaro_ui_run(int argc, char **argv)
elm_win_resize_object_add(ui.win, ui.frame);
elm_object_part_content_set(ui.frame, "elaro.content", box);
elaro_ui_opacity_apply(&ui);
+ elaro_ui_window_shadow_bind(ui.win, ui.frame);
_frame_bind(&ui);
bar = elm_box_add(ui.win);
diff --git a/src/fe-efl/ui/elaro_ui_private.h b/src/fe-efl/ui/elaro_ui_private.h
index 15bd852..f9cdc5c 100644
--- a/src/fe-efl/ui/elaro_ui_private.h
+++ b/src/fe-efl/ui/elaro_ui_private.h
@@ -53,7 +53,7 @@ struct _Elaro_Ui
Ecore_Event_Handler *theme_config_handler;
Evas_Object *resize_grips[8];
Evas_Object *frame, *app_menu, *theme_buttons[4], *theme_status;
- Evas_Object *background, *content;
+ Evas_Object *content;
Evas_Object *buffer_panes, *user_panes;
Ecore_Animator *user_panel_animator;
double user_panel_animation_from;
diff --git a/src/fe-efl/ui/elaro_ui_theme.h b/src/fe-efl/ui/elaro_ui_theme.h
index 8c79ab2..f30f8b8 100644
--- a/src/fe-efl/ui/elaro_ui_theme.h
+++ b/src/fe-efl/ui/elaro_ui_theme.h
@@ -79,6 +79,7 @@ _theme_apply(Elaro_Ui *ui)
content = elm_object_part_content_unset(ui->frame, "elaro.content");
elm_layout_file_set(ui->frame, path, "elaro/frame");
if (content) elm_object_part_content_set(ui->frame, "elaro.content", content);
+ elaro_ui_window_shadow_sync(ui->win, ui->frame);
_frame_bind(ui);
}
if (ui->about)
diff --git a/src/fe-efl/ui/elaro_ui_util.c b/src/fe-efl/ui/elaro_ui_util.c
index c124a83..864df82 100644
--- a/src/fe-efl/ui/elaro_ui_util.c
+++ b/src/fe-efl/ui/elaro_ui_util.c
@@ -294,17 +294,7 @@ elaro_ui_opacity_apply(Elaro_Ui *ui)
opacity = ELARO_CLAMP(ui->config->window_opacity, ELARO_OPACITY_MIN, ELARO_OPACITY_MAX);
alpha = ui->config->window_transparent ? (255 * opacity + 50) / 100 : 255;
- elm_win_alpha_set(ui->win, ui->config->window_transparent);
- evas_object_color_set(ui->background, alpha, alpha, alpha, alpha);
- /* Setting the background object's colour also colours its rectangle.
- * Reset that rectangle afterwards so the theme supplies the background. */
- elm_bg_color_set(ui->background, -1, -1, -1);
- if (ui->frame)
- {
- evas_object_color_set(ui->content, 255, 255, 255, 255);
- evas_object_color_set(ui->frame, alpha, alpha, alpha, alpha);
- }
- else evas_object_color_set(ui->content, alpha, alpha, alpha, alpha);
+ evas_object_color_set(ui->frame, alpha, alpha, alpha, alpha);
}
/* Panes use proportions so restored widths also adapt to a different display. */
diff --git a/src/fe-efl/ui/elaro_ui_util.h b/src/fe-efl/ui/elaro_ui_util.h
index 387a061..2463881 100644
--- a/src/fe-efl/ui/elaro_ui_util.h
+++ b/src/fe-efl/ui/elaro_ui_util.h
@@ -39,6 +39,8 @@ Evas_Object *elaro_ui_popup_close_button_add(Elaro_Ui *ui, Evas_Object *popup,
void elaro_ui_popup_show(Evas_Object *popup);
void elaro_ui_popup_close(Evas_Object *popup);
Evas_Object *elaro_ui_tabs_add(Evas_Object *parent);
+void elaro_ui_window_shadow_bind(Evas_Object *win, Evas_Object *frame);
+void elaro_ui_window_shadow_sync(Evas_Object *win, Evas_Object *frame);
Evas_Object *elaro_ui_window_content_add(Evas_Object *win);
void elaro_ui_window_control_style_set(Evas_Object *button, Eina_Bool close);
void elaro_ui_view_reveal(Evas_Object *view);
diff --git a/src/fe-efl/ui/elaro_ui_window.c b/src/fe-efl/ui/elaro_ui_window.c
index 9ff181b..1abd274 100644
--- a/src/fe-efl/ui/elaro_ui_window.c
+++ b/src/fe-efl/ui/elaro_ui_window.c
@@ -1,5 +1,6 @@
#include "elaro_ui_util.h"
#include "../elaro_intl.h"
+#include <Ecore_Evas.h>
typedef struct {
Evas_Object *win, *frame, *root, *icons[3], *grips[8];
@@ -7,6 +8,61 @@ typedef struct {
static const char *window_icons[] = { "minimize", "maximize", "close" };
+static void
+_shadow_geometry_update(void *data, Evas *canvas, Evas_Object *frame, void *event)
+{
+ 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;
+ edje_object_calc_force(edje);
+ evas_object_geometry_get(edje, NULL, NULL, &width, &height);
+ if (edje_object_part_geometry_get(edje, "edge", &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
+elaro_ui_window_shadow_sync(Evas_Object *win, Evas_Object *frame)
+{
+ Eina_Bool expanded = elm_win_maximized_get(win) || elm_win_fullscreen_get(win);
+ elm_layout_signal_emit(frame, expanded ? "elaro,expanded" : "elaro,restored", "elaro");
+ edje_object_message_signal_process(elm_layout_edje_get(frame));
+ _shadow_geometry_update(NULL, evas_object_evas_get(frame), frame, NULL);
+}
+
+static const char *shadow_state_events[] = {
+ "maximized", "unmaximized", "fullscreen", "unfullscreen"
+};
+
+static void
+_shadow_state_changed(void *data, Evas_Object *win, void *event)
+{
+ elaro_ui_window_shadow_sync(win, data);
+}
+
+static void
+_shadow_unbind(void *data, Evas *canvas, Evas_Object *frame, void *event)
+{
+ for (unsigned int i = 0; i < EINA_C_ARRAY_LENGTH(shadow_state_events); i++)
+ evas_object_smart_callback_del_full(data, shadow_state_events[i],
+ _shadow_state_changed, frame);
+}
+
+void
+elaro_ui_window_shadow_bind(Evas_Object *win, Evas_Object *frame)
+{
+ elm_win_alpha_set(win, EINA_TRUE);
+ evas_object_event_callback_add(frame, EVAS_CALLBACK_RESIZE, _shadow_geometry_update, NULL);
+ evas_object_event_callback_add(frame, EVAS_CALLBACK_DEL, _shadow_unbind, win);
+ for (unsigned int i = 0; i < EINA_C_ARRAY_LENGTH(shadow_state_events); i++)
+ evas_object_smart_callback_add(win, shadow_state_events[i], _shadow_state_changed, frame);
+ elaro_ui_window_shadow_sync(win, frame);
+}
+
void
elaro_ui_window_control_style_set(Evas_Object *button, Eina_Bool close)
{
@@ -44,7 +100,8 @@ _window_resize(void *data, Evas *evas, Evas_Object *obj, void *info)
{
Window_Frame *frame = data;
Evas_Event_Mouse_Down *event = info;
- if (event->button != 1 || elm_win_maximized_get(frame->win)) return;
+ if (event->button != 1 || elm_win_maximized_get(frame->win) ||
+ elm_win_fullscreen_get(frame->win)) return;
for (unsigned int i = 0; i < EINA_C_ARRAY_LENGTH(frame->grips); i++)
if (obj == frame->grips[i])
{
@@ -86,6 +143,7 @@ _window_theme_changed(void *data, Evas_Object *obj, void *info)
snprintf(group, sizeof(group), "elaro/icons/%s", window_icons[i]);
elm_image_file_set(frame->icons[i], path, group);
}
+ elaro_ui_window_shadow_sync(frame->win, frame->frame);
_window_grips_update(frame, NULL, NULL, NULL);
}
@@ -138,6 +196,7 @@ elaro_ui_window_content_add(Evas_Object *win)
elm_layout_file_set(frame->frame, path, "elaro/dialog/frame");
evas_object_size_hint_weight_set(frame->frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, frame->frame);
+ elaro_ui_window_shadow_bind(win, frame->frame);
frame->root = elm_box_add(frame->frame);
evas_object_size_hint_weight_set(frame->root, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(frame->root, EVAS_HINT_FILL, EVAS_HINT_FILL);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.