This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch main
in repository equation.
View the commit online.
commit a8f760321ab1b89ef907434afea66304282ac2d3
Author: Alastair Poole <[email protected]>
AuthorDate: Fri Nov 27 14:27:33 2026 +0000
unify themes
---
NEWS | 6 ++-
VERSION | 2 +-
data/themes/common/groups/equation_choices.edc | 1 +
meson.build | 2 +-
src/fe-efl/equation_ui.c | 55 ++++++++++++++------------
tests/equation_ui_test.c | 4 +-
6 files changed, 39 insertions(+), 31 deletions(-)
diff --git a/NEWS b/NEWS
index 8625306..fa287e3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
-Unreleased
-==========
+==============
+Equation 0.1.2
+==============
+ * Unified themes.
* Kept the minimize icon visible while the button is pressed.
* Redesigned the calculator application icon.
diff --git a/VERSION b/VERSION
index 17e51c3..d917d3e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.1
+0.1.2
diff --git a/data/themes/common/groups/equation_choices.edc b/data/themes/common/groups/equation_choices.edc
index 3212b37..9c2f42f 100644
--- a/data/themes/common/groups/equation_choices.edc
+++ b/data/themes/common/groups/equation_choices.edc
@@ -1,5 +1,6 @@
/* Low-profile material switches; all activation remains native Elementary. */
group { name: "elm/check/base/default";
+ alias: "elm/check/base/toggle";
min: 0 36;
parts {
part { name: "clip"; type: RECT; mouse_events: 0;
diff --git a/meson.build b/meson.build
index 43c0778..d9c9ca3 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project(
'equation',
'c',
- version : '0.1.1',
+ version : '0.1.2',
meson_version : '>=0.58',
license : 'GPL-2.0-only',
default_options : ['c_std=gnu11', 'warning_level=2'],
diff --git a/src/fe-efl/equation_ui.c b/src/fe-efl/equation_ui.c
index de3c75e..080305c 100644
--- a/src/fe-efl/equation_ui.c
+++ b/src/fe-efl/equation_ui.c
@@ -119,23 +119,6 @@ equation_about_show(void *data, Evas_Object *object EINA_UNUSED, void *event_inf
evas_object_show(ui->about);
}
-static void
-equation_theme_choices_update(Equation_Ui *ui)
-{
- if (!ui->menu) return;
- Evas_Object *box = elm_object_content_get(ui->menu), *button;
- Eina_List *items = elm_box_children_get(box), *node;
- EINA_LIST_FOREACH(items, node, button)
- {
- const char *name = evas_object_data_get(button, "equation_theme_name");
- if (name)
- elm_object_signal_emit(
- button, !strcmp(name, ui->config.theme) ? "equation,selected,on" : "equation,selected,off",
- "equation");
- }
- eina_list_free(items);
-}
-
static void
equation_preferences_save(Equation_Ui *ui)
{
@@ -277,7 +260,6 @@ equation_theme_apply(Equation_Ui *ui, const char *name)
ui->motion_running = false;
equation_motion_sync(ui);
equation_theme_display_set(ui->display, ui->display_value);
- equation_theme_choices_update(ui);
}
static void
@@ -300,13 +282,13 @@ equation_menu_show(void *data, Evas_Object *object EINA_UNUSED, void *event_info
ui->menu = elm_popup_add(ui->window);
evas_object_smart_callback_add(ui->menu, "block,clicked", equation_menu_close, ui);
Evas_Object *box = elm_box_add(ui->menu);
- elm_box_padding_set(box, 0, 6);
- evas_object_size_hint_min_set(box, 280, 0);
+ elm_box_padding_set(box, 0, ELM_SCALE_SIZE(8));
+ evas_object_size_hint_min_set(box, ELM_SCALE_SIZE(280), 0);
Evas_Object *header = elm_box_add(box);
elm_box_horizontal_set(header, EINA_TRUE);
evas_object_size_hint_weight_set(header, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(header, EVAS_HINT_FILL, 0.5);
- elm_box_pack_end(header, equation_label(ui, header, "<b>Equation</b>"));
+ elm_box_pack_end(header, equation_label(ui, header, _("Settings")));
Evas_Object *close = elm_button_add(header);
elm_object_style_set(close, "equation/window-close");
elm_object_text_set(close, "×");
@@ -319,16 +301,40 @@ equation_menu_show(void *data, Evas_Object *object EINA_UNUSED, void *event_info
evas_object_show(close);
elm_box_pack_end(box, header);
evas_object_show(header);
- elm_box_pack_end(box, equation_label(ui, box, _("<b>Appearance</b>")));
+ elm_box_pack_end(box, equation_label(ui, box, _("Theme")));
+ Evas_Object *themes = elm_table_add(box);
+ Evas_Object *group = NULL;
+ elm_table_homogeneous_set(themes, EINA_TRUE);
+ elm_table_padding_set(themes, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(3));
+ evas_object_size_hint_weight_set(themes, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(themes, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(box, themes);
+ evas_object_show(themes);
for (unsigned i = 0; i < EINA_C_ARRAY_LENGTH(equation_theme_catalog); ++i)
{
- Evas_Object *button = equation_menu_button(box, _(equation_theme_catalog[i].label),
- equation_theme_selected, ui);
+ Evas_Object *button = elm_radio_add(themes);
+ elm_object_text_set(button, _(equation_theme_catalog[i].label));
+ elm_radio_state_value_set(button, i);
+ if (group) elm_radio_group_add(button, group);
+ else group = button;
+ if (!strcmp(equation_theme_catalog[i].name, ui->config.theme))
+ elm_radio_value_set(group, i);
evas_object_data_set(button, "equation_theme_name", equation_theme_catalog[i].name);
evas_object_name_set(button, equation_theme_catalog[i].name);
elm_object_tooltip_text_set(button, _(equation_theme_catalog[i].description));
+ evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
+ evas_object_smart_callback_add(button, "changed", equation_theme_selected, ui);
+ elm_table_pack(themes, button, i % 2, i / 2, 1, 1);
+ evas_object_show(button);
}
+ Evas_Object *separator = elm_separator_add(box);
+ elm_separator_horizontal_set(separator, EINA_TRUE);
+ evas_object_size_hint_align_set(separator, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(box, separator);
+ evas_object_show(separator);
Evas_Object *animations = elm_check_add(box);
+ elm_object_style_set(animations, "toggle");
elm_object_text_set(animations, _("Ambient animations"));
elm_check_state_set(animations, ui->config.animations);
evas_object_name_set(animations, "equation_animations");
@@ -346,7 +352,6 @@ equation_menu_show(void *data, Evas_Object *object EINA_UNUSED, void *event_info
elm_object_content_set(ui->menu, box);
evas_object_show(box);
evas_object_show(ui->menu);
- equation_theme_choices_update(ui);
}
static void
diff --git a/tests/equation_ui_test.c b/tests/equation_ui_test.c
index 1a7f35c..faed91a 100644
--- a/tests/equation_ui_test.c
+++ b/tests/equation_ui_test.c
@@ -194,7 +194,7 @@ main(int argc, char **argv)
evas_object_geometry_get(window, NULL, NULL, &width, &height);
evas_object_size_hint_min_get(window, &min_width, &min_height);
EQUATION_CHECK(min_width > 0 && min_height > 0 && width == min_width && height == min_height);
- const char *themes[] = { "observatory", "atelier", "crazy_lab", "midnight" };
+ const char *themes[] = { "atelier", "observatory", "crazy_lab", "midnight" };
for (size_t i = 0; i < EINA_C_ARRAY_LENGTH(themes); ++i)
{
Evas_Object *menu_button = evas_object_name_find(canvas, "equation_menu");
@@ -202,7 +202,7 @@ main(int argc, char **argv)
equation_click(menu_button);
EQUATION_CHECK(ui->menu);
Evas_Object *choice = evas_object_name_find(canvas, themes[i]);
- EQUATION_CHECK(choice);
+ EQUATION_CHECK(choice && !strcmp(evas_object_type_get(choice), "elm_radio"));
equation_click(choice);
EQUATION_CHECK(!ui->menu && !strcmp(ui->config.theme, themes[i]) && !ui->config_failed);
EQUATION_CHECK(!equation_button_interactions(ui));
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.