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 1ab299d95c26b4a9d62e990247e517b221aad33a
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Nov 28 14:24:37 2026 +0000

    util: fix default popup close btn.
---
 NEWS                          |  1 +
 src/fe-efl/ui/elaro_ui_util.c | 27 ++++++++++++++++++++++++---
 tests/fe-efl/test-themes.c    | 12 +++++++++++-
 3 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index e7b96aa..b276c39 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Elaro 0.1.3
 
   * Icons now match each theme’s accent color.
   * The chat history uses full-height themed dividers with padding between the timestamp, nickname, and message columns.
+  * Default Elementary popups use a compact, flat close button in the top-right corner.
 
 ===========
 Elaro 0.1.2
diff --git a/src/fe-efl/ui/elaro_ui_util.c b/src/fe-efl/ui/elaro_ui_util.c
index 5b8fecd..f3891bd 100644
--- a/src/fe-efl/ui/elaro_ui_util.c
+++ b/src/fe-efl/ui/elaro_ui_util.c
@@ -421,6 +421,28 @@ elaro_ui_layout_restore(Elaro_Ui *ui)
       evas_object_move(ui->win, ui->config->window_x, ui->config->window_y);
 }
 
+static void
+_popup_close_button_theme_apply(void *data, Evas_Object *popup, void *info)
+{
+   Elaro_Ui *ui = data;
+   Evas_Object *button = evas_object_data_get(popup, "close");
+   Evas_Object *icon = elm_object_part_content_get(button, "icon");
+
+   if (ui->theme_path)
+      elaro_ui_window_control_style_set(button, EINA_TRUE);
+   else
+     {
+        elm_object_style_set(button, "anchor");
+        elaro_ui_size_min_set(button, 24, 24);
+        elaro_ui_size_max_set(button, 24, 24);
+        elaro_ui_size_min_set(icon, 14, 14);
+        elaro_ui_size_max_set(icon, 14, 14);
+     }
+   /* Default Elementary places the title icon on the left before mirroring. */
+   elm_object_mirrored_automatic_set(popup, !!ui->theme_path);
+   if (!ui->theme_path) elm_object_mirrored_set(popup, EINA_TRUE);
+}
+
 Evas_Object *
 elaro_ui_popup_close_button_add(Elaro_Ui *ui, Evas_Object *popup,
                                 Evas_Smart_Cb callback, void *data)
@@ -430,16 +452,15 @@ elaro_ui_popup_close_button_add(Elaro_Ui *ui, Evas_Object *popup,
 
    button = elm_button_add(popup);
    icon = elm_icon_add(button);
-   elaro_ui_window_control_style_set(button, EINA_TRUE);
    elaro_ui_icon_set(ui, icon, "close");
-   elaro_ui_size_min_set(icon, 19, 19);
-   elaro_ui_size_max_set(icon, 19, 19);
    elm_object_part_content_set(button, "icon", icon);
    elm_object_tooltip_text_set(button, _("Close"));
    elm_object_access_info_set(button, _("Close"));
    evas_object_smart_callback_add(button, "clicked", callback, data);
    elm_object_part_content_set(popup, "title,icon", button);
    evas_object_data_set(popup, "close", button);
+   _popup_close_button_theme_apply(ui, popup, NULL);
+   evas_object_smart_callback_add(popup, "theme,changed", _popup_close_button_theme_apply, ui);
    evas_object_show(icon);
    evas_object_show(button);
    return button;
diff --git a/tests/fe-efl/test-themes.c b/tests/fe-efl/test-themes.c
index f8f32bf..4ddfc86 100644
--- a/tests/fe-efl/test-themes.c
+++ b/tests/fe-efl/test-themes.c
@@ -746,11 +746,21 @@ _default_theme_check(Elaro_Ui *ui)
    assert(!strcmp(elm_entry_entry_get(entry), "Unsent draft"));
    assert(!strcmp(elm_object_text_get(label), "Dialog content"));
 
+   _settle();
+   Evas_Object *close = evas_object_data_get(ui->app_menu, "close");
+   Evas_Object *menu_body = elm_object_content_get(ui->app_menu);
+   int close_x, close_y, close_w, close_h, body_x, body_y, body_w;
+   evas_object_geometry_get(close, &close_x, &close_y, &close_w, &close_h);
+   evas_object_geometry_get(menu_body, &body_x, &body_y, &body_w, NULL);
+   assert(!strcmp(elm_object_style_get(close), "anchor"));
+   assert(close_w > 0 && close_h > 0 && close_y + close_h <= body_y);
+   assert(close_x + close_w / 2 > body_x + body_w / 2);
+
    Eina_Error error = 0;
    Elaro_Config *saved = elaro_config_load(&error);
    assert(saved && !error && saved->theme == ELARO_THEME_DEFAULT);
    elaro_config_free(saved);
-   _close_and_wait(ui->app_menu, evas_object_data_get(ui->app_menu, "close"));
+   _close_and_wait(ui->app_menu, close);
    evas_object_del(dialog);
 }
 

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

Reply via email to