summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-12-01 07:10:32 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-12-01 07:10:32 +0000
commitcf7815a1dae81a4b3aa843e5b12de04f71987b58 (patch)
tree27dc3c0829f3e50611ac35c58f0dac48b1ae12ab
parentde530418698bb56e97778daa98e95f3d2982f52c (diff)
patches and stuff hanign in mail...
SVN revision: 18756
-rw-r--r--AUTHORS1
-rw-r--r--src/bin/e_actions.c71
-rw-r--r--src/bin/e_border.c153
-rw-r--r--src/bin/e_border.h5
-rw-r--r--src/bin/e_config.c20
-rw-r--r--src/bin/e_hints.c57
-rw-r--r--src/bin/e_int_border_menu.c147
7 files changed, 418 insertions, 36 deletions
diff --git a/AUTHORS b/AUTHORS
index 4fa0c653e..cd92d20ca 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,3 +5,4 @@ HandyAndE (Andrew Williams) <andy@handyande.co.uk>
5CodeWarrior (Hisham Mardam Bey) <hisham@hisham.cc> 5CodeWarrior (Hisham Mardam Bey) <hisham@hisham.cc>
6dj2 (dan sinclair) <dj2@everburning.com> 6dj2 (dan sinclair) <dj2@everburning.com>
7Tilman Sauerbeck <tilman@code-monkey.de> 7Tilman Sauerbeck <tilman@code-monkey.de>
8Aleksej Struk <astruk@gmail.com>
diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c
index bcef8392b..0471c9e60 100644
--- a/src/bin/e_actions.c
+++ b/src/bin/e_actions.c
@@ -367,23 +367,67 @@ ACT_FN_GO(window_maximized_toggle)
367 E_Border *bd; 367 E_Border *bd;
368 368
369 bd = (E_Border *)obj; 369 bd = (E_Border *)obj;
370 if (bd->maximized) e_border_unmaximize(bd); 370 /*if (bd->maximized) e_border_unmaximize(bd);*/
371 if( bd->maximized != E_MAXIMIZE_NONE &&
372 bd->maximized != E_MAXIMIZE_VERTICAL &&
373 bd->maximized != E_MAXIMIZE_HORIZONTAL )
374 {
375 if( !params )
376 e_border_unmaximize(bd);
377 else
378 {
379 if( !strcmp( params, "vertical"))
380 e_border_unmaximize_vh(bd, E_MAXIMIZE_VERTICAL );
381 else if( !strcmp( params, "horizontal"))
382 e_border_unmaximize_vh(bd, E_MAXIMIZE_HORIZONTAL );
383 else
384 e_border_unmaximize(bd);
385 }
386 }
371 else 387 else
388 {
389 if( !bd->maximized )
372 { 390 {
373 if (!params) 391 if (!params)
374 e_border_maximize(bd, e_config->maximize_policy); 392 e_border_maximize(bd, e_config->maximize_policy);
375 else 393 else
376 { 394 {
377 if (!strcmp(params, "fullscreen")) e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN); 395 if (!strcmp(params, "fullscreen")) e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN);
378 else if (!strcmp(params, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART); 396 else if (!strcmp(params, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART);
379 else if (!strcmp(params, "expand")) e_border_maximize(bd, E_MAXIMIZE_EXPAND); 397 else if (!strcmp(params, "expand")) e_border_maximize(bd, E_MAXIMIZE_EXPAND);
380 else if (!strcmp(params, "fill")) e_border_maximize(bd, E_MAXIMIZE_FILL); 398 else if (!strcmp(params, "fill")) e_border_maximize(bd, E_MAXIMIZE_FILL);
381 else e_border_maximize(bd, e_config->maximize_policy); 399 else if (!strcmp(params, "vertical")) e_border_maximize(bd, E_MAXIMIZE_VERTICAL);
382 } 400 else if (!strcmp(params, "horizontal")) e_border_maximize(bd, E_MAXIMIZE_HORIZONTAL);
401 else e_border_maximize(bd, e_config->maximize_policy);
402 }
383 } 403 }
404 else
405 {
406 if( !params )
407 e_border_maximize( bd, e_config->maximize_policy );
408 else
409 {
410 if( !strcmp(params, "vertical") )
411 {
412 if( bd->maximized == E_MAXIMIZE_VERTICAL )
413 e_border_unmaximize_vh(bd, E_MAXIMIZE_VERTICAL );
414 else
415 e_border_maximize(bd, E_MAXIMIZE_VERTICAL );
416 }
417 else if( !strcmp(params, "horizontal") )
418 {
419 if( bd->maximized == E_MAXIMIZE_HORIZONTAL )
420 e_border_unmaximize_vh(bd, E_MAXIMIZE_HORIZONTAL );
421 else
422 e_border_maximize(bd, E_MAXIMIZE_HORIZONTAL );
423 }
424 else
425 e_border_maximize(bd, e_config->maximize_policy);
426 }
427 }
428 }
384 } 429 }
385} 430}
386
387/***************************************************************************/ 431/***************************************************************************/
388ACT_FN_GO(window_maximized) 432ACT_FN_GO(window_maximized)
389{ 433{
@@ -534,7 +578,6 @@ ACT_FN_GO(window_move_by)
534 } 578 }
535 } 579 }
536} 580}
537
538/***************************************************************************/ 581/***************************************************************************/
539ACT_FN_GO(window_move_to) 582ACT_FN_GO(window_move_to)
540{ 583{
@@ -1297,7 +1340,7 @@ e_actions_init(void)
1297 ACT_GO(window_iconic); 1340 ACT_GO(window_iconic);
1298 1341
1299 ACT_GO(window_maximized_toggle); 1342 ACT_GO(window_maximized_toggle);
1300 1343
1301 ACT_GO(window_maximized); 1344 ACT_GO(window_maximized);
1302 1345
1303 ACT_GO(window_shaded_toggle); 1346 ACT_GO(window_shaded_toggle);
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 4638f51d6..933c67119 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -1443,7 +1443,14 @@ e_border_maximize(E_Border *bd, E_Maximize max)
1443 if ((bd->shaded) || (bd->shading)) return; 1443 if ((bd->shaded) || (bd->shading)) return;
1444 if (bd->fullscreen) 1444 if (bd->fullscreen)
1445 e_border_unfullscreen(bd); 1445 e_border_unfullscreen(bd);
1446 if (!bd->maximized) 1446 if( bd->maximized == E_MAXIMIZE_VERTICAL && max == E_MAXIMIZE_VERTICAL )
1447 ; // ignore. we are already maximized vertical.
1448 else if( bd->maximized == E_MAXIMIZE_HORIZONTAL && max == E_MAXIMIZE_HORIZONTAL )
1449 ; // ignore. we are already maximized horizontaly.
1450 else if ( ( bd->maximized == E_MAXIMIZE_NONE ||
1451 bd->maximized == E_MAXIMIZE_VERTICAL ||
1452 bd->maximized == E_MAXIMIZE_HORIZONTAL )
1453 )
1447 { 1454 {
1448 int x1, y1, x2, y2; 1455 int x1, y1, x2, y2;
1449 int w, h; 1456 int w, h;
@@ -1453,10 +1460,14 @@ e_border_maximize(E_Border *bd, E_Maximize max)
1453 bd->need_maximize = 1; 1460 bd->need_maximize = 1;
1454 return; 1461 return;
1455 } 1462 }
1456 bd->saved.x = bd->x; 1463
1457 bd->saved.y = bd->y; 1464 if( !bd->maximized ) // E_MAXIMIZE_NONE
1458 bd->saved.w = bd->w; 1465 {
1459 bd->saved.h = bd->h; 1466 bd->saved.x = bd->x;
1467 bd->saved.y = bd->y;
1468 bd->saved.w = bd->w;
1469 bd->saved.h = bd->h;
1470 }
1460 e_hints_window_size_set(bd); 1471 e_hints_window_size_set(bd);
1461 1472
1462 e_border_raise(bd); 1473 e_border_raise(bd);
@@ -1532,8 +1543,54 @@ e_border_maximize(E_Border *bd, E_Maximize max)
1532 e_border_resize_limit(bd, &w, &h); 1543 e_border_resize_limit(bd, &w, &h);
1533 e_border_move_resize(bd, x1, y1, w, h); 1544 e_border_move_resize(bd, x1, y1, w, h);
1534 break; 1545 break;
1546 case E_MAXIMIZE_VERTICAL:
1547 x1 = bd->zone->x;
1548 y1 = bd->zone->y;
1549 x2 = bd->zone->x + bd->zone->w;
1550 y2 = bd->zone->y + bd->zone->h;
1551
1552 /* walk through all gadgets */
1553 e_maximize_border_gadman_fill(bd, &x1, &y1, &x2, &y2);
1554
1555 /* walk through docks and toolbars */
1556 //e_maximize_border_dock_fit(bd, &x1, &y1, &x2, &y2);
1557
1558 /* walk through all windows */
1559 //e_maximize_border_border_fill(bd, &x1, &y1, &x2, &y2);
1560
1561 x1 = bd->x;
1562 w = bd->w;
1563 h = y2 - y1;
1564 e_border_resize_limit(bd,&w,&h);
1565 e_border_move_resize(bd,x1,y1,w,h);
1566 break;
1567 case E_MAXIMIZE_HORIZONTAL:
1568 x1 = bd->zone->x;
1569 y1 = bd->zone->y;
1570 x2 = bd->zone->x + bd->zone->w;
1571 y2 = bd->zone->y + bd->zone->h;
1572
1573 /* walk through all gadgets */
1574 e_maximize_border_gadman_fill(bd, &x1, &y1, &x2, &y2);
1575
1576 /* walk through docks and toolbars */
1577 //e_maximize_border_dock_fit(bd, &x1, &y1, &x2, &y2);
1578
1579 /* walk through all windows */
1580 //e_maximize_border_border_fill(bd, &x1, &y1, &x2, &y2);
1581
1582 y1 = bd->y;
1583 h = bd->h;
1584 w = x2 - x1;
1585 e_border_resize_limit(bd,&w,&h);
1586 e_border_move_resize(bd,x1,y1,w,h);
1587 break;
1535 } 1588 }
1536 bd->maximized = max; 1589 if( bd->maximized == E_MAXIMIZE_HORIZONTAL && max == E_MAXIMIZE_VERTICAL ||
1590 bd->maximized == E_MAXIMIZE_VERTICAL && max == E_MAXIMIZE_HORIZONTAL )
1591 bd->maximized = e_config->maximize_policy;
1592 else
1593 bd->maximized = max;
1537 1594
1538 if (bd->maximized) 1595 if (bd->maximized)
1539 e_hints_window_maximized_set(bd, 1); 1596 e_hints_window_maximized_set(bd, 1);
@@ -1542,6 +1599,90 @@ e_border_maximize(E_Border *bd, E_Maximize max)
1542 1599
1543 } 1600 }
1544} 1601}
1602/***sndev : e_border_unmaxmize_vh *******************************************************/
1603void
1604e_border_unmaximize_vh(E_Border *bd, E_Maximize max )
1605{
1606 E_OBJECT_CHECK(bd);
1607 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
1608 if ((bd->shaded) || (bd->shading)) return;
1609 if( max != E_MAXIMIZE_VERTICAL && max != E_MAXIMIZE_HORIZONTAL ) return;
1610
1611 if( !bd->lock_user_maximize)
1612 {
1613 if( bd->maximized )
1614 {
1615 switch( bd->maximized )
1616 {
1617 case E_MAXIMIZE_NONE:
1618 case E_MAXIMIZE_FULLSCREEN:
1619 /* Ignore */
1620 break;
1621 case E_MAXIMIZE_SMART:
1622 case E_MAXIMIZE_EXPAND:
1623 case E_MAXIMIZE_FILL:
1624 if( max == E_MAXIMIZE_VERTICAL )
1625 {
1626 bd->maximized = E_MAXIMIZE_NONE;
1627 e_hints_window_maximized_set(bd, 0);
1628
1629 bd->maximized = E_MAXIMIZE_HORIZONTAL;
1630 e_hints_window_maximized_set(bd, 1);
1631
1632 e_border_move_resize( bd, bd->x, bd->saved.y, bd->w, bd->saved.h);
1633 e_hints_window_size_unset(bd);
1634
1635 //edje_object_signal_emit(bd->bg_object, "unmaximize", "");
1636 }
1637 if( max == E_MAXIMIZE_HORIZONTAL )
1638 {
1639 bd->maximized = E_MAXIMIZE_NONE;
1640 e_hints_window_maximized_set(bd, 0);
1641
1642 bd->maximized = E_MAXIMIZE_VERTICAL;
1643 e_hints_window_maximized_set(bd, 1);
1644
1645 e_border_move_resize( bd, bd->saved.x, bd->y, bd->saved.w, bd->h);
1646 e_hints_window_size_unset(bd);
1647
1648 //edje_object_signal_emit(bd->bg_object, "unmaximize", "");
1649 }
1650 break;
1651 case E_MAXIMIZE_VERTICAL:
1652 if( max == E_MAXIMIZE_HORIZONTAL )
1653 ; // do nothing in this case
1654 if( max == E_MAXIMIZE_VERTICAL )
1655 {
1656 bd->maximized = E_MAXIMIZE_NONE;
1657 e_hints_window_maximized_set(bd, 0);
1658
1659 e_border_move_resize( bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h);
1660 bd->saved.x = bd->saved.y = bd->saved.w = bd->saved.h = 0;
1661 e_hints_window_size_unset(bd);
1662
1663 edje_object_signal_emit(bd->bg_object, "unmaximize", "");
1664 }
1665 break;
1666 case E_MAXIMIZE_HORIZONTAL:
1667 if( max == E_MAXIMIZE_VERTICAL )
1668 ; // do nothing in this case.
1669 if( max == E_MAXIMIZE_HORIZONTAL )
1670 {
1671 bd->maximized = E_MAXIMIZE_NONE;
1672 e_hints_window_maximized_set(bd, 0);
1673
1674 e_border_move_resize( bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h);
1675 bd->saved.x = bd->saved.y = bd->saved.w = bd->saved.h = 0;
1676 e_hints_window_size_unset(bd);
1677
1678 edje_object_signal_emit(bd->bg_object, "unmaximize", "");
1679 }
1680 break;
1681 }
1682 }
1683 }
1684}
1685/**************************************************************************************/
1545 1686
1546void 1687void
1547e_border_unmaximize(E_Border *bd) 1688e_border_unmaximize(E_Border *bd)
diff --git a/src/bin/e_border.h b/src/bin/e_border.h
index f642670ac..bbbdf6fc2 100644
--- a/src/bin/e_border.h
+++ b/src/bin/e_border.h
@@ -47,7 +47,9 @@ typedef enum _E_Maximize
47 E_MAXIMIZE_FULLSCREEN, 47 E_MAXIMIZE_FULLSCREEN,
48 E_MAXIMIZE_SMART, 48 E_MAXIMIZE_SMART,
49 E_MAXIMIZE_EXPAND, 49 E_MAXIMIZE_EXPAND,
50 E_MAXIMIZE_FILL 50 E_MAXIMIZE_FILL,
51 E_MAXIMIZE_VERTICAL,
52 E_MAXIMIZE_HORIZONTAL
51} E_Maximize; 53} E_Maximize;
52 54
53typedef enum _E_Fullscreen 55typedef enum _E_Fullscreen
@@ -358,6 +360,7 @@ struct _E_Border
358 E_Config_Dialog *border_remember_dialog; 360 E_Config_Dialog *border_remember_dialog;
359 E_Config_Dialog *border_border_dialog; 361 E_Config_Dialog *border_border_dialog;
360 E_Menu *border_stacking_menu; 362 E_Menu *border_stacking_menu;
363 E_Menu *border_maximize_menu;
361 Evas_List *pending_move_resize; 364 Evas_List *pending_move_resize;
362 365
363 struct { 366 struct {
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index cb18e0458..c82e9d738 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -763,6 +763,26 @@ e_config_init(void)
763 eb->params = NULL; 763 eb->params = NULL;
764 e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); 764 e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
765 765
766 // sndev : start
767 eb = E_NEW( E_Config_Binding_Key, 1 );
768 eb->context = E_BINDING_CONTEXT_ANY;
769 eb->key = strdup("F10");
770 eb->modifiers = E_BINDING_MODIFIER_ALT;
771 eb->any_mod = 0;
772 eb->action = strdup( "window_maximized_toggle" );
773 eb->params = strdup( "vertical" );
774 e_config->key_bindings = evas_list_append( e_config->key_bindings, eb );
775
776 eb = E_NEW( E_Config_Binding_Key, 1 );
777 eb->context = E_BINDING_CONTEXT_ANY;
778 eb->key = strdup("F10");
779 eb->modifiers = E_BINDING_MODIFIER_CTRL;
780 eb->any_mod = 0;
781 eb->action = strdup( "window_maximized_toggle" );
782 eb->params = strdup( "horizontal" );
783 e_config->key_bindings = evas_list_append( e_config->key_bindings, eb );
784 // sndev : end
785
766 eb = E_NEW(E_Config_Binding_Key, 1); 786 eb = E_NEW(E_Config_Binding_Key, 1);
767 eb->context = E_BINDING_CONTEXT_ANY; 787 eb->context = E_BINDING_CONTEXT_ANY;
768 eb->key = strdup("r"); 788 eb->key = strdup("r");
diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c
index b6d384234..019227297 100644
--- a/src/bin/e_hints.c
+++ b/src/bin/e_hints.c
@@ -1010,7 +1010,60 @@ e_hints_window_size_get(E_Border *bd)
1010void 1010void
1011e_hints_window_maximized_set(E_Border *bd, int on) 1011e_hints_window_maximized_set(E_Border *bd, int on)
1012{ 1012{
1013 if ((!bd->client.netwm.state.maximized_v) && (on)) 1013
1014 if( on )
1015 {
1016 if( bd->maximized == E_MAXIMIZE_VERTICAL )
1017 {
1018 if( !bd->client.netwm.state.maximized_v )
1019 {
1020 bd->client.netwm.update.state = 1;
1021 bd->client.netwm.state.maximized_v = 1;
1022 bd->changed = 1;
1023 }
1024 }
1025 else if( bd->maximized == E_MAXIMIZE_HORIZONTAL )
1026 {
1027 if( !bd->client.netwm.state.maximized_h )
1028 {
1029 bd->client.netwm.update.state = 1;
1030 bd->client.netwm.state.maximized_h = 1;
1031 bd->changed = 1;
1032 }
1033 }
1034 else
1035 {
1036 if( !bd->client.netwm.state.maximized_v )
1037 {
1038 bd->client.netwm.update.state = 1;
1039 bd->client.netwm.state.maximized_v = 1;
1040 bd->changed = 1;
1041 }
1042 if( !bd->client.netwm.state.maximized_h )
1043 {
1044 bd->client.netwm.update.state = 1;
1045 bd->client.netwm.state.maximized_h = 1;
1046 bd->changed = 1;
1047 }
1048 }
1049 }
1050 else
1051 {
1052 if( bd->client.netwm.state.maximized_v )
1053 {
1054 bd->client.netwm.update.state = 1;
1055 bd->client.netwm.state.maximized_v = 0;
1056 bd->changed = 1;
1057 }
1058 if( bd->client.netwm.state.maximized_h )
1059 {
1060 bd->client.netwm.update.state = 1;
1061 bd->client.netwm.state.maximized_h = 0;
1062 bd->changed = 1;
1063 }
1064 }
1065
1066 /*if ((!bd->client.netwm.state.maximized_v) && (on))
1014 { 1067 {
1015 bd->client.netwm.update.state = 1; 1068 bd->client.netwm.update.state = 1;
1016 bd->client.netwm.state.maximized_v = 1; 1069 bd->client.netwm.state.maximized_v = 1;
@@ -1033,7 +1086,7 @@ e_hints_window_maximized_set(E_Border *bd, int on)
1033 bd->client.netwm.update.state = 1; 1086 bd->client.netwm.update.state = 1;
1034 bd->client.netwm.state.maximized_h = 0; 1087 bd->client.netwm.state.maximized_h = 0;
1035 bd->changed = 1; 1088 bd->changed = 1;
1036 } 1089 }*/
1037} 1090}
1038 1091
1039void 1092void
diff --git a/src/bin/e_int_border_menu.c b/src/bin/e_int_border_menu.c
index 53b8b9de3..e07fe584d 100644
--- a/src/bin/e_int_border_menu.c
+++ b/src/bin/e_int_border_menu.c
@@ -11,6 +11,8 @@ static void _e_border_menu_cb_close(void *data, E_Menu *m, E_Menu_Item *mi);
11static void _e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi); 11static void _e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi);
12static void _e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi); 12static void _e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi);
13static void _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi); 13static void _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi);
14static void _e_border_menu_cb_maximize_verticaly(void *data, E_Menu *m, E_Menu_Item *mi);
15static void _e_border_menu_cb_maximize_horizontaly(void *data, E_Menu *m, E_Menu_Item *mi);
14static void _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi); 16static void _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi);
15static void _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi); 17static void _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi);
16static void _e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi); 18static void _e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi);
@@ -70,6 +72,55 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
70 } 72 }
71 73
72 m = e_menu_new(); 74 m = e_menu_new();
75 bd->border_maximize_menu = m;
76 /* Only allow to change layer for windows in "normal" layers */
77 if ((!bd->lock_user_maximize) &&
78 ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
79 {
80 int __fullmaximization = 0;
81 mi = e_menu_item_new(m);
82 e_menu_item_label_set(mi, _("Maximized"));
83 e_menu_item_check_set(mi, 1);
84 //e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
85 e_menu_item_toggle_set( mi, ( ( (__fullmaximization = bd->maximized &&
86 bd->maximized != E_MAXIMIZE_VERTICAL &&
87 bd->maximized != E_MAXIMIZE_HORIZONTAL)) ? 1 : 0 ));
88 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
89 e_menu_item_icon_edje_set(mi,
90 (char *)e_theme_edje_file_get("base/theme/borders",
91 "widgets/border/default/maximize"),
92 "widgets/border/default/maximize");
93
94 mi = e_menu_item_new(m);
95 e_menu_item_label_set(mi, _("Maximized verticaly"));
96 e_menu_item_check_set(mi, 1);
97 //e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
98 e_menu_item_toggle_set( mi, ( ( (bd->maximized &&
99 bd->maximized == E_MAXIMIZE_VERTICAL &&
100 bd->maximized != E_MAXIMIZE_HORIZONTAL) ||
101 __fullmaximization ) ? 1 : 0 ));
102 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize_verticaly, bd);
103 e_menu_item_icon_edje_set(mi,
104 (char *)e_theme_edje_file_get("base/theme/borders",
105 "widgets/border/default/maximize"),
106 "widgets/border/default/maximize");
107
108 mi = e_menu_item_new(m);
109 e_menu_item_label_set(mi, _("Maximized horizontaly"));
110 e_menu_item_check_set(mi, 1);
111 //e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
112 e_menu_item_toggle_set( mi, ( ( (bd->maximized &&
113 bd->maximized != E_MAXIMIZE_VERTICAL &&
114 bd->maximized == E_MAXIMIZE_HORIZONTAL) ||
115 __fullmaximization ) ? 1 : 0 ));
116 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize_horizontaly, bd);
117 e_menu_item_icon_edje_set(mi,
118 (char *)e_theme_edje_file_get("base/theme/borders",
119 "widgets/border/default/maximize"),
120 "widgets/border/default/maximize");
121 }
122
123 m = e_menu_new();
73 e_object_data_set(E_OBJECT(m), bd); 124 e_object_data_set(E_OBJECT(m), bd);
74 bd->border_menu = m; 125 bd->border_menu = m;
75 e_menu_post_deactivate_callback_set(m, _e_border_cb_border_menu_end, NULL); 126 e_menu_post_deactivate_callback_set(m, _e_border_cb_border_menu_end, NULL);
@@ -117,6 +168,14 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
117 "widgets/border/default/stacking"), 168 "widgets/border/default/stacking"),
118 "widgets/border/default/stacking"); 169 "widgets/border/default/stacking");
119 170
171 mi = e_menu_item_new(m);
172 e_menu_item_label_set(mi, _("Maximize"));
173 e_menu_item_submenu_set(mi, bd->border_maximize_menu);
174 e_menu_item_icon_edje_set(mi,
175 (char *)e_theme_edje_file_get("base/theme/borders",
176 "widgets/border/default/maximize"),
177 "widgets/border/default/maximize");
178
120 if ((!bd->lock_user_shade) && (!(!strcmp("borderless", bd->client.border.name)))) 179 if ((!bd->lock_user_shade) && (!(!strcmp("borderless", bd->client.border.name))))
121 { 180 {
122 mi = e_menu_item_new(m); 181 mi = e_menu_item_new(m);
@@ -130,18 +189,44 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
130 "widgets/border/default/shade"); 189 "widgets/border/default/shade");
131 } 190 }
132 191
133 if (!bd->lock_user_maximize) 192 /*if (!bd->lock_user_maximize)
134 { 193 {
135 mi = e_menu_item_new(m); 194 mi = e_menu_item_new(m);
136 e_menu_item_label_set(mi, _("Maximized")); 195 e_menu_item_separator_set(mi, 1);
137 e_menu_item_check_set(mi, 1); 196
138 e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0)); 197 mi = e_menu_item_new(m);
139 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd); 198 e_menu_item_label_set(mi, _("Maximized"));
140 e_menu_item_icon_edje_set(mi, 199 e_menu_item_check_set(mi, 1);
141 (char *)e_theme_edje_file_get("base/theme/borders", 200 e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
142 "widgets/border/default/maximize"), 201 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
143 "widgets/border/default/maximize"); 202 e_menu_item_icon_edje_set(mi,
144 } 203 (char *)e_theme_edje_file_get("base/theme/borders",
204 "widgets/border/default/maximize"),
205 "widgets/border/default/maximize");
206
207 mi = e_menu_item_new(m);
208 e_menu_item_label_set(mi, _("Maximized verticaly"));
209 e_menu_item_check_set(mi, 1);
210 e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
211 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
212 e_menu_item_icon_edje_set(mi,
213 (char *)e_theme_edje_file_get("base/theme/borders",
214 "widgets/border/default/maximize"),
215 "widgets/border/default/maximize");
216
217 mi = e_menu_item_new(m);
218 e_menu_item_label_set(mi, _("Maximized horizontaly"));
219 e_menu_item_check_set(mi, 1);
220 e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
221 e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
222 e_menu_item_icon_edje_set(mi,
223 (char *)e_theme_edje_file_get("base/theme/borders",
224 "widgets/border/default/maximize"),
225 "widgets/border/default/maximize");
226
227 mi = e_menu_item_new(m);
228 e_menu_item_separator_set(mi, 1);
229 }*/
145 230
146 if (!bd->lock_user_sticky) 231 if (!bd->lock_user_sticky)
147 { 232 {
@@ -270,6 +355,12 @@ e_int_border_menu_del(E_Border *bd)
270 bd->border_stacking_menu = NULL; 355 bd->border_stacking_menu = NULL;
271 was_menu = 1; 356 was_menu = 1;
272 } 357 }
358 if( bd->border_maximize_menu )
359 {
360 e_object_del(E_OBJECT(bd->border_maximize_menu));
361 bd->border_maximize_menu = NULL;
362 was_menu = 1;
363 }
273 if (bd->border_menu) 364 if (bd->border_menu)
274 { 365 {
275 e_object_del(E_OBJECT(bd->border_menu)); 366 e_object_del(E_OBJECT(bd->border_menu));
@@ -365,11 +456,41 @@ _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi)
365 bd = data; 456 bd = data;
366 if (!bd->lock_user_maximize) 457 if (!bd->lock_user_maximize)
367 { 458 {
368 if (bd->maximized) e_border_unmaximize(bd); 459 if (bd->maximized != E_MAXIMIZE_NONE &&
460 bd->maximized != E_MAXIMIZE_VERTICAL &&
461 bd->maximized != E_MAXIMIZE_HORIZONTAL ) e_border_unmaximize(bd);
369 else e_border_maximize(bd, e_config->maximize_policy); 462 else e_border_maximize(bd, e_config->maximize_policy);
370 } 463 }
371} 464}
465/*** sndev : menu_cb_miximize_verticaly callback **************/
466static void
467_e_border_menu_cb_maximize_verticaly(void *data, E_Menu *m, E_Menu_Item *mi)
468{
469 E_Border *bd;
470
471 bd = data;
472 if (!bd->lock_user_maximize)
473 {
474 if (bd->maximized && bd->maximized != E_MAXIMIZE_HORIZONTAL )
475 e_border_unmaximize_vh(bd, E_MAXIMIZE_VERTICAL );
476 else e_border_maximize(bd, E_MAXIMIZE_VERTICAL );
477 }
478}
479/*** sndev : menu_cb_miximize_verticaly callback **************/
480static void
481_e_border_menu_cb_maximize_horizontaly(void *data, E_Menu *m, E_Menu_Item *mi)
482{
483 E_Border *bd;
372 484
485 bd = data;
486 if (!bd->lock_user_maximize)
487 {
488 if (bd->maximized && bd->maximized != E_MAXIMIZE_VERTICAL )
489 e_border_unmaximize_vh(bd, E_MAXIMIZE_HORIZONTAL );
490 else e_border_maximize(bd, E_MAXIMIZE_HORIZONTAL );
491 }
492}
493/*************************************************************/
373static void 494static void
374_e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi) 495_e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi)
375{ 496{