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 efe4f0a5784a880dcf0cace4ca41331d48c861e1
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Fri Jul 25 19:55:30 2025 +0100

    add concept of icon stykles at least for icon mode
    
    should this also work for list mode (and detailed list mode) ?
---
 src/efm/efm.c         | 19 +++++++++++++++++++
 src/efm/efm.h         |  4 +++-
 src/efm/efm_structs.h |  3 ++-
 src/efm/efm_util.c    | 17 ++++++++++-------
 src/efm/main.c        |  6 ++++++
 5 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/src/efm/efm.c b/src/efm/efm.c
index c8fc1b3..0ecd10b 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -779,6 +779,7 @@ _smart_add(Evas_Object *obj)
   sd->config.detail_min_w[4]   = 60;
   sd->config.detail_min_w[5]   = 120;
   sd->config.backend           = eina_stringshare_add("default");
+  sd->config.icon_style        = eina_stringshare_add("default");
   sd->config.detail_heading[0] = eina_stringshare_add("Name");
   sd->config.detail_heading[1] = eina_stringshare_add("Size");
   sd->config.detail_heading[2] = eina_stringshare_add("Date");
@@ -910,6 +911,7 @@ _smart_del(Evas_Object *obj)
     }
   eina_stringshare_replace(&(sd->config.path), NULL);
   eina_stringshare_replace(&(sd->config.backend), NULL);
+  eina_stringshare_replace(&(sd->config.icon_style), NULL);
   for (i = 0; i < 7; i++)
     eina_stringshare_replace(&(sd->config.detail_heading[i]), NULL);
   if (sd->exe_open)
@@ -1838,6 +1840,23 @@ efm_path_parent(Evas_Object *obj)
 }
 
 ////////
+void
+efm_icon_style_set(Evas_Object *obj, const char *style)
+{
+  ENTRY;
+
+  eina_stringshare_replace(&(sd->config.icon_style), style);
+  _reset(sd);
+}
+
+const char *
+efm_icon_style_get(Evas_Object *obj)
+{
+  ENTRY NULL;
+
+  return sd->config.icon_style;
+}
+
 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 fc884bd..ee3a1a1 100644
--- a/src/efm/efm.h
+++ b/src/efm/efm.h
@@ -78,6 +78,8 @@ Evas_Object  *efm_add(Evas_Object *parent);
 void          efm_scroller_set(Evas_Object *obj, Evas_Object *scroller);
 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_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);
@@ -93,7 +95,7 @@ void          efm_backend_set(Evas_Object *obj, const char *backend);
 void          efm_menu_provider_set(Evas_Object *obj, Efm_Menu_Provider cb, void *data);
 void          efm_menu_provider_select(Evas_Object *obj, int index);
 
-// alweays call path_Set last after setup above like setting icon size etc.
+// always call path_set last after setup above like setting icon size etc.
 void          efm_path_set(Evas_Object *obj, const char *path);
 const char   *efm_path_get(Evas_Object *obj);
 void          efm_path_parent(Evas_Object *obj);
diff --git a/src/efm/efm_structs.h b/src/efm/efm_structs.h
index d159756..7fbf6a4 100644
--- a/src/efm/efm_structs.h
+++ b/src/efm/efm_structs.h
@@ -132,9 +132,10 @@ struct _Smart_Data
     Efm_View_Mode     view_mode;
     Efm_Sort_Mode     sort_mode;
     Evas_Coord        icon_size;
+    Evas_Coord        detail_min_w[6];
     Eina_Stringshare *path;
     Eina_Stringshare *backend;
-    Evas_Coord        detail_min_w[6];
+    Eina_Stringshare *icon_style;
     Eina_Stringshare *detail_heading[7];
     Eina_Bool         all_files;
   } config;
diff --git a/src/efm/efm_util.c b/src/efm/efm_util.c
index 876b43a..1d1af48 100644
--- a/src/efm/efm_util.c
+++ b/src/efm/efm_util.c
@@ -2099,7 +2099,7 @@ _icon_object_add(Icon *icon, Smart_Data *sd, Evas *e,
   Evas_Object *o, *o2;
   const char  *icon_file = NULL, *icon_group = NULL, *icon_thumb = NULL;
   const char  *ic;
-  char         buf[PATH_MAX], buf2[128];
+  char         buf[PATH_MAX], buf2[128], grpbuf[128];
   int          i;
 
   if (icon->o_base) return;
@@ -2149,12 +2149,15 @@ _icon_object_add(Icon *icon, Smart_Data *sd, Evas *e,
   // about to realize if it hasn't been
   // XXX: have a cache for base and icon objects to avoid re-creating them
   icon->o_base = o = edje_object_add(e);
-  if ((sd->config.view_mode == EFM_VIEW_MODE_ICONS) ||
-      (sd->config.view_mode == EFM_VIEW_MODE_ICONS_VERTICAL))
-    edje_object_file_set(o, theme_edj_file, "e/fileman/default/icon/fixed");
-  else if ((sd->config.view_mode == EFM_VIEW_MODE_ICONS_CUSTOM) ||
-           (sd->config.view_mode == EFM_VIEW_MODE_ICONS_CUSTOM_VERTICAL))
-    edje_object_file_set(o, theme_edj_file, "e/fileman/desktop/icon/fixed");
+  if ((sd->config.view_mode == EFM_VIEW_MODE_ICONS)
+      || (sd->config.view_mode == EFM_VIEW_MODE_ICONS_VERTICAL)
+      || (sd->config.view_mode == EFM_VIEW_MODE_ICONS_CUSTOM)
+      || (sd->config.view_mode == EFM_VIEW_MODE_ICONS_CUSTOM_VERTICAL))
+    {
+      snprintf(grpbuf, sizeof(grpbuf), "e/fileman/%s/icon/fixed",
+               sd->config.icon_style);
+      edje_object_file_set(o, theme_edj_file, grpbuf);
+    }
   else if (sd->config.view_mode == EFM_VIEW_MODE_LIST)
     { // odd/even coloring with different group
       if (num & 0x1)
diff --git a/src/efm/main.c b/src/efm/main.c
index 0a8f121..739996c 100644
--- a/src/efm/main.c
+++ b/src/efm/main.c
@@ -19,6 +19,7 @@ static void
 _cb_icons(void *data, Evas_Object *obj EINA_UNUSED,
           void *event_info EINA_UNUSED)
 {
+  efm_icon_style_set(data, "default");
   efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS);
 }
 
@@ -26,6 +27,7 @@ static void
 _cb_icons_v(void *data, Evas_Object *obj EINA_UNUSED,
             void *event_info EINA_UNUSED)
 {
+  efm_icon_style_set(data, "default");
   efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS_VERTICAL);
 }
 
@@ -33,6 +35,7 @@ static void
 _cb_icons_custom(void *data, Evas_Object *obj EINA_UNUSED,
                  void *event_info EINA_UNUSED)
 {
+  efm_icon_style_set(data, "desktop");
   efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS_CUSTOM);
 }
 
@@ -40,12 +43,14 @@ static void
 _cb_icons_custom_v(void *data, Evas_Object *obj EINA_UNUSED,
                    void *event_info EINA_UNUSED)
 {
+  efm_icon_style_set(data, "desktop");
   efm_path_view_mode_set(data, EFM_VIEW_MODE_ICONS_CUSTOM_VERTICAL);
 }
 
 static void
 _cb_list(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
+  efm_icon_style_set(data, "default");
   efm_path_view_mode_set(data, EFM_VIEW_MODE_LIST);
 }
 
@@ -53,6 +58,7 @@ static void
 _cb_list_detailed(void *data, Evas_Object *obj EINA_UNUSED,
                   void *event_info EINA_UNUSED)
 {
+  efm_icon_style_set(data, "default");
   efm_path_view_mode_set(data, EFM_VIEW_MODE_LIST_DETAILED);
 }
 

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

Reply via email to