This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efm2.
View the commit online.
commit 7d7a9f00ea7b7662d9bd801f055b2c73a3a75a67
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Sat Jul 26 22:39:32 2025 +0100
new icon styles (in theme) and apis etc.
---
TODO.md | 6 ++---
src/efm/efm.c | 21 +++++++++++++++
src/efm/efm.h | 2 ++
src/efm/efm_structs.h | 1 +
src/efm/efm_util.c | 8 ++++--
src/efm/main.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 106 insertions(+), 6 deletions(-)
diff --git a/TODO.md b/TODO.md
index 3635027..9d59f18 100644
--- a/TODO.md
+++ b/TODO.md
@@ -5,10 +5,8 @@
## Now
* View
- * Free x/y cleanup/grid align
- * Icon with no labels
- * Icons with flush view (like rage video browser view but aspect fit)
- * Icons with flush full fill view (like rage video browser view)
+ * Custom view x/y cleanup/grid align of files with xy props
+ * Custon view x/y resize all files
* .efm/.efm in dir set more than backend type (view mode and more)
* Custom style per icon
* Resize mode/menu option for icons in custom view
diff --git a/src/efm/efm.c b/src/efm/efm.c
index 0ecd10b..5a7756a 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -1845,6 +1845,9 @@ efm_icon_style_set(Evas_Object *obj, const char *style)
{
ENTRY;
+ if (!style) style = "default";
+ if ((sd->config.icon_style) && (!strcmp(style, sd->config.icon_style)))
+ return;
eina_stringshare_replace(&(sd->config.icon_style), style);
_reset(sd);
}
@@ -1857,6 +1860,24 @@ efm_icon_style_get(Evas_Object *obj)
return sd->config.icon_style;
}
+void
+efm_icon_fill_set(Evas_Object *obj, Eina_Bool fill)
+{
+ ENTRY;
+
+ if (sd->config.icon_fill == fill) return;
+ sd->config.icon_fill = !!fill;
+ _reset(sd);
+}
+
+Eina_Bool
+efm_icon_fill_get(Evas_Object *obj)
+{
+ ENTRY EINA_FALSE;
+
+ return sd->config.icon_fill;
+}
+
void
efm_path_view_mode_set(Evas_Object *obj, Efm_View_Mode mode)
{
diff --git a/src/efm/efm.h b/src/efm/efm.h
index ee3a1a1..46ada84 100644
--- a/src/efm/efm.h
+++ b/src/efm/efm.h
@@ -80,6 +80,8 @@ Evas_Object *efm_scroller_get(Evas_Object *obj);
Evas_Object *efm_detail_header_get(Evas_Object *obj);
void efm_icon_style_set(Evas_Object *obj, const char *style);
const char *efm_icon_style_get(Evas_Object *obj);
+void efm_icon_fill_set(Evas_Object *obj, Eina_Bool fill);
+Eina_Bool efm_icon_fill_get(Evas_Object *obj);
void efm_path_view_mode_set(Evas_Object *obj, Efm_View_Mode mode);
Efm_View_Mode efm_path_view_mode_get(Evas_Object *obj);
void efm_path_sort_mode_set(Evas_Object *obj, Efm_Sort_Mode mode);
diff --git a/src/efm/efm_structs.h b/src/efm/efm_structs.h
index 7fbf6a4..e5f1b8c 100644
--- a/src/efm/efm_structs.h
+++ b/src/efm/efm_structs.h
@@ -138,6 +138,7 @@ struct _Smart_Data
Eina_Stringshare *icon_style;
Eina_Stringshare *detail_heading[7];
Eina_Bool all_files;
+ Eina_Bool icon_fill;
} config;
};
diff --git a/src/efm/efm_util.c b/src/efm/efm_util.c
index 1d1af48..fa81639 100644
--- a/src/efm/efm_util.c
+++ b/src/efm/efm_util.c
@@ -1331,8 +1331,12 @@ _icon_resized(Icon *icon)
// get the icon size and if it has alpha
efm_icon_size_get(icon->o_icon, &w, &h);
// set the aspect ratio hint based on the above and re-swallow
- evas_object_size_hint_aspect_set(icon->o_icon, EVAS_ASPECT_CONTROL_BOTH, w,
- h);
+ // EVAS_ASPECT_CONTROL_NONE -- fill
+ evas_object_size_hint_aspect_set(icon->o_icon,
+ icon->sd->config.icon_fill
+ ? EVAS_ASPECT_CONTROL_NONE
+ : EVAS_ASPECT_CONTROL_BOTH,
+ w, h);
if ((efm_icon_mono_get(icon->o_icon))
&& (edje_object_part_exists(icon->o_base, "e.swallow.icon_mono")))
edje_object_part_swallow(icon->o_base, "e.swallow.icon_mono", icon->o_icon);
diff --git a/src/efm/main.c b/src/efm/main.c
index 739996c..37c3e68 100644
--- a/src/efm/main.c
+++ b/src/efm/main.c
@@ -19,14 +19,52 @@ static void
_cb_icons(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
+ efm_icon_fill_set(data, EINA_FALSE);
efm_icon_style_set(data, "default");
efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS);
}
+static void
+_cb_icons_full(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efm_icon_fill_set(data, EINA_FALSE);
+ efm_icon_style_set(data, "full");
+ efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS);
+}
+
+static void
+_cb_icons_full_nolabel(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efm_icon_fill_set(data, EINA_FALSE);
+ efm_icon_style_set(data, "full-nolabel");
+ efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS);
+}
+
+static void
+_cb_icons_full_fill(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efm_icon_fill_set(data, EINA_TRUE);
+ efm_icon_style_set(data, "full");
+ efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS);
+}
+
+static void
+_cb_icons_full_nolabel_fill(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efm_icon_fill_set(data, EINA_TRUE);
+ efm_icon_style_set(data, "full-nolabel");
+ efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS);
+}
+
static void
_cb_icons_v(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
+ efm_icon_fill_set(data, EINA_FALSE);
efm_icon_style_set(data, "default");
efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS_VERTICAL);
}
@@ -35,6 +73,7 @@ static void
_cb_icons_custom(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
+ efm_icon_fill_set(data, EINA_FALSE);
efm_icon_style_set(data, "desktop");
efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS_CUSTOM);
}
@@ -43,6 +82,7 @@ static void
_cb_icons_custom_v(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
+ efm_icon_fill_set(data, EINA_FALSE);
efm_icon_style_set(data, "desktop");
efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS_CUSTOM_VERTICAL);
}
@@ -50,6 +90,7 @@ _cb_icons_custom_v(void *data, Evas_Object *obj EINA_UNUSED,
static void
_cb_list(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
+ efm_icon_fill_set(data, EINA_FALSE);
efm_icon_style_set(data, "default");
efm_path_view_mode_set(data, EFM_VIEW_MODE_LIST);
}
@@ -58,6 +99,7 @@ static void
_cb_list_detailed(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
+ efm_icon_fill_set(data, EINA_FALSE);
efm_icon_style_set(data, "default");
efm_path_view_mode_set(data, EFM_VIEW_MODE_LIST_DETAILED);
}
@@ -204,6 +246,38 @@ elm_main(int argc, char **argv)
elm_box_pack_end(bx2, o);
evas_object_show(o);
+ o = elm_button_add(win);
+ evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, 0);
+ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
+ elm_object_text_set(o, "Full");
+ evas_object_smart_callback_add(o, "clicked", _cb_icons_full, efm);
+ elm_box_pack_end(bx2, o);
+ evas_object_show(o);
+
+ o = elm_button_add(win);
+ evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, 0);
+ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
+ elm_object_text_set(o, "Nolabel");
+ evas_object_smart_callback_add(o, "clicked", _cb_icons_full_nolabel, efm);
+ elm_box_pack_end(bx2, o);
+ evas_object_show(o);
+
+ o = elm_button_add(win);
+ evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, 0);
+ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
+ elm_object_text_set(o, "Full Fill");
+ evas_object_smart_callback_add(o, "clicked", _cb_icons_full_fill, efm);
+ elm_box_pack_end(bx2, o);
+ evas_object_show(o);
+
+ o = elm_button_add(win);
+ evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, 0);
+ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
+ elm_object_text_set(o, "Nolabel Fill");
+ evas_object_smart_callback_add(o, "clicked", _cb_icons_full_nolabel_fill, efm);
+ elm_box_pack_end(bx2, o);
+ evas_object_show(o);
+
o = elm_button_add(win);
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, 0);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.