forked from enlightenment/enlightenment
allow move resize box to follow the object its moving/resizing
SVN revision: 15690
This commit is contained in:
parent
bb992161c3
commit
8e02e46a08
2
TODO
2
TODO
|
@ -44,8 +44,6 @@ Some of the things (in very short form) that need to be done to E17...
|
|||
ESSENTIAL FEATURES
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
* option to allow move and resize info boxes to be able to follow the object
|
||||
around
|
||||
* emit signal to submenu entries if they have a submenu shown for them or not
|
||||
* add window placement options like place at pointer
|
||||
* shaded windows should not allow border changes by the user
|
||||
|
|
|
@ -6286,6 +6286,10 @@ _e_border_resize_begin(E_Border *bd)
|
|||
bd->client.netwm.sync.wait = 0;
|
||||
bd->client.netwm.sync.send_time = ecore_time_get();
|
||||
}
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
|
||||
e_resize_begin(bd->zone, w, h);
|
||||
resize = bd;
|
||||
return 1;
|
||||
|
@ -6328,6 +6332,10 @@ _e_border_resize_update(E_Border *bd)
|
|||
w = (bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w;
|
||||
h = (bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h;
|
||||
}
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
|
||||
e_resize_update(w, h);
|
||||
}
|
||||
|
||||
|
@ -6350,6 +6358,10 @@ _e_border_move_begin(E_Border *bd)
|
|||
bd->client.netwm.sync.time = ecore_time_get();
|
||||
}
|
||||
#endif
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
|
||||
e_move_begin(bd->zone, bd->x, bd->y);
|
||||
move = bd;
|
||||
return 1;
|
||||
|
@ -6382,6 +6394,10 @@ _e_border_move_end(E_Border *bd)
|
|||
static void
|
||||
_e_border_move_update(E_Border *bd)
|
||||
{
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
|
||||
e_move_update(bd->x, bd->y);
|
||||
}
|
||||
|
||||
|
|
|
@ -249,6 +249,8 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, transition_desk, STR); /**/
|
||||
E_CONFIG_VAL(D, T, transition_change, STR); /**/
|
||||
E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
|
||||
E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
|
||||
E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
|
||||
|
||||
e_config = e_config_domain_load("e", _e_config_edd);
|
||||
if (e_config)
|
||||
|
@ -349,7 +351,8 @@ e_config_init(void)
|
|||
e_config->transition_start = strdup("");
|
||||
e_config->transition_desk = strdup("vswipe");
|
||||
e_config->transition_change = strdup("crossfade");
|
||||
|
||||
e_config->move_info_follows = 1;
|
||||
e_config->resize_info_follows = 1;
|
||||
{
|
||||
E_Config_Module *em;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef Eet_Data_Descriptor E_Config_DD;
|
|||
* defaults for e to work - started at 100 when we introduced this config
|
||||
* versioning feature
|
||||
*/
|
||||
#define E_CONFIG_FILE_VERSION 117
|
||||
#define E_CONFIG_FILE_VERSION 118
|
||||
|
||||
#define E_EVAS_ENGINE_DEFAULT 0
|
||||
#define E_EVAS_ENGINE_SOFTWARE_X11 1
|
||||
|
@ -135,6 +135,8 @@ struct _E_Config
|
|||
char *transition_desk;
|
||||
char *transition_change;
|
||||
Evas_List *remembers;
|
||||
int move_info_follows;
|
||||
int resize_info_follows;
|
||||
};
|
||||
|
||||
struct _E_Config_Module
|
||||
|
|
|
@ -1121,6 +1121,10 @@ _e_gadman_cb_signal_move_start(void *data, Evas_Object *obj, const char *emissio
|
|||
evas_object_raise(gmc->event_object);
|
||||
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_RAISE);
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_move_begin(gmc->zone, gmc->x, gmc->y);
|
||||
}
|
||||
|
||||
|
@ -1295,6 +1299,10 @@ _e_gadman_cb_signal_move_go(void *data, Evas_Object *obj, const char *emission,
|
|||
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
|
||||
e_object_unref(E_OBJECT(gmc));
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_move_update(gmc->x, gmc->y);
|
||||
}
|
||||
|
||||
|
@ -1309,6 +1317,10 @@ _e_gadman_cb_signal_resize_left_start(void *data, Evas_Object *obj, const char *
|
|||
gmc->use_autow = 0;
|
||||
gmc->resizing_l = 1;
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_begin(gmc->zone, gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1378,6 +1390,10 @@ _e_gadman_cb_signal_resize_left_go(void *data, Evas_Object *obj, const char *emi
|
|||
_e_gadman_client_geometry_apply(gmc);
|
||||
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_update(gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1392,6 +1408,10 @@ _e_gadman_cb_signal_resize_right_start(void *data, Evas_Object *obj, const char
|
|||
gmc->use_autow = 0;
|
||||
gmc->resizing_r = 1;
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_begin(gmc->zone, gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1457,6 +1477,10 @@ _e_gadman_cb_signal_resize_right_go(void *data, Evas_Object *obj, const char *em
|
|||
_e_gadman_client_geometry_apply(gmc);
|
||||
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_update(gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1471,6 +1495,10 @@ _e_gadman_cb_signal_resize_up_start(void *data, Evas_Object *obj, const char *em
|
|||
gmc->use_autoh = 0;
|
||||
gmc->resizing_u = 1;
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_begin(gmc->zone, gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1540,6 +1568,10 @@ _e_gadman_cb_signal_resize_up_go(void *data, Evas_Object *obj, const char *emiss
|
|||
_e_gadman_client_geometry_apply(gmc);
|
||||
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_update(gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1554,6 +1586,10 @@ _e_gadman_cb_signal_resize_down_start(void *data, Evas_Object *obj, const char *
|
|||
gmc->use_autoh = 0;
|
||||
gmc->resizing_d = 1;
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_begin(gmc->zone, gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
@ -1619,6 +1655,10 @@ _e_gadman_cb_signal_resize_down_go(void *data, Evas_Object *obj, const char *emi
|
|||
_e_gadman_client_geometry_apply(gmc);
|
||||
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
|
||||
|
||||
if (e_config->move_info_follows)
|
||||
e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
|
||||
else
|
||||
e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, gmc->zone->h);
|
||||
e_resize_update(gmc->w, gmc->h);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ static E_Popup *_disp_pop = NULL;
|
|||
static Evas_Object *_obj = NULL;
|
||||
|
||||
static int visible = 0;
|
||||
static int obj_x = 0;
|
||||
static int obj_y = 0;
|
||||
static int obj_w = 0;
|
||||
static int obj_h = 0;
|
||||
|
||||
void
|
||||
e_resize_begin(E_Zone *zone, int w, int h)
|
||||
|
@ -33,8 +37,10 @@ e_resize_begin(E_Zone *zone, int w, int h)
|
|||
e_resize_update(w, h);
|
||||
|
||||
e_popup_move_resize(_disp_pop,
|
||||
(_disp_pop->zone->w - ew) / 2,
|
||||
(_disp_pop->zone->h - eh) / 2,
|
||||
(obj_x - _disp_pop->zone->x) +
|
||||
((obj_w - ew) / 2),
|
||||
(obj_y - _disp_pop->zone->y) +
|
||||
((obj_h - eh) / 2),
|
||||
ew, eh);
|
||||
e_popup_show(_disp_pop);
|
||||
visible = 1;
|
||||
|
@ -95,8 +101,10 @@ e_move_begin(E_Zone *zone, int x, int y)
|
|||
// e_move_update(x, y);
|
||||
|
||||
e_popup_move_resize(_disp_pop,
|
||||
(_disp_pop->zone->w - ew) / 2,
|
||||
(_disp_pop->zone->h - eh) / 2,
|
||||
(obj_x - _disp_pop->zone->x) +
|
||||
((obj_w - ew) / 2),
|
||||
(obj_y - _disp_pop->zone->y) +
|
||||
((obj_h - eh) / 2),
|
||||
ew, eh);
|
||||
// e_popup_show(_disp_pop);
|
||||
// visible = 1;
|
||||
|
@ -133,3 +141,21 @@ e_move_update(int x, int y)
|
|||
snprintf(buf, sizeof(buf), "%i %i", x, y);
|
||||
edje_object_part_text_set(_obj, "text", buf);
|
||||
}
|
||||
|
||||
void
|
||||
e_move_resize_object_coords_set(int x, int y, int w, int h)
|
||||
{
|
||||
obj_x = x;
|
||||
obj_y = y;
|
||||
obj_w = w;
|
||||
obj_h = h;
|
||||
if (visible)
|
||||
{
|
||||
e_popup_move(_disp_pop,
|
||||
(obj_x - _disp_pop->zone->x) +
|
||||
((obj_w - _disp_pop->w) / 2),
|
||||
(obj_y - _disp_pop->zone->y) +
|
||||
((obj_h - _disp_pop->h) / 2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#ifdef E_TYPEDEFS
|
||||
|
||||
#else
|
||||
#ifndef E_MOVERESIZE_H
|
||||
#define E_MOVERESIZE_H
|
||||
|
||||
EAPI void e_resize_begin(E_Zone *zone, int w, int h);
|
||||
EAPI void e_resize_end(void);
|
||||
|
@ -9,3 +14,8 @@ EAPI void e_resize_update(int w, int h);
|
|||
EAPI void e_move_begin(E_Zone *zone, int x, int y);
|
||||
EAPI void e_move_end(void);
|
||||
EAPI void e_move_update(int x, int y);
|
||||
|
||||
EAPI void e_move_resize_object_coords_set(int x, int y, int w, int h);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue