Arr! E! looky like you needs a eye patch fer yer dreadful voyages.
Here's a small one that'll make ya look real scary while yer
swashbuckin!

The maximize code needs fixing. Or there needs to be a new maximize mode.
That maximizes without making my windows go under the shelf ever.
But that's too much work.

So here's a patch that'll let the user set the size and position the
window should get to when maximizing.
This can also be useful if the user has other apps that he'd rather
not overlap while maximizing.
(instant messangers and such)
Bad news, the user has to figure out the dimensions themselves and
input 'em into this.

--Sthitha
Index: src/bin/e_actions.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_actions.c,v
retrieving revision 1.92
diff -u -r1.92 e_actions.c
--- src/bin/e_actions.c	4 Mar 2007 07:03:10 -0000	1.92
+++ src/bin/e_actions.c	16 Mar 2007 19:56:40 -0000
@@ -559,6 +559,7 @@
 		       else if (!strcmp(s1, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART | max);
 		       else if (!strcmp(s1, "expand")) e_border_maximize(bd, E_MAXIMIZE_EXPAND | max);
 		       else if (!strcmp(s1, "fill")) e_border_maximize(bd, E_MAXIMIZE_FILL | max);
+		       else if (!strcmp(s1, "preset")) e_border_maximize(bd, E_MAXIMIZE_PRESET | max);
 		       else e_border_maximize(bd, (e_config->maximize_policy & E_MAXIMIZE_TYPE) | max);
 		    }
 		  else if (v == 0)
@@ -2481,6 +2482,7 @@
 	else if (!strcmp(s1, "smart"))      max |= E_MAXIMIZE_SMART;
 	else if (!strcmp(s1, "expand"))     max |= E_MAXIMIZE_EXPAND;
 	else if (!strcmp(s1, "fill"))       max |= E_MAXIMIZE_FILL;
+	else if (!strcmp(s1, "preset"))     max |= E_MAXIMIZE_PRESET;
 	else                                max |= (e_config->maximize_policy & E_MAXIMIZE_TYPE);
      }
    else
Index: src/bin/e_border.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.573
diff -u -r1.573 e_border.c
--- src/bin/e_border.c	2 Mar 2007 17:00:20 -0000	1.573
+++ src/bin/e_border.c	16 Mar 2007 19:56:44 -0000
@@ -1811,6 +1811,8 @@
 	     else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
 	       e_border_move_resize(bd, x1, bd->y, w, bd->h);
 	     break;
+	   case E_MAXIMIZE_PRESET:
+	     e_border_move_resize(bd, e_config->maximize_presetx, e_config->maximize_presety, e_config->maximize_presetw, e_config->maximize_preseth);
 	  }
 	/* Remove previous type */
 	bd->maximized &= ~E_MAXIMIZE_TYPE;
Index: src/bin/e_border.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.156
diff -u -r1.156 e_border.h
--- src/bin/e_border.h	2 Mar 2007 17:00:20 -0000	1.156
+++ src/bin/e_border.h	16 Mar 2007 19:56:45 -0000
@@ -48,6 +48,7 @@
    E_MAXIMIZE_SMART      = 0x00000002,
    E_MAXIMIZE_EXPAND     = 0x00000003,
    E_MAXIMIZE_FILL       = 0x00000004,
+   E_MAXIMIZE_PRESET     = 0x00000005,
    E_MAXIMIZE_TYPE       = 0x0000000f,
    E_MAXIMIZE_VERTICAL   = 0x00000010,
    E_MAXIMIZE_HORIZONTAL = 0x00000020,
Index: src/bin/e_config.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.229
diff -u -r1.229 e_config.c
--- src/bin/e_config.c	13 Mar 2007 18:03:19 -0000	1.229
+++ src/bin/e_config.c	16 Mar 2007 19:56:47 -0000
@@ -420,6 +420,10 @@
    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, maximize_policy, INT); /**/
+   E_CONFIG_VAL(D, T, maximize_presetx, INT); /**/
+   E_CONFIG_VAL(D, T, maximize_presety, INT); /**/
+   E_CONFIG_VAL(D, T, maximize_presetw, INT); /**/
+   E_CONFIG_VAL(D, T, maximize_preseth, INT); /**/
    E_CONFIG_VAL(D, T, allow_manip, INT); /**/
    E_CONFIG_VAL(D, T, kill_if_close_not_possible, INT); /**/
    E_CONFIG_VAL(D, T, kill_process, INT); /**/
@@ -647,6 +651,10 @@
    e_config->winlist_pos_max_w = 320;
    e_config->winlist_pos_max_h = 320;
    e_config->maximize_policy = E_MAXIMIZE_SMART | E_MAXIMIZE_BOTH;
+   e_config->maximize_presetx = 0;
+   e_config->maximize_presety = 0;
+   e_config->maximize_presetw = 640;
+   e_config->maximize_preseth = 480;
    e_config->allow_manip = 0;
    e_config->kill_if_close_not_possible = 1;
    e_config->kill_process = 1;
@@ -1402,6 +1410,10 @@
    E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000);
    E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000);
    E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_DIRECTION);
+   E_CONFIG_LIMIT(e_config->maximize_presetx, 0, 8192);
+   E_CONFIG_LIMIT(e_config->maximize_presety, 0, 8192);
+   E_CONFIG_LIMIT(e_config->maximize_presetw, 1, 8192);
+   E_CONFIG_LIMIT(e_config->maximize_preseth, 1, 8192);
    E_CONFIG_LIMIT(e_config->allow_manip, 0, 1);
    E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1);
    E_CONFIG_LIMIT(e_config->kill_process, 0, 1);
Index: src/bin/e_config.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.144
diff -u -r1.144 e_config.h
--- src/bin/e_config.h	13 Mar 2007 18:03:19 -0000	1.144
+++ src/bin/e_config.h	16 Mar 2007 19:56:47 -0000
@@ -165,6 +165,10 @@
    int         winlist_pos_max_w; // GUI
    int         winlist_pos_max_h; // GUI
    int         maximize_policy; // GUI
+   int         maximize_presetx;
+   int         maximize_presety;
+   int         maximize_presetw;
+   int         maximize_preseth;
    int         allow_manip; // GUI
    int         kill_if_close_not_possible;
    int         kill_process;
Index: src/bin/e_int_config_window_manipulation.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_int_config_window_manipulation.c,v
retrieving revision 1.17
diff -u -r1.17 e_int_config_window_manipulation.c
--- src/bin/e_int_config_window_manipulation.c	15 Jan 2007 17:43:19 -0000	1.17
+++ src/bin/e_int_config_window_manipulation.c	16 Mar 2007 19:56:47 -0000
@@ -20,6 +20,10 @@
    int maximize_policy;
    /*- ADVANCED -*/
    int maximize_direction;
+   int presetx;
+   int presety;
+   int presetw;
+   int preseth;
    double auto_raise_delay;
    int desk_resist;
    int window_resist;
@@ -68,6 +72,10 @@
    if (cfdata->maximize_policy == E_MAXIMIZE_NONE)
      cfdata->maximize_policy = E_MAXIMIZE_FULLSCREEN;
    cfdata->maximize_direction = (e_config->maximize_policy & E_MAXIMIZE_DIRECTION);
+   cfdata->presetx = e_config->maximize_presetx;
+   cfdata->presety = e_config->maximize_presety;
+   cfdata->presetw = e_config->maximize_presetw;
+   cfdata->preseth = e_config->maximize_preseth;
    if (!cfdata->maximize_direction)
      cfdata->maximize_direction = E_MAXIMIZE_BOTH;
    cfdata->allow_manip = e_config->allow_manip;
@@ -119,6 +127,10 @@
    e_config->window_resist = cfdata->window_resist;
    e_config->gadget_resist = cfdata->gadget_resist;
    e_config->maximize_policy = cfdata->maximize_policy | cfdata->maximize_direction;
+   e_config->maximize_presetx = cfdata->presetx;
+   e_config->maximize_presety = cfdata->presety;
+   e_config->maximize_presetw = cfdata->presetw;
+   e_config->maximize_preseth = cfdata->preseth;
    e_config->allow_manip = cfdata->allow_manip;
    e_config->border_raise_on_mouse_action = cfdata->border_raise_on_mouse_action;
    e_config->border_raise_on_focus = cfdata->border_raise_on_focus;
@@ -153,6 +165,8 @@
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_radio_add(evas, _("Fill available space"), E_MAXIMIZE_FILL, rg);
    e_widget_framelist_object_append(of, ob);
+   ob = e_widget_radio_add(evas, _("Set Maximize Region (See Advanced)"), E_MAXIMIZE_PRESET, rg);
+   e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
    
    return o;
@@ -164,7 +178,12 @@
    /* generate the core widget layout for an advanced dialog */
    Evas_Object *o, *ob, *of, *ot;
    E_Radio_Group *rg;
-   
+   Ecore_X_Screen_Size c_size;
+   E_Manager *man;
+
+   man = e_manager_current_get();
+   c_size = ecore_x_randr_current_screen_size_get(man->root);
+    
    o = e_widget_list_add(evas, 0, 0);
    ot = e_widget_table_add(evas, 0);
    
@@ -212,6 +231,17 @@
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_radio_add(evas, _("Fill available space"), E_MAXIMIZE_FILL, rg);
    e_widget_framelist_object_append(of, ob);
+   ob = e_widget_radio_add(evas, _("Set Maximize Region"), E_MAXIMIZE_PRESET, rg);
+   e_widget_framelist_object_append(of, ob);
+
+   ob = e_widget_slider_add(evas, 1, 0, _("X Position: %2.0f"), 0, c_size.width, 1, 0, NULL, &(cfdata->presetx), 200);
+   e_widget_framelist_object_append(of, ob);
+   ob = e_widget_slider_add(evas, 1, 0, _("Y Position: %2.0f"), 0, c_size.height, 1, 0, NULL, &(cfdata->presety), 200);
+   e_widget_framelist_object_append(of, ob);
+   ob = e_widget_slider_add(evas, 1, 0, _("Width: %2.0f"), 1, c_size.width, 1, 0, NULL, &(cfdata->presetw), 200);
+   e_widget_framelist_object_append(of, ob);
+   ob = e_widget_slider_add(evas, 1, 0, _("Height: %2.0f"), 1, c_size.height, 1, 0, NULL, &(cfdata->preseth), 200);
+   e_widget_framelist_object_append(of, ob);
 
    rg = e_widget_radio_group_new(&(cfdata->maximize_direction));
    ob = e_widget_radio_add(evas, _("Both directions"), E_MAXIMIZE_BOTH, rg);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to