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 55b568c1280cf29e0df75472307733f7d8e1fbbf
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Thu Oct 5 10:26:51 2023 +0100
allow column sizes to be set from backend too
---
src/backends/table/open | 12 ++++++------
src/efm/efm.c | 46 +++++++++++++++++++++++++++++++++++++---------
src/efm/efm_back_end.c | 29 +++++++++++++++++++++--------
src/shared/common/cmd.h | 20 ++++++++++----------
4 files changed, 74 insertions(+), 33 deletions(-)
diff --git a/src/backends/table/open b/src/backends/table/open
index 1182a67..f7b4d37 100755
--- a/src/backends/table/open
+++ b/src/backends/table/open
@@ -101,12 +101,12 @@ function handle_cmd_dir_set() {
e_cmd "viewmode-set mode=list_detailed"
# explicitly set column header strings
e_cmd "detail-header-set col=0 label=nomnom"
- e_cmd "detail-header-set col=1 label=h-one"
- e_cmd "detail-header-set col=2 label=h-two"
- e_cmd "detail-header-set col=3 label=h-three"
- e_cmd "detail-header-set col=4 label=h-four"
- e_cmd "detail-header-set col=5 label=h-five"
- e_cmd "detail-header-set col=6 label=h-six"
+ e_cmd "detail-header-set col=1 size=60 label=h-one"
+ e_cmd "detail-header-set col=2 size=70 label=h-two"
+ e_cmd "detail-header-set col=3 size=80 label=h-three"
+ e_cmd "detail-header-set col=4 size=90 label=h-four"
+ e_cmd "detail-header-set col=5 size=130 label=h-five"
+ e_cmd "detail-header-set col=6 size=60 label=h-six"
# begin initial listing of files
e_cmd "list-begin"
diff --git a/src/efm/efm.c b/src/efm/efm.c
index 5b4c074..802d1d7 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -40,6 +40,15 @@ static Evas_Smart *_smart = NULL;
static Evas_Smart_Class _sc = EVAS_SMART_CLASS_INIT_NULL;
static Evas_Smart_Class _sc_parent = EVAS_SMART_CLASS_INIT_NULL;
+static void _cb_canvas_resize(void *data, Evas *e,
+ void *event_info EINA_UNUSED);
+static void _reposition_detail_header_items(Smart_Data *sd);
+static void _recalc(Smart_Data *sd);
+static void _redo_detail_sizes(Smart_Data *sd);
+static void _reposition_detail_bars(Smart_Data *sd);
+static void _detail_realized_items_resize(Smart_Data *sd);
+
+
#define ENTRY \
Smart_Data *sd = evas_object_smart_data_get(obj); \
if (!sd) return
@@ -49,11 +58,6 @@ static Evas_Smart_Class _sc_parent = EVAS_SMART_CLASS_INIT_NULL;
#include "efm_util.c"
#include "efm_dnd.c"
-static void _cb_canvas_resize(void *data, Evas *e,
- void *event_info EINA_UNUSED);
-static void _reposition_detail_header_items(Smart_Data *sd);
-static void _recalc(Smart_Data *sd);
-
static void
_cb_header_change(void *data)
{
@@ -511,6 +515,25 @@ _cb_back_mouse_move(void *data, Evas *e EINA_UNUSED,
= ecore_timer_add(SCROLL_SEL_TIMER, _cb_sel_bounds_scroll_timer, sd);
}
+static void
+_redo_detail_sizes(Smart_Data *sd)
+{
+ Evas_Object *o;
+ char buf[128];
+ int i;
+
+ for (i = 0; i < 6; i++)
+ {
+ o = sd->o_list_detail_swallow[i];
+ snprintf(buf, sizeof(buf), "e.swallow.detail%i", i + 1);
+ evas_object_size_hint_min_set
+ (o, sd->config.detail_min_w[i] * _scale_get(sd), 0);
+ edje_object_part_swallow(sd->o_list_detailed_dummy, buf, o);
+ }
+ _reposition_detail_bars(sd);
+ _detail_realized_items_resize(sd);
+}
+
static void
_reposition_detail_bars(Smart_Data *sd)
{
@@ -519,9 +542,11 @@ _reposition_detail_bars(Smart_Data *sd)
for (i = 0; i < 6; i++)
{
- evas_object_geometry_get(sd->o_list_detail_swallow[i], &x, NULL, &w,
- NULL);
+ if (!sd->o_list_detail_swallow[i]) continue;
+ evas_object_geometry_get(sd->o_list_detail_swallow[i], &x, NULL,
+ &w, NULL);
x -= sd->geom.x;
+ if (!sd->o_list_detail[i]) continue;
elm_grid_pack(sd->o_overlay_grid, sd->o_list_detail[i], x, 0, w, 100);
}
_reposition_detail_header_items(sd);
@@ -1470,17 +1495,18 @@ static void
_reposition_detail_header_items(Smart_Data *sd)
{
int i, vw, vh;
- Evas_Coord det_x, det_w, x, w, xp;
+ Evas_Coord det_x, det_w, x, w, xp = 0;
if (!sd->o_detail_header) return;
+ if (!sd->o_overlay_grid) return;
evas_object_geometry_get(sd->o_overlay_grid, &det_x, NULL, &det_w, NULL);
elm_grid_size_get(sd->o_overlay_grid, &vw, &vh);
- xp = 0;
elm_grid_size_set(sd->o_detail_header, vw, 100);
for (i = 0; i < 7; i++)
{
if (i < 6)
{
+ if (!sd->o_list_detail[i]) continue;
elm_grid_pack_get(sd->o_list_detail[i], &x, NULL, NULL, NULL);
w = (x - xp);
}
@@ -1489,6 +1515,7 @@ _reposition_detail_header_items(Smart_Data *sd)
w = vw - xp;
x = xp + w;
}
+ if (!sd->o_detail_header_item[i]) continue;
elm_grid_pack(sd->o_detail_header, sd->o_detail_header_item[i], xp, 0, w,
100);
xp = x;
@@ -1839,6 +1866,7 @@ efm_column_min_set(Evas_Object *obj, int col, Evas_Coord w)
if (col < 0) return;
else if (col >= 6) return;
sd->config.detail_min_w[col] = w;
+ _redo_detail_sizes(sd);
}
void
diff --git a/src/efm/efm_back_end.c b/src/efm/efm_back_end.c
index 5accd9c..457805c 100644
--- a/src/efm/efm_back_end.c
+++ b/src/efm/efm_back_end.c
@@ -468,21 +468,34 @@ _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg)
CMD_DONE;
}
else if (!strcmp(c->command, "detail-header-set"))
- { // *** must call before list-begin
+ {
const char *col = cmd_key_find(c, "col");
- const char *label = cmd_key_find(c, "label");
- if ((col) && (label))
+ if (col)
{
int colnum = atoi(col);
if ((colnum >= 0) && (colnum <= 6))
{
- eina_stringshare_replace
- (&(sd->config.detail_heading[colnum]), label);
- if (sd->o_detail_header_item[colnum])
- elm_object_text_set(sd->o_detail_header_item[colnum],
- sd->config.detail_heading[colnum]);
+ const char *label = cmd_key_find(c, "label");
+ const char *size = cmd_key_find(c, "size");
+ // XXX: support icon in future?
+
+ if (label)
+ {
+ eina_stringshare_replace
+ (&(sd->config.detail_heading[colnum]), label);
+ if (sd->o_detail_header_item[colnum])
+ elm_object_text_set(sd->o_detail_header_item[colnum],
+ sd->config.detail_heading[colnum]);
+ }
+ if ((size) && (colnum >= 1))
+ { // can't set width of col 0 - always "rest of width"
+ int sz = atoi(size);
+
+ sd->config.detail_min_w[colnum - 1] = sz;
+ _redo_detail_sizes(sd);
+ }
}
}
CMD_DONE;
diff --git a/src/shared/common/cmd.h b/src/shared/common/cmd.h
index 0eabcda..ed3bd3d 100644
--- a/src/shared/common/cmd.h
+++ b/src/shared/common/cmd.h
@@ -8,16 +8,16 @@
// CURRENT COMMANDS:
////////////////////
//
-// file-add // a dile in a dir being monitored has been added
-// file-del // a file in a dir being monitored has been deleted
-// file-mod // a file in a dir being monitored has been modified
-// dir-set // tell the backend what dir to open/list/watch
-// dir-del // the dir being monitored/listed has been deleted
-// meta-set // set metadata for a file path
-// list-begin // begin initial listing of dir
-// list-end // end initial listing of dir
-// viewmode-set
-// detail-header-set
+// file-add // a file in a dir being monitored has been added
+// file-del // a file in a dir being monitored has been deleted
+// file-mod // a file in a dir being monitored has been modified
+// dir-set // tell the backend what dir to open/list/watch
+// dir-del // the dir being monitored/listed has been deleted
+// meta-set // set metadata for a file path
+// list-begin // begin initial listing of dir
+// list-end // end initial listing of dir
+// viewmode-set // force a specific view mode from backend
+// detail-header-set // set detail header text, size
//
// cnp-cut
// cnp-copy
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.