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 6a84f18dbcd46cd6f2410de8808c081b80292d6a
Author: Alastair Poole <[email protected]>
AuthorDate: Tue Nov 24 15:20:39 2026 +0000

    ui: add theme.c
---
 src/fe-efl/ui/elaro_ui.c                           |  23 +-
 src/fe-efl/ui/elaro_ui_palette.h                   | 118 ------
 .../ui/{elaro_ui_theme.h => elaro_ui_theme.c}      | 176 ++++++--
 src/fe-efl/ui/elaro_ui_theme.h                     | 447 +--------------------
 src/fe-efl/ui/meson.build                          |   1 +
 tests/fe-efl/meson.build                           |   5 +-
 tests/fe-efl/test-themes.c                         |  50 ++-
 7 files changed, 194 insertions(+), 626 deletions(-)

diff --git a/src/fe-efl/ui/elaro_ui.c b/src/fe-efl/ui/elaro_ui.c
index 01d6f1c..361adad 100644
--- a/src/fe-efl/ui/elaro_ui.c
+++ b/src/fe-efl/ui/elaro_ui.c
@@ -1,4 +1,5 @@
 #include "elaro_ui_private.h"
+#include "elaro_ui_theme.h"
 #include <locale.h>
 
 static void
@@ -164,7 +165,17 @@ _close_window_cb(void *data, Evas_Object *obj, void *info)
    elm_exit();
 }
 
-#include "elaro_ui_theme.h"
+static void
+_window_minimize(void *data, Evas_Object *obj, void *info)
+{
+   elm_win_iconified_set(((Elaro_Ui *)data)->win, EINA_TRUE);
+}
+static void
+_window_maximize(void *data, Evas_Object *obj, void *info)
+{
+   Evas_Object *win = ((Elaro_Ui *)data)->win;
+   elm_win_maximized_set(win, !elm_win_maximized_get(win));
+}
 
 static Eina_Bool
 _smoke_done_cb(void *data)
@@ -253,7 +264,7 @@ elaro_ui_run(int argc, char **argv)
      }
    elaro_ui_dcc_init(&ui);
 
-   _theme_apply(&ui);
+   elaro_ui_theme_apply(&ui);
    ui.win = elm_win_add(NULL, "elaro", ELM_WIN_BASIC);
    elm_win_title_set(ui.win, _("Elaro — IRC"));
 
@@ -290,7 +301,7 @@ elaro_ui_run(int argc, char **argv)
    evas_object_show(bar);
 
    connection = ui.menu_button
-       = elaro_ui_icon_button_add(ui.win, "menu", _("Application menu"), _menu_show, &ui);
+       = elaro_ui_icon_button_add(ui.win, "menu", _("Application menu"), elaro_ui_theme_menu_show, &ui);
    elaro_ui_window_control_style_set(connection, EINA_FALSE);
    evas_object_size_hint_align_set(connection, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(bar, connection);
@@ -323,7 +334,7 @@ elaro_ui_run(int argc, char **argv)
    evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elaro_ui_size_min_set(icon, 30, 29);
-   evas_object_event_callback_add(icon, EVAS_CALLBACK_MOUSE_DOWN, _frame_move, &ui);
+   evas_object_event_callback_add(icon, EVAS_CALLBACK_MOUSE_DOWN, elaro_ui_theme_frame_move, &ui);
    elm_box_pack_end(bar, icon);
    evas_object_show(icon);
 
@@ -403,7 +414,7 @@ elaro_ui_run(int argc, char **argv)
                                       ECORE_FD_READ, _receive_events_cb, &ui,
                                       NULL, NULL);
    if (!events) EINA_LOG_CRIT("Cannot watch engine events");
-   _main_frame_apply(&ui);
+   elaro_ui_theme_frame_apply(&ui);
    elaro_ui_layout_restore(&ui);
    evas_object_event_callback_add(ui.win, EVAS_CALLBACK_RESIZE, _window_resized_cb, &ui);
    evas_object_smart_callback_add(ui.win, "moved", _layout_changed_cb, &ui);
@@ -438,7 +449,7 @@ elaro_ui_run(int argc, char **argv)
    evas_object_del(ui.win);
    elaro_config_free(ui.config);
    free(ui.binary);
-   _theme_shutdown(&ui);
+   elaro_ui_theme_shutdown(&ui);
    free(ui.config_error);
    elm_shutdown();
 
diff --git a/src/fe-efl/ui/elaro_ui_palette.h b/src/fe-efl/ui/elaro_ui_palette.h
deleted file mode 100644
index 34487ec..0000000
--- a/src/fe-efl/ui/elaro_ui_palette.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Palette contracts for inherited Elementary widgets. Values live in each EDC. */
-static const char *palette_classes[] = {
-   "/bg-alt/normal/list",
-   "/bg-alt/normal/list/item",
-   "/bg/normal/button",
-   "/bg/normal/check/base",
-   "/bg/normal/entry",
-   "/bg/normal/entry/selection",
-   "/bg/normal/frame",
-   "/bg/normal/frame/title",
-   "/bg/normal/hover/base",
-   "/bg/normal/hoversel",
-   "/bg/normal/hoversel/item",
-   "/bg/normal/hoversel/menu",
-   "/bg/normal/list",
-   "/bg/normal/list/group",
-   "/bg/normal/list/item",
-   "/bg/normal/popup/base",
-   "/bg/normal/scroller/base",
-   "/bg/normal/segmentcontrol/item",
-   "/bg/normal/slider/base",
-   "/bg/normal/toggle/base",
-   "/bg/pressed/button",
-   "/bg/pressed/button-media",
-   "/bg/pressed/check/base",
-   "/bg/pressed/segmentcontrol/item",
-   "/bg/pressed/toggle/base",
-   "/bg/selected/entry/focus",
-   "/bg/selected/hoversel/item",
-   "/bg/selected/hoversel/menu/bar",
-   "/bg/selected/list/item",
-   "/bg/selected/segmentcontrol/item",
-   "/bg/selected/titlebar",
-   "/fg/normal/button",
-   "/fg/normal/button-anchor",
-   "/fg/normal/button-media",
-   "/fg/normal/check/check",
-   "/fg/normal/check/text",
-   "/fg/normal/combobox/button",
-   "/fg/normal/combobox/selector",
-   "/fg/normal/entry/anchor",
-   "/fg/normal/entry/mention",
-   "/fg/normal/entry/cursor",
-   "/fg/normal/entry/handler/end",
-   "/fg/normal/entry/handler/start",
-   "/fg/normal/frame/separator",
-   "/fg/normal/frame/title",
-   "/fg/normal/hoversel/button",
-   "/fg/normal/hoversel/item",
-   "/fg/normal/hoversel/selector",
-   "/fg/normal/icon",
-   "/fg/normal/list/album",
-   "/fg/normal/list/group",
-   "/fg/normal/list/item",
-   "/fg/normal/list/item/title",
-   "/fg/normal/list/item/title2",
-   "/fg/normal/list/mode",
-   "/fg/normal/list/track",
-   "/fg/normal/list/track-title",
-   "/fg/normal/panes/flush",
-   "/fg/normal/panes/fold/arrow",
-   "/fg/normal/panes/handle",
-   "/fg/normal/scroller/bar/horizontal",
-   "/fg/normal/scroller/bar/vertical",
-   "/fg/normal/segmentcontrol/item",
-   "/fg/normal/slider/bar",
-   "/fg/normal/slider/indicator",
-   "/fg/normal/slider/knob",
-   "/fg/normal/slider/text",
-   "/fg/normal/slider/text/units",
-   "/fg/normal/spinner/arrow",
-   "/fg/normal/spinner/text",
-   "/fg/normal/toggle/button",
-   "/fg/normal/toggle/text",
-   "/fg/normal/toggle/text/off",
-   "/fg/normal/toggle/text/on",
-   "/fg/pressed/button",
-   "/fg/pressed/button-anchor",
-   "/fg/pressed/button-media",
-   "/fg/pressed/check/check",
-   "/fg/pressed/check/text",
-   "/fg/pressed/combobox/button",
-   "/fg/pressed/combobox/selector",
-   "/fg/pressed/hoversel/button",
-   "/fg/pressed/hoversel/selector",
-   "/fg/pressed/panes/fold/arrow",
-   "/fg/pressed/panes/handle",
-   "/fg/pressed/scroller/bar/horizontal",
-   "/fg/pressed/scroller/bar/vertical",
-   "/fg/pressed/segmentcontrol/item",
-   "/fg/pressed/slider/knob",
-   "/fg/pressed/spinner/arrow",
-   "/fg/pressed/titlebar/buttons/close",
-   "/fg/pressed/toggle/button",
-   "/fg/pressed/toggle/text",
-   "/fg/pressed/toggle/text/off",
-   "/fg/pressed/toggle/text/on",
-   "/fg/selected/check/check",
-   "/fg/selected/hoversel/item",
-   "/fg/selected/list/album",
-   "/fg/selected/list/artist",
-   "/fg/selected/list/item",
-   "/fg/selected/list/item/sub",
-   "/fg/selected/list/item/title",
-   "/fg/selected/list/item/title2",
-   "/fg/selected/list/mode",
-   "/fg/selected/list/title",
-   "/fg/selected/list/track",
-   "/fg/selected/list/track-length",
-   "/fg/selected/list/track-title",
-   "/fg/selected/segmentcontrol/item",
-   "/fg/selected/titlebar",
-   "/fg/selected/titlebar/buttons/close",
-   "/fg/normal/entry/text",
-   "/fg/normal/entry/text/guide",
-   "/fg/normal/popup/text",
-   "/fg/normal/popup/text/title",
-};
diff --git a/src/fe-efl/ui/elaro_ui_theme.h b/src/fe-efl/ui/elaro_ui_theme.c
similarity index 78%
copy from src/fe-efl/ui/elaro_ui_theme.h
copy to src/fe-efl/ui/elaro_ui_theme.c
index 40e6988..d994ce0 100644
--- a/src/fe-efl/ui/elaro_ui_theme.h
+++ b/src/fe-efl/ui/elaro_ui_theme.c
@@ -1,10 +1,127 @@
-#ifndef ELARO_UI_THEME_H
-#define ELARO_UI_THEME_H
-#include "elaro_ui_palette.h"
-#include "elaro_ui_options.h"
+#include "elaro_ui_private.h"
+#include "elaro_ui_theme.h"
+
+/* Palette contracts for inherited Elementary widgets. Values live in each EDC. */
+static const char *palette_classes[] = {
+   "/bg-alt/normal/list",
+   "/bg-alt/normal/list/item",
+   "/bg/normal/button",
+   "/bg/normal/check/base",
+   "/bg/normal/entry",
+   "/bg/normal/entry/selection",
+   "/bg/normal/frame",
+   "/bg/normal/frame/title",
+   "/bg/normal/hover/base",
+   "/bg/normal/hoversel",
+   "/bg/normal/hoversel/item",
+   "/bg/normal/hoversel/menu",
+   "/bg/normal/list",
+   "/bg/normal/list/group",
+   "/bg/normal/list/item",
+   "/bg/normal/popup/base",
+   "/bg/normal/scroller/base",
+   "/bg/normal/segmentcontrol/item",
+   "/bg/normal/slider/base",
+   "/bg/normal/toggle/base",
+   "/bg/pressed/button",
+   "/bg/pressed/button-media",
+   "/bg/pressed/check/base",
+   "/bg/pressed/segmentcontrol/item",
+   "/bg/pressed/toggle/base",
+   "/bg/selected/entry/focus",
+   "/bg/selected/hoversel/item",
+   "/bg/selected/hoversel/menu/bar",
+   "/bg/selected/list/item",
+   "/bg/selected/segmentcontrol/item",
+   "/bg/selected/titlebar",
+   "/fg/normal/button",
+   "/fg/normal/button-anchor",
+   "/fg/normal/button-media",
+   "/fg/normal/check/check",
+   "/fg/normal/check/text",
+   "/fg/normal/combobox/button",
+   "/fg/normal/combobox/selector",
+   "/fg/normal/entry/anchor",
+   "/fg/normal/entry/mention",
+   "/fg/normal/entry/cursor",
+   "/fg/normal/entry/handler/end",
+   "/fg/normal/entry/handler/start",
+   "/fg/normal/frame/separator",
+   "/fg/normal/frame/title",
+   "/fg/normal/hoversel/button",
+   "/fg/normal/hoversel/item",
+   "/fg/normal/hoversel/selector",
+   "/fg/normal/icon",
+   "/fg/normal/list/album",
+   "/fg/normal/list/group",
+   "/fg/normal/list/item",
+   "/fg/normal/list/item/title",
+   "/fg/normal/list/item/title2",
+   "/fg/normal/list/mode",
+   "/fg/normal/list/track",
+   "/fg/normal/list/track-title",
+   "/fg/normal/panes/flush",
+   "/fg/normal/panes/fold/arrow",
+   "/fg/normal/panes/handle",
+   "/fg/normal/scroller/bar/horizontal",
+   "/fg/normal/scroller/bar/vertical",
+   "/fg/normal/segmentcontrol/item",
+   "/fg/normal/slider/bar",
+   "/fg/normal/slider/indicator",
+   "/fg/normal/slider/knob",
+   "/fg/normal/slider/text",
+   "/fg/normal/slider/text/units",
+   "/fg/normal/spinner/arrow",
+   "/fg/normal/spinner/text",
+   "/fg/normal/toggle/button",
+   "/fg/normal/toggle/text",
+   "/fg/normal/toggle/text/off",
+   "/fg/normal/toggle/text/on",
+   "/fg/pressed/button",
+   "/fg/pressed/button-anchor",
+   "/fg/pressed/button-media",
+   "/fg/pressed/check/check",
+   "/fg/pressed/check/text",
+   "/fg/pressed/combobox/button",
+   "/fg/pressed/combobox/selector",
+   "/fg/pressed/hoversel/button",
+   "/fg/pressed/hoversel/selector",
+   "/fg/pressed/panes/fold/arrow",
+   "/fg/pressed/panes/handle",
+   "/fg/pressed/scroller/bar/horizontal",
+   "/fg/pressed/scroller/bar/vertical",
+   "/fg/pressed/segmentcontrol/item",
+   "/fg/pressed/slider/knob",
+   "/fg/pressed/spinner/arrow",
+   "/fg/pressed/titlebar/buttons/close",
+   "/fg/pressed/toggle/button",
+   "/fg/pressed/toggle/text",
+   "/fg/pressed/toggle/text/off",
+   "/fg/pressed/toggle/text/on",
+   "/fg/selected/check/check",
+   "/fg/selected/hoversel/item",
+   "/fg/selected/list/album",
+   "/fg/selected/list/artist",
+   "/fg/selected/list/item",
+   "/fg/selected/list/item/sub",
+   "/fg/selected/list/item/title",
+   "/fg/selected/list/item/title2",
+   "/fg/selected/list/mode",
+   "/fg/selected/list/title",
+   "/fg/selected/list/track",
+   "/fg/selected/list/track-length",
+   "/fg/selected/list/track-title",
+   "/fg/selected/segmentcontrol/item",
+   "/fg/selected/titlebar",
+   "/fg/selected/titlebar/buttons/close",
+   "/fg/normal/entry/text",
+   "/fg/normal/entry/text/guide",
+   "/fg/normal/popup/text",
+   "/fg/normal/popup/text/title",
+};
 
 static void _frame_bind(Elaro_Ui *ui);
-static void _main_frame_apply(Elaro_Ui *ui);
+static void _menu_close(void *data, Evas_Object *obj, void *info);
 
 static const char *theme_names[ELARO_THEME_DEFAULT] = {
    "midnight", "porcelain", "verdigris", "ember"
@@ -36,8 +153,8 @@ _theme_config_changed(void *data, int type, void *event)
    return ECORE_CALLBACK_RENEW;
 }
 
-static void
-_theme_shutdown(Elaro_Ui *ui)
+void
+elaro_ui_theme_shutdown(Elaro_Ui *ui)
 {
    if (ui->theme_config_handler) ecore_event_handler_del(ui->theme_config_handler);
    ui->theme_config_handler = NULL;
@@ -74,8 +191,8 @@ _theme_path_get(Elaro_Ui *ui)
    return path;
 }
 
-static void
-_theme_apply(Elaro_Ui *ui)
+void
+elaro_ui_theme_apply(Elaro_Ui *ui)
 {
    char *path = _theme_path_get(ui);
    char *previous = ui->theme_path;
@@ -95,7 +212,7 @@ _theme_apply(Elaro_Ui *ui)
    if (!ui->theme_config_handler)
       ui->theme_config_handler = ecore_event_handler_add(ELM_EVENT_CONFIG_ALL_CHANGED,
                                                          _theme_config_changed, ui);
-   if (ui->content) _main_frame_apply(ui);
+   if (ui->content) elaro_ui_theme_frame_apply(ui);
    if (ui->connection.popup) elaro_ui_options_transparency_update(ui);
    if (ui->about) elaro_ui_about_theme_apply(ui);
    elaro_ui_icons_refresh(ui);
@@ -133,23 +250,19 @@ _theme_selected(void *data, Evas_Object *obj, void *info)
    int index = (int)(intptr_t)evas_object_data_get(obj, "theme-index");
    if (index < 0 || index >= ELARO_THEME_COUNT) return;
    ui->config->theme = index;
-   _theme_apply(ui);
+   elaro_ui_theme_apply(ui);
    elaro_ui_buffers_recreate(ui);
    if (ui->nicks) elm_genlist_realized_items_update(ui->nicks);
-   _theme_menu_selection_update(ui);
    if (!elaro_config_save(ui->config, &error))
      {
+        _theme_menu_selection_update(ui);
         elm_object_text_set(ui->theme_status, _("Theme applied. Could not save your preference."));
         elm_box_unpack(evas_object_data_get(ui->theme_status, "box"), ui->theme_status);
         elm_box_pack_after(evas_object_data_get(ui->theme_status, "box"), ui->theme_status,
                            evas_object_data_get(ui->theme_status, "separator"));
         evas_object_show(ui->theme_status);
      }
-   else
-     {
-        elm_box_unpack(evas_object_data_get(ui->theme_status, "box"), ui->theme_status);
-        evas_object_hide(ui->theme_status);
-     }
+   else _menu_close(ui, obj, info);
 }
 
 static void
@@ -162,8 +275,8 @@ _frame_resize(void *data, Evas *evas, Evas_Object *obj, void *info)
      elm_win_move_resize_start(ui->win, mode);
 }
 
-static void
-_frame_move(void *data, Evas *evas, Evas_Object *obj, void *info)
+void
+elaro_ui_theme_frame_move(void *data, Evas *evas, Evas_Object *obj, void *info)
 {
    Elaro_Ui *ui = data;
    Evas_Event_Mouse_Down *ev = info;
@@ -249,12 +362,12 @@ _frame_bind(Elaro_Ui *ui)
        elm_layout_edje_get(ui->frame), "move");
    if (!surface) return;
    evas_object_pass_events_set(surface, EINA_FALSE);
-   evas_object_event_callback_del_full(surface, EVAS_CALLBACK_MOUSE_DOWN, _frame_move, ui);
-   evas_object_event_callback_add(surface, EVAS_CALLBACK_MOUSE_DOWN, _frame_move, ui);
+   evas_object_event_callback_del_full(surface, EVAS_CALLBACK_MOUSE_DOWN, elaro_ui_theme_frame_move, ui);
+   evas_object_event_callback_add(surface, EVAS_CALLBACK_MOUSE_DOWN, elaro_ui_theme_frame_move, ui);
 }
 
-static void
-_main_frame_apply(Elaro_Ui *ui)
+void
+elaro_ui_theme_frame_apply(Elaro_Ui *ui)
 {
    Eina_Bool custom = ui->theme_path != NULL;
 
@@ -318,18 +431,6 @@ _main_frame_apply(Elaro_Ui *ui)
    evas_object_show(ui->content);
 }
 
-static void
-_window_minimize(void *data, Evas_Object *obj, void *info)
-{
-   elm_win_iconified_set(((Elaro_Ui *)data)->win, EINA_TRUE);
-}
-static void
-_window_maximize(void *data, Evas_Object *obj, void *info)
-{
-   Evas_Object *win = ((Elaro_Ui *)data)->win;
-   elm_win_maximized_set(win, !elm_win_maximized_get(win));
-}
-
 static void
 _menu_close(void *data, Evas_Object *obj, void *info)
 {
@@ -388,8 +489,8 @@ _menu_button(Elaro_Ui *ui, Evas_Object *parent, const char *asset,
    return button;
 }
 
-static void
-_menu_show(void *data, Evas_Object *obj, void *info)
+void
+elaro_ui_theme_menu_show(void *data, Evas_Object *obj, void *info)
 {
    Elaro_Ui *ui = data;
    Evas_Object *box, *heading, *button, *spacer;
@@ -444,4 +545,3 @@ _menu_show(void *data, Evas_Object *obj, void *info)
    elaro_ui_popup_close_button_add(ui, ui->app_menu, _menu_close, ui);
    elaro_ui_popup_show(ui->app_menu);
 }
-#endif
diff --git a/src/fe-efl/ui/elaro_ui_theme.h b/src/fe-efl/ui/elaro_ui_theme.h
index 40e6988..36db669 100644
--- a/src/fe-efl/ui/elaro_ui_theme.h
+++ b/src/fe-efl/ui/elaro_ui_theme.h
@@ -1,447 +1,12 @@
 #ifndef ELARO_UI_THEME_H
 #define ELARO_UI_THEME_H
-#include "elaro_ui_palette.h"
-#include "elaro_ui_options.h"
 
-static void _frame_bind(Elaro_Ui *ui);
-static void _main_frame_apply(Elaro_Ui *ui);
+#include "elaro_ui.h"
 
-static const char *theme_names[ELARO_THEME_DEFAULT] = {
-   "midnight", "porcelain", "verdigris", "ember"
-};
-static const char *theme_labels[ELARO_THEME_COUNT] = {
-   "Midnight", "Porcelain", "Verdigris", "Ember", N_("Default")
-};
+void elaro_ui_theme_apply(Elaro_Ui *ui);
+void elaro_ui_theme_shutdown(Elaro_Ui *ui);
+void elaro_ui_theme_frame_apply(Elaro_Ui *ui);
+void elaro_ui_theme_frame_move(void *data, Evas *evas, Evas_Object *obj, void *info);
+void elaro_ui_theme_menu_show(void *data, Evas_Object *obj, void *info);
 
-static void
-_theme_palette_apply(Elaro_Ui *ui)
-{
-   if (!ui->theme_path) return;
-   for (unsigned int i = 0; i < EINA_C_ARRAY_LENGTH(palette_classes); i++)
-     {
-        char *value = edje_file_data_get(ui->theme_path, palette_classes[i]);
-        int r, g, b, a;
-        if (value && sscanf(value, "%d %d %d %d", &r, &g, &b, &a) == 4)
-          edje_color_class_set(palette_classes[i], r, g, b, a, r, g, b, a, r, g, b, a);
-        free(value);
-     }
-}
-
-static Eina_Bool
-_theme_config_changed(void *data, int type, void *event)
-{
-   /* Elementary clears global palette classes when desktop settings reload.
-    * Its completion event arrives after that reset, including for open popups. */
-   _theme_palette_apply(data);
-   return ECORE_CALLBACK_RENEW;
-}
-
-static void
-_theme_shutdown(Elaro_Ui *ui)
-{
-   if (ui->theme_config_handler) ecore_event_handler_del(ui->theme_config_handler);
-   ui->theme_config_handler = NULL;
-   if (ui->theme_path) elm_theme_overlay_del(NULL, ui->theme_path);
-   free(ui->theme_path);
-   ui->theme_path = NULL;
-}
-
-static char *
-_theme_path_get(Elaro_Ui *ui)
-{
-   int index = ui->config->theme;
-   if (index < 0 || index >= ELARO_THEME_DEFAULT) return NULL;
-
-   char *name = elaro_string_printf("%s.edj", theme_names[index]);
-   /* A checkout must not silently use older, installed theme archives. */
-   char *build_dir = ecore_file_dir_get(ELARO_ASSET_BUILD_DIR);
-   Eina_Bool development = !ui->binary ||
-       (build_dir && !strncmp(ui->binary, build_dir, strlen(build_dir))
-        && ui->binary[strlen(build_dir)] == '/');
-   free(build_dir);
-   char *path = elaro_path_join(development ? ELARO_ASSET_BUILD_DIR : ELARO_DATA_DIR, name, NULL);
-   if (!ecore_file_exists(path))
-     {
-        free(path);
-        path = elaro_path_join(development ? ELARO_DATA_DIR : ELARO_ASSET_BUILD_DIR, name, NULL);
-        if (!ecore_file_exists(path))
-          {
-             free(path);
-             path = NULL;
-          }
-     }
-   free(name);
-   return path;
-}
-
-static void
-_theme_apply(Elaro_Ui *ui)
-{
-   char *path = _theme_path_get(ui);
-   char *previous = ui->theme_path;
-   Eina_Bool changed = previous ? (!path || strcmp(path, previous)) : path != NULL;
-   ui->theme_path = path;
-   if (changed)
-     {
-        if (path) elm_theme_overlay_add(NULL, path);
-        else
-          for (unsigned int i = 0; i < EINA_C_ARRAY_LENGTH(palette_classes); i++)
-             edje_color_class_del(palette_classes[i]);
-        if (previous) elm_theme_overlay_del(NULL, previous);
-     }
-   free(previous);
-
-   _theme_palette_apply(ui);
-   if (!ui->theme_config_handler)
-      ui->theme_config_handler = ecore_event_handler_add(ELM_EVENT_CONFIG_ALL_CHANGED,
-                                                         _theme_config_changed, ui);
-   if (ui->content) _main_frame_apply(ui);
-   if (ui->connection.popup) elaro_ui_options_transparency_update(ui);
-   if (ui->about) elaro_ui_about_theme_apply(ui);
-   elaro_ui_icons_refresh(ui);
-   if (changed) elaro_ui_dialog_frames_refresh();
-}
-
-static void
-_theme_menu_selection_update(Elaro_Ui *ui)
-{
-   for (int i = 0; i < ELARO_THEME_COUNT; i++)
-     {
-        Evas_Object *button = ui->theme_buttons[i];
-        if (!button) continue;
-
-        Eina_Bool selected = i == ui->config->theme;
-        elm_object_signal_emit(button, selected ? "elaro,selected,on" : "elaro,selected,off",
-                               "elaro");
-        Evas_Object *label = evas_object_data_get(button, "menu-label");
-        const char *text = _(theme_labels[i]);
-        if (selected && !ui->theme_path)
-          {
-             char *markup = elaro_string_printf("<b>%s</b>", text);
-             elm_object_text_set(label, markup);
-             free(markup);
-          }
-        else elm_object_text_set(label, text);
-     }
-}
-
-static void
-_theme_selected(void *data, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   Eina_Error error = 0;
-   int index = (int)(intptr_t)evas_object_data_get(obj, "theme-index");
-   if (index < 0 || index >= ELARO_THEME_COUNT) return;
-   ui->config->theme = index;
-   _theme_apply(ui);
-   elaro_ui_buffers_recreate(ui);
-   if (ui->nicks) elm_genlist_realized_items_update(ui->nicks);
-   _theme_menu_selection_update(ui);
-   if (!elaro_config_save(ui->config, &error))
-     {
-        elm_object_text_set(ui->theme_status, _("Theme applied. Could not save your preference."));
-        elm_box_unpack(evas_object_data_get(ui->theme_status, "box"), ui->theme_status);
-        elm_box_pack_after(evas_object_data_get(ui->theme_status, "box"), ui->theme_status,
-                           evas_object_data_get(ui->theme_status, "separator"));
-        evas_object_show(ui->theme_status);
-     }
-   else
-     {
-        elm_box_unpack(evas_object_data_get(ui->theme_status, "box"), ui->theme_status);
-        evas_object_hide(ui->theme_status);
-     }
-}
-
-static void
-_frame_resize(void *data, Evas *evas, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   Evas_Event_Mouse_Down *ev = info;
-   Elm_Win_Move_Resize_Mode mode = (intptr_t)evas_object_data_get(obj, "elaro-resize-mode");
-   if (ev->button == 1 && !elm_win_maximized_get(ui->win))
-     elm_win_move_resize_start(ui->win, mode);
-}
-
-static void
-_frame_move(void *data, Evas *evas, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   Evas_Event_Mouse_Down *ev = info;
-   if (!ui->frame || ev->button != 1) return;
-   if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
-     elm_win_maximized_set(ui->win, !elm_win_maximized_get(ui->win));
-   else elm_win_move_resize_start(ui->win, ELM_WIN_MOVE_RESIZE_MOVE);
-}
-
-/* Keep resize hit surfaces above popup backdrops as well as window content. */
-static void
-_frame_grips_update(void *data, Evas *evas, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   int x, y, w, h, g = ELM_SCALE_SIZE(5);
-   evas_object_geometry_get(ui->frame, &x, &y, &w, &h);
-   int geometry[8][4] = {
-      {x+g,y,w-2*g,g}, {x+g,y+h-g,w-2*g,g},
-      {x,y+g,g,h-2*g}, {x+w-g,y+g,g,h-2*g},
-      {x,y,g,g}, {x+w-g,y,g,g}, {x,y+h-g,g,g}, {x+w-g,y+h-g,g,g}
-   };
-   for (unsigned int i = 0; i < 8; i++)
-     {
-        evas_object_move(ui->resize_grips[i], geometry[i][0], geometry[i][1]);
-        evas_object_resize(ui->resize_grips[i], geometry[i][2], geometry[i][3]);
-     }
-}
-
-static void _frame_theme_changed(void *data, Evas_Object *obj, void *info);
-
-static void
-_frame_grips_free(void *data, Evas *evas, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   evas_object_smart_callback_del_full(ui->win, "theme,changed", _frame_theme_changed, ui);
-   for (unsigned int i = 0; i < 8; i++)
-     {
-        evas_object_del(ui->resize_grips[i]);
-        ui->resize_grips[i] = NULL;
-     }
-}
-
-static void
-_frame_theme_changed(void *data, Evas_Object *obj, void *info)
-{
-   _frame_bind(data);
-}
-
-static void
-_frame_bind(Elaro_Ui *ui)
-{
-   static const struct { const char *part; Elm_Win_Move_Resize_Mode mode; } edges[] = {
-      {"top", ELM_WIN_MOVE_RESIZE_TOP}, {"bottom", ELM_WIN_MOVE_RESIZE_BOTTOM},
-      {"left", ELM_WIN_MOVE_RESIZE_LEFT}, {"right", ELM_WIN_MOVE_RESIZE_RIGHT},
-      {"tl", ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_LEFT},
-      {"tr", ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_RIGHT},
-      {"bl", ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_LEFT},
-      {"br", ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_RIGHT}
-   };
-   for (unsigned int i = 0; i < EINA_C_ARRAY_LENGTH(edges); i++)
-     {
-        Evas_Object *edge = ui->resize_grips[i];
-        if (!edge)
-          {
-             edge = ui->resize_grips[i] = evas_object_rectangle_add(evas_object_evas_get(ui->win));
-             evas_object_color_set(edge, 0, 0, 0, 0);
-             evas_object_layer_set(edge, EVAS_LAYER_MAX);
-             evas_object_data_set(edge, "elaro-resize-mode", (void *)(intptr_t)edges[i].mode);
-             evas_object_event_callback_add(edge, EVAS_CALLBACK_MOUSE_DOWN, _frame_resize, ui);
-             evas_object_show(edge);
-          }
-     }
-   evas_object_event_callback_del_full(ui->frame, EVAS_CALLBACK_RESIZE, _frame_grips_update, ui);
-   evas_object_event_callback_del_full(ui->frame, EVAS_CALLBACK_MOVE, _frame_grips_update, ui);
-   evas_object_event_callback_add(ui->frame, EVAS_CALLBACK_RESIZE, _frame_grips_update, ui);
-   evas_object_event_callback_add(ui->frame, EVAS_CALLBACK_MOVE, _frame_grips_update, ui);
-   evas_object_event_callback_del_full(ui->frame, EVAS_CALLBACK_DEL, _frame_grips_free, ui);
-   evas_object_event_callback_add(ui->frame, EVAS_CALLBACK_DEL, _frame_grips_free, ui);
-   evas_object_smart_callback_del_full(ui->win, "theme,changed", _frame_theme_changed, ui);
-   evas_object_smart_callback_add(ui->win, "theme,changed", _frame_theme_changed, ui);
-   _frame_grips_update(ui, NULL, NULL, NULL);
-   Evas_Object *surface = (Evas_Object *)edje_object_part_object_get(
-       elm_layout_edje_get(ui->frame), "move");
-   if (!surface) return;
-   evas_object_pass_events_set(surface, EINA_FALSE);
-   evas_object_event_callback_del_full(surface, EVAS_CALLBACK_MOUSE_DOWN, _frame_move, ui);
-   evas_object_event_callback_add(surface, EVAS_CALLBACK_MOUSE_DOWN, _frame_move, ui);
-}
-
-static void
-_main_frame_apply(Elaro_Ui *ui)
-{
-   Eina_Bool custom = ui->theme_path != NULL;
-
-   if (ui->toolbar)
-     {
-        elm_object_style_set(ui->menu_button, custom ? "elaro/window-control" : "default");
-        elm_object_style_set(ui->settings_button, custom ? "elaro/window-control" : "default");
-        elm_object_style_set(ui->reconnect, custom ? "elaro/window-control" : "default");
-        elm_box_unpack(ui->content, ui->header_shadow);
-        elm_box_unpack(ui->content, ui->input_shadow);
-        evas_object_hide(ui->header_shadow);
-        evas_object_hide(ui->input_shadow);
-        if (custom)
-          {
-             elm_box_unpack(ui->toolbar, ui->window_controls);
-             elm_box_pack_end(ui->toolbar, ui->window_controls);
-             evas_object_show(ui->window_controls);
-             elm_box_pack_after(ui->content, ui->header_shadow, ui->toolbar);
-             elm_box_pack_before(ui->content, ui->input_shadow, ui->input);
-             evas_object_show(ui->header_shadow);
-             evas_object_show(ui->input_shadow);
-          }
-        else
-          {
-             elm_box_unpack(ui->toolbar, ui->window_controls);
-             evas_object_hide(ui->window_controls);
-          }
-     }
-   if (custom)
-     {
-        if (!ui->frame)
-          {
-             elm_win_resize_object_del(ui->win, ui->content);
-             ui->frame = elm_layout_add(ui->win);
-             elaro_ui_expand(ui->frame);
-             elm_win_resize_object_add(ui->win, ui->frame);
-             elaro_ui_window_custom_set(ui->win);
-          }
-        else elm_object_part_content_unset(ui->frame, "elaro.content");
-
-        elm_layout_file_set(ui->frame, ui->theme_path, "elaro/frame");
-        elm_object_part_content_set(ui->frame, "elaro.content", ui->content);
-        elaro_ui_opacity_apply(ui);
-        evas_object_show(ui->frame);
-        if (!ui->resize_grips[0]) elaro_ui_window_shadow_bind(ui->win, ui->frame);
-        else elaro_ui_window_shadow_sync(ui->win, ui->frame);
-        _frame_bind(ui);
-     }
-   else
-     {
-        if (ui->frame)
-          {
-             elm_object_part_content_unset(ui->frame, "elaro.content");
-             elm_win_resize_object_del(ui->win, ui->frame);
-             evas_object_del(ui->frame);
-             ui->frame = NULL;
-             elm_win_resize_object_add(ui->win, ui->content);
-          }
-        elaro_ui_window_native_set(ui->win);
-     }
-   evas_object_show(ui->content);
-}
-
-static void
-_window_minimize(void *data, Evas_Object *obj, void *info)
-{
-   elm_win_iconified_set(((Elaro_Ui *)data)->win, EINA_TRUE);
-}
-static void
-_window_maximize(void *data, Evas_Object *obj, void *info)
-{
-   Evas_Object *win = ((Elaro_Ui *)data)->win;
-   elm_win_maximized_set(win, !elm_win_maximized_get(win));
-}
-
-static void
-_menu_close(void *data, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   Evas_Object *menu = ui->app_menu;
-   ui->app_menu = NULL;
-   ui->theme_status = NULL;
-   memset(ui->theme_buttons, 0, sizeof(ui->theme_buttons));
-   /* Menus are transient. Reusing a hiding notify can let its delayed
-    * dismissal hide the next opening or keep its input blocker alive. */
-   if (menu)
-     {
-        evas_object_smart_callback_del_full(menu, "block,clicked", _menu_close, ui);
-        elaro_ui_popup_close(menu);
-     }
-}
-static void
-_menu_settings(void *data, Evas_Object *obj, void *info)
-{
-   _menu_close(data, obj, info);
-   elaro_ui_connection_show(data, obj, info);
-}
-static void
-_menu_about(void *data, Evas_Object *obj, void *info)
-{
-   _menu_close(data, obj, info);
-   elaro_ui_about_show(data, obj, info);
-}
-static Evas_Object *
-_menu_button(Elaro_Ui *ui, Evas_Object *parent, const char *asset,
-             const char *text, Evas_Smart_Cb callback)
-{
-   Evas_Object *button = elaro_ui_button_add(parent, NULL, callback, ui);
-   Evas_Object *row = elm_box_add(button);
-   Evas_Object *icon = elm_icon_add(row);
-   Evas_Object *label = elm_label_add(row);
-   elm_box_horizontal_set(row, EINA_TRUE);
-   elaro_ui_box_padding_set(row, 9, 0);
-   elaro_ui_icon_set(ui, icon, asset);
-   elaro_ui_size_min_set(icon, 15, 15);
-   elaro_ui_size_max_set(icon, 15, 15);
-   elm_object_text_set(label, text);
-   evas_object_data_set(button, "menu-label", label);
-   evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0);
-   evas_object_size_hint_align_set(label, 0, 0.5);
-   elm_box_pack_end(row, icon);
-   elm_box_pack_end(row, label);
-   evas_object_show(icon);
-   evas_object_show(label);
-   evas_object_show(row);
-   evas_object_pass_events_set(row, EINA_TRUE);
-   elm_object_content_set(button, row);
-   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
-   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
-   elaro_ui_size_min_set(button, 240, 32);
-   return button;
-}
-
-static void
-_menu_show(void *data, Evas_Object *obj, void *info)
-{
-   Elaro_Ui *ui = data;
-   Evas_Object *box, *heading, *button, *spacer;
-   int i;
-   if (ui->app_menu) { evas_object_show(ui->app_menu); return; }
-   ui->app_menu = elm_popup_add(ui->win);
-   elm_object_part_text_set(ui->app_menu, "title,text", _("Elaro"));
-   evas_object_smart_callback_add(ui->app_menu, "block,clicked", _menu_close, ui);
-   box = elm_box_add(ui->app_menu);
-   elaro_ui_box_padding_set(box, 0, 3);
-   heading = elm_label_add(box);
-   elm_object_text_set(heading, _("<b>APPEARANCE</b>"));
-   evas_object_size_hint_align_set(heading, 0, 0.5);
-   elm_box_pack_end(box, heading);
-   evas_object_show(heading);
-   for (int row = 0; row < ELARO_THEME_COUNT; row++)
-     {
-        i = (row + ELARO_THEME_DEFAULT) % ELARO_THEME_COUNT;
-        button = ui->theme_buttons[i] = _menu_button(ui, box, "theme", _(theme_labels[i]), _theme_selected);
-        evas_object_data_set(button, "theme-index", (void *)(intptr_t)i);
-        elm_box_pack_end(box, button);
-     }
-   _theme_menu_selection_update(ui);
-   Evas_Object *separator = elm_separator_add(box);
-   elm_separator_horizontal_set(separator, EINA_TRUE);
-   evas_object_size_hint_weight_set(separator, EVAS_HINT_EXPAND, 0);
-   evas_object_size_hint_align_set(separator, EVAS_HINT_FILL, 0.5);
-   elaro_ui_fixed_height_set(separator, 1);
-   elaro_ui_padding_set(separator, 0, 0, 6, 6);
-   evas_object_data_set(ui->app_menu, "separator", separator);
-   elm_box_pack_end(box, separator);
-   evas_object_show(separator);
-   ui->theme_status = elm_label_add(box);
-   evas_object_data_set(ui->theme_status, "box", box);
-   evas_object_data_set(ui->theme_status, "separator", separator);
-   button = _menu_button(ui, box, "settings", _("Settings"), _menu_settings);
-   elm_box_pack_end(box, button);
-   evas_object_data_set(ui->app_menu, "settings", button);
-   spacer = elm_separator_add(box);
-   elm_separator_horizontal_set(spacer, EINA_TRUE);
-   evas_object_size_hint_weight_set(spacer, EVAS_HINT_EXPAND, 0);
-   evas_object_size_hint_align_set(spacer, EVAS_HINT_FILL, 0.5);
-   elaro_ui_fixed_height_set(spacer, 1);
-   elaro_ui_padding_set(spacer, 0, 0, 6, 6);
-   elm_box_pack_end(box, spacer);
-   evas_object_show(spacer);
-   button = _menu_button(ui, box, "application", _("About Elaro"), _menu_about);
-   elm_box_pack_end(box, button);
-   evas_object_data_set(ui->app_menu, "about", button);
-   elm_object_content_set(ui->app_menu, box);
-   evas_object_show(box);
-   elaro_ui_popup_close_button_add(ui, ui->app_menu, _menu_close, ui);
-   elaro_ui_popup_show(ui->app_menu);
-}
 #endif
diff --git a/src/fe-efl/ui/meson.build b/src/fe-efl/ui/meson.build
index 71661ca..3f1dc7e 100644
--- a/src/fe-efl/ui/meson.build
+++ b/src/fe-efl/ui/meson.build
@@ -14,6 +14,7 @@ ui_sources = files(
   'elaro_ui_music.c',
   'elaro_ui_notify.c',
   'elaro_ui_text.c',
+  'elaro_ui_theme.c',
   'elaro_ui_users.c',
   'elaro_ui_util.c',
 )
diff --git a/tests/fe-efl/meson.build b/tests/fe-efl/meson.build
index 6dd5486..e19dc1f 100644
--- a/tests/fe-efl/meson.build
+++ b/tests/fe-efl/meson.build
@@ -248,6 +248,7 @@ test('Partial notification cleanup without safety checks', python,
   env : ['ELM_ENGINE=buffer', 'ECORE_NO_SYSTEM_MODULES=1', 'EINA_LOG_LEVEL=0'])
 
 themes_test = executable('test-themes', 'test-themes.c',
+  '../../src/fe-efl/ui/elaro_ui_theme.c',
   '../../src/fe-efl/ui/elaro_ui_util.c', '../../src/fe-efl/ui/elaro_ui_about.c',
   '../../src/fe-efl/ui/elaro_ui_connection.c', '../../src/fe-efl/ui/elaro_ui_options.c',
   '../../src/engine/elaro_command.c',
@@ -258,8 +259,8 @@ themes_test = executable('test-themes', 'test-themes.c',
   link_depends : elaro_assets,
   dependencies : [elementary_dep, ecore_file_dep])
 test('Application themes and live switching', python,
-  args : [files('isolated.py'), themes_test], timeout : 60,
-  env : ['ELARO_TEST_TIMEOUT=55', 'ELM_ENGINE=buffer', 'ECORE_NO_SYSTEM_MODULES=1', 'EINA_LOG_LEVEL=0'])
+  args : [files('isolated.py'), themes_test], timeout : 90,
+  env : ['ELARO_TEST_TIMEOUT=85', 'ELM_ENGINE=buffer', 'ECORE_NO_SYSTEM_MODULES=1', 'EINA_LOG_LEVEL=0'])
 
 test('Elementary default theme and native window decorations', python,
   args : [files('isolated.py'), themes_test, '--default'], timeout : 15,
diff --git a/tests/fe-efl/test-themes.c b/tests/fe-efl/test-themes.c
index 09ddb4c..c702105 100644
--- a/tests/fe-efl/test-themes.c
+++ b/tests/fe-efl/test-themes.c
@@ -1,4 +1,5 @@
 #include "src/fe-efl/ui/elaro_ui_private.h"
+#include "src/fe-efl/ui/elaro_ui_theme.h"
 #include <Ecore_Evas.h>
 #include <assert.h>
 #include <stdint.h>
@@ -25,7 +26,9 @@ void elaro_engine_submit(Elaro_Engine *engine, Elaro_Engine_Command *command)
  * by test-ui-state. */
 void elaro_ui_buffers_recreate(Elaro_Ui *ui) {}
 void elaro_ui_external_link_open(Elaro_Ui *ui, const char *url) {}
-#include "src/fe-efl/ui/elaro_ui_theme.h"
+static const char *const theme_names[] = {
+   "midnight", "porcelain", "verdigris", "ember"
+};
 
 static Ecore_Evas *test_canvas;
 
@@ -679,7 +682,7 @@ _default_theme_check(Elaro_Ui *ui)
    ui->content = elm_box_add(ui->win);
    elaro_ui_expand(ui->content);
    elm_win_resize_object_add(ui->win, ui->content);
-   _theme_apply(ui);
+   elaro_ui_theme_apply(ui);
    assert(!ui->theme_path && !ui->frame);
    assert(!elm_win_borderless_get(ui->win));
    Evas_Object *background = "" "elaro-native-background");
@@ -688,6 +691,8 @@ _default_theme_check(Elaro_Ui *ui)
    Evas_Object *entry = elaro_ui_entry_add(ui->content, EINA_FALSE);
    elm_box_pack_end(ui->content, entry);
    elm_entry_entry_set(entry, "Unsent draft");
+   Evas_Object *menu_button = elaro_ui_button_add(ui->content, "Menu", elaro_ui_theme_menu_show, ui);
+   elm_box_pack_end(ui->content, menu_button);
    Evas_Object *dialog = elm_win_add(ui->win, "dialog", ELM_WIN_DIALOG_BASIC);
    Evas_Object *body = elaro_ui_window_content_add(dialog);
    Evas_Object *label = elm_label_add(body);
@@ -700,7 +705,7 @@ _default_theme_check(Elaro_Ui *ui)
    evas_object_resize(ui->win, 900, 760);
    evas_object_show(ui->win);
    evas_object_show(dialog);
-   _menu_show(ui, NULL, NULL);
+   elaro_ui_theme_menu_show(ui, NULL, NULL);
    _settle();
    int window_width, window_height, background_width, background_height;
    evas_object_geometry_get(ui->win, NULL, NULL, &window_width, &window_height);
@@ -711,7 +716,13 @@ _default_theme_check(Elaro_Ui *ui)
    assert(elm_win_borderless_get(ui->win) && elm_win_borderless_get(dialog));
    assert(!evas_object_data_get(ui->win, "elaro-native-background"));
    assert(evas_object_data_get(dialog, "elaro-window-frame"));
+   assert(!ui->app_menu);
+   _click(menu_button);
+   assert(ui->app_menu);
    _click(ui->theme_buttons[ELARO_THEME_DEFAULT]);
+   assert(!ui->app_menu);
+   _click(menu_button);
+   assert(ui->app_menu);
    assert(!ui->theme_path && !ui->frame);
    assert(!elm_win_borderless_get(ui->win) && !elm_win_borderless_get(dialog));
    assert(evas_object_data_get(ui->win, "elaro-native-background"));
@@ -724,7 +735,7 @@ _default_theme_check(Elaro_Ui *ui)
    Elaro_Config *saved = elaro_config_load(&error);
    assert(saved && !error && saved->theme == ELARO_THEME_DEFAULT);
    elaro_config_free(saved);
-   _menu_close(ui, NULL, NULL);
+   _close_and_wait(ui->app_menu, evas_object_data_get(ui->app_menu, "close"));
    evas_object_del(dialog);
 }
 
@@ -739,10 +750,6 @@ int main(int argc, char **argv)
    Elm_Object_Item *items[3];
    const char *file, *group;
    const char *artifacts = argc > 1 ? argv[1] : NULL;
-   (void)_frame_move;
-   (void)_frame_resize;
-   (void)_window_minimize;
-   (void)_window_maximize;
    assert(elm_init(argc, argv));
    ui.config = elaro_config_load(&error);
    assert(ui.config && !error);
@@ -753,21 +760,17 @@ int main(int argc, char **argv)
      {
         _default_theme_check(&ui);
         evas_object_del(ui.win);
-        _theme_shutdown(&ui);
+        elaro_ui_theme_shutdown(&ui);
         elaro_config_free(ui.config);
         elm_shutdown();
         return 0;
      }
    ui.config->theme = 0;
-   _theme_apply(&ui);
-   ui.frame = elm_layout_add(ui.win);
-   assert(elm_layout_file_set(ui.frame, ui.theme_path, "elaro/frame"));
-   elaro_ui_expand(ui.frame);
-   elm_win_resize_object_add(ui.win, ui.frame);
+   elaro_ui_theme_apply(&ui);
    ui.content = elm_box_add(ui.win);
    elaro_ui_expand(ui.content);
-   elm_object_part_content_set(ui.frame, "elaro.content", ui.content);
-   _frame_bind(&ui);
+   elm_win_resize_object_add(ui.win, ui.content);
+   elaro_ui_theme_frame_apply(&ui);
    /* Reserve the header hit area, as the real window's toolbar does. */
    Evas_Object *header = evas_object_rectangle_add(evas_object_evas_get(ui.win));
    evas_object_color_set(header, 0, 0, 0, 0);
@@ -793,7 +796,7 @@ int main(int argc, char **argv)
    elm_check_state_set(check, EINA_TRUE);
    elm_box_pack_end(ui.content, check);
    evas_object_show(check);
-   button = elaro_ui_icon_button_add(ui.content, "menu", "Menu", _menu_show, &ui);
+   button = elaro_ui_icon_button_add(ui.content, "menu", "Menu", elaro_ui_theme_menu_show, &ui);
    elm_box_pack_end(ui.content, button);
    icon = elm_object_part_content_get(button, "icon");
    assert(icon);
@@ -883,9 +886,11 @@ int main(int argc, char **argv)
         assert(icon_min.w == ELM_SCALE_SIZE(17) && icon_min.h == ELM_SCALE_SIZE(17));
         elm_box_padding_get(ui.content, &bx, &by);
         assert(bx == ELM_SCALE_SIZE(3) && by == ELM_SCALE_SIZE(5));
-        int x, y, w, h;
-        edje_object_part_geometry_get(elm_layout_edje_get(ui.frame), "elaro.content", &x, &y, &w, &h);
-        assert(abs(x - ELM_SCALE_SIZE(5)) <= 1);
+        int x, edge_x, w, h;
+        Evas_Object *frame_edje = elm_layout_edje_get(ui.frame);
+        assert(edje_object_part_geometry_get(frame_edje, "edge", &edge_x, NULL, NULL, NULL));
+        assert(edje_object_part_geometry_get(frame_edje, "elaro.content", &x, NULL, NULL, NULL));
+        assert(abs(x - edge_x - ELM_SCALE_SIZE(5)) <= 1);
         evas_object_geometry_get(ui.resize_grips[7], NULL, NULL, &w, &h);
         assert(w == ELM_SCALE_SIZE(5) && h == ELM_SCALE_SIZE(5));
         Eina_Size2D header_min = efl_gfx_hint_size_combined_min_get(header);
@@ -910,6 +915,9 @@ int main(int argc, char **argv)
         Elaro_Config *saved;
         _click(ui.theme_buttons[i]);
         assert(ui.config->theme == i);
+        assert(!ui.app_menu);
+        _click(button);
+        assert(ui.app_menu && evas_object_visible_get(ui.app_menu));
         assert(!evas_object_visible_get(ui.theme_status));
         Evas_Object *separator = evas_object_data_get(ui.app_menu, "separator");
         edje_object_file_get(elm_layout_edje_get(separator), &file, &group);
@@ -1148,7 +1156,7 @@ int main(int argc, char **argv)
    eina_strbuf_free(conversation.history);
    evas_object_del(ui.win);
    assert(!ui.theme_icons);
-   _theme_shutdown(&ui);
+   elaro_ui_theme_shutdown(&ui);
    elaro_config_free(ui.config);
    elm_shutdown();
    return 0;

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

Reply via email to