smart maximize.

SVN revision: 15371
This commit is contained in:
sebastid 2005-06-16 22:23:25 +00:00 committed by sebastid
parent 1e7b648ebb
commit a21f36f807
3 changed files with 50 additions and 3 deletions

View File

@ -1069,9 +1069,53 @@ e_border_maximize(E_Border *bd)
e_hints_window_maximized_set(bd, 1);
/* FIXME maximize intelligently */
e_border_raise(bd);
e_border_move_resize(bd, bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
if (e_config->smart_maximize)
{
Evas_List *l;
int x1, y1, x2, y2;
x1 = bd->zone->x;
y1 = bd->zone->y;
x2 = bd->zone->x + bd->zone->w;
y2 = bd->zone->y + bd->zone->h;
/* walk through all gadgets */
/* FIXME: Should we care about clients that aren't aligned to */
/* one edge? */
for (l = bd->zone->container->gadman->clients; l; l = l->next)
{
E_Gadman_Client *gmc;
gmc = l->data;
if ((gmc->zone != bd->zone) ||
((gmc->policy & 0xff) != E_GADMAN_POLICY_EDGES))
continue;
switch (gmc->edge)
{
case E_GADMAN_EDGE_LEFT:
if ((gmc->x + gmc->w) > x1)
x1 = (gmc->x + gmc->w);
break;
case E_GADMAN_EDGE_RIGHT:
if (gmc->x < x2)
x2 = gmc->x;
break;
case E_GADMAN_EDGE_TOP:
if ((gmc->y + gmc->h) > y1)
y1 = (gmc->y + gmc->h);
break;
case E_GADMAN_EDGE_BOTTOM:
if (gmc->y < y2)
y2 = gmc->y;
break;
}
}
/* FIXME: walk through docks and toolbars */
e_border_move_resize(bd, x1, y1, x2 - x1, y2 - y1);
}
else
e_border_move_resize(bd, bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h);
bd->maximized = 1;
bd->changes.pos = 1;
bd->changes.size = 1;

View File

@ -168,6 +168,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, winlist_pos_min_h, INT);
E_CONFIG_VAL(D, T, winlist_pos_max_w, INT);
E_CONFIG_VAL(D, T, winlist_pos_max_h, INT);
E_CONFIG_VAL(D, T, smart_maximize, INT);
e_config = e_config_domain_load("e", _e_config_edd);
if (e_config)
@ -258,6 +259,7 @@ e_config_init(void)
e_config->winlist_pos_min_h = 0;
e_config->winlist_pos_max_w = 320;
e_config->winlist_pos_max_h = 320;
e_config->smart_maximize = 1;
{
E_Config_Module *em;

View File

@ -46,7 +46,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 111
#define E_CONFIG_FILE_VERSION 112
#define E_EVAS_ENGINE_DEFAULT 0
#define E_EVAS_ENGINE_SOFTWARE_X11 1
@ -122,6 +122,7 @@ struct _E_Config
int winlist_pos_min_h;
int winlist_pos_max_w;
int winlist_pos_max_h;
int smart_maximize;
};
/* FIXME: all of thsie needs to become eet lumps for enmcode/decode */