popups showing the current size/position on move/resize now optionally invisible

SVN revision: 16989
This commit is contained in:
tsauerbeck 2005-09-27 11:22:46 +00:00 committed by tsauerbeck
parent b7ec896ab8
commit c356249423
6 changed files with 179 additions and 55 deletions

View File

@ -4,3 +4,4 @@ Sebastian Dransfeld <sebastid@tango.flipp.net>
HandyAndE (Andrew Williams) <andy@handyande.co.uk> HandyAndE (Andrew Williams) <andy@handyande.co.uk>
CodeWarrior (Hisham Mardam Bey) <hisham@hisham.cc> CodeWarrior (Hisham Mardam Bey) <hisham@hisham.cc>
dj2 (dan sinclair) <dj2@everburning.com> dj2 (dan sinclair) <dj2@everburning.com>
Tilman Sauerbeck <tilman@code-monkey.de>

View File

@ -327,6 +327,8 @@ e_config_init(void)
E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd); E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
E_CONFIG_VAL(D, T, move_info_follows, INT); /**/ E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/ E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
E_CONFIG_VAL(D, T, move_info_visible, INT); /**/
E_CONFIG_VAL(D, T, resize_info_visible, INT); /**/
E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/ E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/
E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/ E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/
E_CONFIG_VAL(D, T, use_e_cursor, INT); /**/ E_CONFIG_VAL(D, T, use_e_cursor, INT); /**/
@ -445,6 +447,8 @@ e_config_init(void)
e_config->transition_change = strdup("crossfade"); e_config->transition_change = strdup("crossfade");
e_config->move_info_follows = 1; e_config->move_info_follows = 1;
e_config->resize_info_follows = 1; e_config->resize_info_follows = 1;
e_config->move_info_visible = 1;
e_config->resize_info_visible = 1;
e_config->focus_last_focused_per_desktop = 1; e_config->focus_last_focused_per_desktop = 1;
e_config->focus_revert_on_hide_or_close = 1; e_config->focus_revert_on_hide_or_close = 1;
e_config->use_e_cursor = 1; e_config->use_e_cursor = 1;
@ -1393,6 +1397,8 @@ e_config_init(void)
E_CONFIG_LIMIT(e_config->ping_clients_wait, 0.0, 120.0); E_CONFIG_LIMIT(e_config->ping_clients_wait, 0.0, 120.0);
E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1); E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1);
E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1); E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1);
E_CONFIG_LIMIT(e_config->move_info_visible, 0, 1);
E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1);
E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1); E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1);
E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1); E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1);
E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1);

View File

@ -145,6 +145,8 @@ struct _E_Config
Evas_List *remembers; Evas_List *remembers;
int move_info_follows; int move_info_follows;
int resize_info_follows; int resize_info_follows;
int move_info_visible;
int resize_info_visible;
int focus_last_focused_per_desktop; int focus_last_focused_per_desktop;
int focus_revert_on_hide_or_close; int focus_revert_on_hide_or_close;
int use_e_cursor; int use_e_cursor;

View File

@ -4584,6 +4584,88 @@ break;
/****************************************************************************/ /****************************************************************************/
#define HDL E_IPC_OP_MOVE_INFO_VISIBLE_SET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-move-info-visible-set", 1, "Set whether the move dialog should be visible", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_INT(atoi(params[0]), HDL);
#elif (TYPE == E_WM_IN)
START_INT(val, HDL);
e_config->move_info_visible = val;
E_CONFIG_LIMIT(e_config->move_info_visible, 0, 1);
SAVE;
END_INT;
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_MOVE_INFO_VISIBLE_GET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-move-info-visible-get", 0, "Get whether the move dialog should be visible", 1, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_NULL(HDL);
#elif (TYPE == E_WM_IN)
SEND_INT(e_config->move_info_visible, E_IPC_OP_MOVE_INFO_VISIBLE_GET_REPLY, HDL);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_MOVE_INFO_VISIBLE_GET_REPLY
#if (TYPE == E_REMOTE_OPTIONS)
#elif (TYPE == E_REMOTE_OUT)
#elif (TYPE == E_WM_IN)
#elif (TYPE == E_REMOTE_IN)
START_INT(val, HDL);
printf("REPLY: %d\n", val);
END_INT;
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_RESIZE_INFO_VISIBLE_SET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-resize-info-visible-set", 1, "Set whether the resize dialog should be visible", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_INT(atoi(params[0]), HDL);
#elif (TYPE == E_WM_IN)
START_INT(val, HDL);
e_config->resize_info_visible = val;
E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1);
SAVE;
END_INT;
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_RESIZE_INFO_VISIBLE_GET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-resize-info-visible-get", 0, "Set whether the resize dialog should be visible", 1, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_NULL(HDL);
#elif (TYPE == E_WM_IN)
SEND_INT(e_config->resize_info_visible, E_IPC_OP_RESIZE_INFO_VISIBLE_GET_REPLY, HDL);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_RESIZE_INFO_VISIBLE_GET_REPLY
#if (TYPE == E_REMOTE_OPTIONS)
#elif (TYPE == E_REMOTE_OUT)
#elif (TYPE == E_WM_IN)
#elif (TYPE == E_REMOTE_IN)
START_INT(val, HDL);
printf("REPLY: %d\n", val);
END_INT;
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_FOCUS_LAST_FOCUSED_PER_DESKTOP_SET #define HDL E_IPC_OP_FOCUS_LAST_FOCUSED_PER_DESKTOP_SET
#if (TYPE == E_REMOTE_OPTIONS) #if (TYPE == E_REMOTE_OPTIONS)
OP("-focus-last-focused-per-desktop-set", 1, "Set whether E should remember focused windows when switching desks", 0, HDL) OP("-focus-last-focused-per-desktop-set", 1, "Set whether E should remember focused windows when switching desks", 0, HDL)

View File

@ -276,3 +276,10 @@
#define E_IPC_OP_USE_E_CURSOR_SET 270 #define E_IPC_OP_USE_E_CURSOR_SET 270
#define E_IPC_OP_USE_E_CURSOR_GET 271 #define E_IPC_OP_USE_E_CURSOR_GET 271
#define E_IPC_OP_USE_E_CURSOR_GET_REPLY 272 #define E_IPC_OP_USE_E_CURSOR_GET_REPLY 272
#define E_IPC_OP_MOVE_INFO_VISIBLE_SET 273
#define E_IPC_OP_MOVE_INFO_VISIBLE_GET 274
#define E_IPC_OP_MOVE_INFO_VISIBLE_GET_REPLY 275
#define E_IPC_OP_RESIZE_INFO_VISIBLE_SET 276
#define E_IPC_OP_RESIZE_INFO_VISIBLE_GET 277
#define E_IPC_OP_RESIZE_INFO_VISIBLE_GET_REPLY 278

View File

@ -18,47 +18,60 @@ e_resize_begin(E_Zone *zone, int w, int h)
Evas_Coord ew, eh; Evas_Coord ew, eh;
char buf[40]; char buf[40];
_obj = NULL;
if (_disp_pop) e_object_del(E_OBJECT(_disp_pop)); if (_disp_pop) e_object_del(E_OBJECT(_disp_pop));
_disp_pop = e_popup_new(zone, 0, 0, 1, 1);
if (!_disp_pop) return; if (e_config->resize_info_visible)
e_popup_layer_set(_disp_pop, 255); {
_obj = edje_object_add(_disp_pop->evas); _disp_pop = e_popup_new(zone, 0, 0, 1, 1);
e_theme_edje_object_set(_obj, "base/theme/borders", if (!_disp_pop) return;
"widgets/border/default/resize"); e_popup_layer_set(_disp_pop, 255);
snprintf(buf, sizeof(buf), "9999x9999"); _obj = edje_object_add(_disp_pop->evas);
edje_object_part_text_set(_obj, "text", buf); e_theme_edje_object_set(_obj, "base/theme/borders",
"widgets/border/default/resize");
edje_object_size_min_calc(_obj, &ew, &eh); snprintf(buf, sizeof(buf), "9999x9999");
evas_object_move(_obj, 0, 0); edje_object_part_text_set(_obj, "text", buf);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj); edje_object_size_min_calc(_obj, &ew, &eh);
e_popup_edje_bg_object_set(_disp_pop, _obj); evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_popup_edje_bg_object_set(_disp_pop, _obj);
}
e_resize_update(w, h); e_resize_update(w, h);
e_popup_move_resize(_disp_pop, if (e_config->resize_info_visible)
(obj_x - _disp_pop->zone->x) + {
((obj_w - ew) / 2), e_popup_move_resize(_disp_pop,
(obj_y - _disp_pop->zone->y) + (obj_x - _disp_pop->zone->x) +
((obj_h - eh) / 2), ((obj_w - ew) / 2),
ew, eh); (obj_y - _disp_pop->zone->y) +
e_popup_show(_disp_pop); ((obj_h - eh) / 2),
ew, eh);
e_popup_show(_disp_pop);
}
visible = 1; visible = 1;
} }
void void
e_resize_end(void) e_resize_end(void)
{ {
if (_obj) if (e_config->resize_info_visible)
{ {
evas_object_del(_obj); if (_obj)
_obj = NULL; {
} evas_object_del(_obj);
if (_disp_pop) _obj = NULL;
{ }
e_object_del(E_OBJECT(_disp_pop)); if (_disp_pop)
_disp_pop = NULL; {
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
} }
visible = 0; visible = 0;
} }
@ -84,45 +97,58 @@ e_move_begin(E_Zone *zone, int x, int y)
Evas_Coord ew, eh; Evas_Coord ew, eh;
char buf[40]; char buf[40];
_obj = NULL;
if (_disp_pop) e_object_del(E_OBJECT(_disp_pop)); if (_disp_pop) e_object_del(E_OBJECT(_disp_pop));
_disp_pop = e_popup_new(zone, 0, 0, 1, 1);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
"widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(_obj, "text", buf);
edje_object_size_min_calc(_obj, &ew, &eh); if (e_config->move_info_visible)
evas_object_move(_obj, 0, 0); {
evas_object_resize(_obj, ew, eh); _disp_pop = e_popup_new(zone, 0, 0, 1, 1);
evas_object_show(_obj); _obj = edje_object_add(_disp_pop->evas);
e_popup_edje_bg_object_set(_disp_pop, _obj); e_theme_edje_object_set(_obj, "base/theme/borders",
"widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(_obj, "text", buf);
edje_object_size_min_calc(_obj, &ew, &eh);
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_popup_edje_bg_object_set(_disp_pop, _obj);
}
// e_move_update(x, y); // e_move_update(x, y);
e_popup_move_resize(_disp_pop, if (e_config->move_info_visible)
(obj_x - _disp_pop->zone->x) + {
((obj_w - ew) / 2), e_popup_move_resize(_disp_pop,
(obj_y - _disp_pop->zone->y) + (obj_x - _disp_pop->zone->x) +
((obj_h - eh) / 2), ((obj_w - ew) / 2),
ew, eh); (obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
// e_popup_show(_disp_pop); // e_popup_show(_disp_pop);
}
// visible = 1; // visible = 1;
} }
void void
e_move_end(void) e_move_end(void)
{ {
if (_obj) if (e_config->move_info_visible)
{ {
evas_object_del(_obj); if (_obj)
_obj = NULL; {
} evas_object_del(_obj);
if (_disp_pop) _obj = NULL;
{ }
e_object_del(E_OBJECT(_disp_pop)); if (_disp_pop)
_disp_pop = NULL; {
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
} }
visible = 0; visible = 0;
} }
@ -149,7 +175,7 @@ e_move_resize_object_coords_set(int x, int y, int w, int h)
obj_y = y; obj_y = y;
obj_w = w; obj_w = w;
obj_h = h; obj_h = h;
if (visible) if (e_config->move_info_visible && visible)
{ {
e_popup_move(_disp_pop, e_popup_move(_disp_pop,
(obj_x - _disp_pop->zone->x) + (obj_x - _disp_pop->zone->x) +