allow custom scrollframes for fwins.
authorCarsten Haitzler <raster@rasterman.com>
Mon, 16 Apr 2007 15:23:11 +0000 (15:23 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 16 Apr 2007 15:23:11 +0000 (15:23 +0000)
SVN revision: 29554

src/bin/e_fwin.c
src/bin/e_scrollframe.c
src/bin/e_scrollframe.h

index 622ac0b..8a54bf5 100644 (file)
@@ -149,7 +149,9 @@ e_fwin_new(E_Container *con, const char *dev, const char *path)
     * a way to set an edje file directly
     */
    /* FIXME: allow specialised scrollframe obj per dir - get from e config,
-    * then look in the dir itself for a magic dot-file, if not - use theme
+    * then look in the dir itself for a magic dot-file, if not - use theme.
+    * same as currently done for bg & overlay. also add to fm2 the ability
+    * to specify the .edj files to get the list and icon theme stuff from
     */
    e_scrollframe_custom_theme_set(o, "base/theme/fileman",
                                  "e/fileman/scrollframe/default");
@@ -266,7 +268,18 @@ _e_fwin_changed(void *data, Evas_Object *obj, void *event_info)
        evas_object_show(fwin->over_obj);
      }
    if (fwin->scrollframe_obj)
-     e_scrollframe_child_pos_set(fwin->scrollframe_obj, 0, 0);
+     {
+       snprintf(buf, sizeof(buf), "%s/.directory-scrollframe.edj",
+                e_fm2_real_path_get(fwin->fm_obj));
+       if (e_util_edje_collection_exists(buf, "e/fileman/scrollframe/default"))
+         e_scrollframe_custom_edje_file_set(fwin->scrollframe_obj, buf,
+                                            "e/fileman/scrollframe/default");
+       else
+         e_scrollframe_custom_theme_set(fwin->scrollframe_obj,
+                                        "base/theme/fileman",
+                                        "e/fileman/scrollframe/default");
+       e_scrollframe_child_pos_set(fwin->scrollframe_obj, 0, 0);
+     }
 }
 
 static void
index e0e011f..c840662 100644 (file)
@@ -166,6 +166,25 @@ e_scrollframe_custom_theme_set(Evas_Object *obj, char *custom_category, char *cu
    API_ENTRY return;
    
    e_theme_edje_object_set(sd->edje_obj, custom_category, custom_group);
+   if (sd->pan_obj)
+     edje_object_part_swallow(sd->edje_obj, "e.swallow.content", sd->pan_obj);
+   sd->vbar_visible = !sd->vbar_visible;
+   sd->hbar_visible = !sd->hbar_visible;
+   _e_smart_scrollbar_bar_visibility_adjust(sd);
+}
+
+EAPI void
+e_scrollframe_custom_edje_file_set(Evas_Object *obj, char *file, char *group)
+{
+   Evas_Coord w, h;
+   API_ENTRY return;
+
+   edje_object_file_set(sd->edje_obj, file, group);
+   if (sd->pan_obj)
+     edje_object_part_swallow(sd->edje_obj, "e.swallow.content", sd->pan_obj);
+   sd->vbar_visible = !sd->vbar_visible;
+   sd->hbar_visible = !sd->hbar_visible;
+   _e_smart_scrollbar_bar_visibility_adjust(sd);
 }
 
 EAPI void
index 0d39c3b..848937e 100644 (file)
@@ -18,6 +18,7 @@ EAPI Evas_Object *e_scrollframe_add             (Evas *evas);
 EAPI void e_scrollframe_child_set               (Evas_Object *obj, Evas_Object *child);
 EAPI void e_scrollframe_extern_pan_set          (Evas_Object *obj, Evas_Object *pan, void (*pan_set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*pan_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y));
 EAPI void e_scrollframe_custom_theme_set        (Evas_Object *obj, char *custom_category, char *custom_group);
+EAPI void e_scrollframe_custom_edje_file_set    (Evas_Object *obj, char *file, char *group);
 EAPI void e_scrollframe_child_pos_set           (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
 EAPI void e_scrollframe_child_pos_get           (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
 EAPI void e_scrollframe_child_region_show       (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);