Better sorted border menu.
authorMiculcy Brian <morlenxus@gmx.net>
Wed, 21 May 2008 22:37:00 +0000 (22:37 +0000)
committerMiculcy Brian <morlenxus@gmx.net>
Wed, 21 May 2008 22:37:00 +0000 (22:37 +0000)
SVN revision: 34635

src/bin/e_border.h
src/bin/e_int_border_menu.c

index e85b585..4ccece1 100644 (file)
@@ -452,8 +452,6 @@ struct _E_Border
    E_Config_Dialog *border_remember_dialog;
    E_Config_Dialog *border_border_dialog;
    E_Dialog *border_prop_dialog;
-   E_Menu *border_stacking_menu;
-   E_Menu *border_maximize_menu;
    Evas_List *pending_move_resize;
    
    struct {
index f7e8696..07f373f 100644 (file)
@@ -10,14 +10,18 @@ static void _e_border_menu_cb_border(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_close(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_border_menu_cb_maximize_pre(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_maximize_vertically(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_maximize_horizontally(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_unmaximize(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_border_menu_cb_application_add_pre(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_border_menu_cb_more_pre(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_prop(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_border_menu_cb_stacking_pre(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_on_top(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_normal(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_below(void *data, E_Menu *m, E_Menu_Item *mi);
@@ -32,7 +36,7 @@ static void _e_border_menu_cb_unpin(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_raise(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_lower(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_state_pre(void *data, E_Menu *m, E_Menu_Item *mi);
-static void _e_border_menu_cb_skip(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_border_menu_cb_skip_pre(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_fav_add(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_kbdshrtct_add(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_ibar_add_pre(void *data, E_Menu *m, E_Menu_Item *mi);
@@ -52,103 +56,6 @@ e_int_border_menu_create(E_Border *bd)
 
    if (bd->border_menu) return;
 
-   /* Only allow to change layer for windows in "normal" layers */
-   if ((!bd->lock_user_stacking) &&
-       ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
-     {
-       m = e_menu_new();
-       e_menu_category_set(m,"border/stacking");
-       e_menu_category_data_set("border/stacking",bd);
-       bd->border_stacking_menu = m;
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Always On Top"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 2);
-       e_menu_item_toggle_set(mi, (bd->layer == 150 ? 1 : 0));
-       e_menu_item_callback_set(mi, _e_border_menu_cb_on_top, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/stack_on_top"),
-                                 "e/widgets/border/default/stack_on_top");
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Normal"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 2);
-       e_menu_item_toggle_set(mi, (bd->layer == 100 ? 1 : 0));
-       e_menu_item_callback_set(mi, _e_border_menu_cb_normal, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/stack_normal"),
-                                 "e/widgets/border/default/stack_normal");
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Always Below"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 2);
-       e_menu_item_toggle_set(mi, (bd->layer == 50 ? 1 : 0));
-       e_menu_item_callback_set(mi, _e_border_menu_cb_below, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/stack_below"),
-                                 "e/widgets/border/default/stack_below");
-     }
-
-   /* Only allow to change layer for windows in "normal" layers */
-   if ((!bd->lock_user_maximize) && (!bd->shaded) &&
-       ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
-     {
-       m = e_menu_new();
-       e_menu_category_set(m,"border/maximize");
-       e_menu_category_data_set("border/maximize",bd);
-       bd->border_maximize_menu = m;
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Maximize"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 3);
-       e_menu_item_toggle_set(mi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH);
-       e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/maximize"),
-                                 "e/widgets/border/default/maximize");
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Maximize vertically"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 3);
-       e_menu_item_toggle_set(mi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL);
-       e_menu_item_callback_set(mi, _e_border_menu_cb_maximize_vertically, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/maximize"),
-                                 "e/widgets/border/default/maximize");
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Maximize horizontally"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 3);
-       e_menu_item_toggle_set(mi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL);
-       e_menu_item_callback_set(mi, _e_border_menu_cb_maximize_horizontally, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/maximize"),
-                                 "e/widgets/border/default/maximize");
-
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Unmaximize"));
-       e_menu_item_radio_set(mi, 1);
-       e_menu_item_radio_group_set(mi, 3);
-       e_menu_item_toggle_set(mi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_NONE);
-       e_menu_item_callback_set(mi, _e_border_menu_cb_unmaximize, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/maximize"),
-                                 "e/widgets/border/default/maximize");
-     }
-
    m = e_menu_new();
    e_menu_category_set(m,"border");
    e_menu_category_data_set("border",bd);
@@ -156,37 +63,39 @@ e_int_border_menu_create(E_Border *bd)
    bd->border_menu = m;
    e_menu_post_deactivate_callback_set(m, _e_border_cb_border_menu_end, NULL);
 
-   mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, _("Window Locks"));
-   e_menu_item_callback_set(mi, _e_border_menu_cb_locks, bd);
-   e_menu_item_icon_edje_set(mi,
-                            e_theme_edje_file_get("base/theme/borders",
-                                                  "e/widgets/border/default/locks"),
-                            "e/widgets/border/default/locks");
-   mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, _("Remember"));
-   e_menu_item_callback_set(mi, _e_border_menu_cb_remember, bd);
-   e_menu_item_icon_edje_set(mi,
-                            e_theme_edje_file_get("base/theme/borders",
-                                                  "e/widgets/border/default/remember"),
-                            "e/widgets/border/default/remember");
-   if (!bd->lock_border)
+#if 1
+   if (!bd->internal)
      {
+       if (bd->desktop)
+         {
+            mi = e_menu_item_new(m);
+            e_menu_item_label_set(mi, _("Edit Icon"));
+            e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
+             e_util_desktop_menu_item_icon_add(bd->desktop, "16x16", mi);
+
+            mi = e_menu_item_new(m);
+            e_menu_item_label_set(mi, _("Add Application..."));
+            e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_application_add_pre, bd);
+            e_menu_item_icon_edje_set(mi,
+            e_theme_edje_file_get("base/theme/borders",
+                                  "e/widgets/border/default/application_add"),
+                                  "e/widgets/border/default/application_add");
+         }
+       else if (bd->client.icccm.class) /* icons with no class useless to borders */
+         {
+            mi = e_menu_item_new(m);
+            e_menu_item_label_set(mi, _("Create Icon"));
+            e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
+         }
+
        mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Border"));
-       e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_border_pre, bd);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/borderless"),
-                                 "e/widgets/border/default/borderless");
+       e_menu_item_separator_set(mi, 1);
      }
+#endif
 
    if (!bd->sticky)
      {
        mi = e_menu_item_new(m);
-       e_menu_item_separator_set(mi, 1);
-
-       mi = e_menu_item_new(m);
        e_menu_item_label_set(mi, _("Send to Desktop"));
        e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_sendto_pre, bd);
        e_menu_item_icon_edje_set(mi,
@@ -206,7 +115,6 @@ e_int_border_menu_create(E_Border *bd)
                                                        "e/widgets/border/default/stick"),
                                  "e/widgets/border/default/stick");
      }
-
    if ((bd->client.netwm.state.stacking == E_STACKING_BELOW) &&
        (bd->user_skip_winlist) && (bd->borderless))
      {
@@ -220,94 +128,67 @@ e_int_border_menu_create(E_Border *bd)
      }
 
    mi = e_menu_item_new(m);
-   e_menu_item_separator_set(mi, 1);
-
-   mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, _("Stacking"));
-   e_menu_item_submenu_set(mi, bd->border_stacking_menu);
+   e_menu_item_label_set(mi, _("More..."));
+   e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_more_pre, bd);
    e_menu_item_icon_edje_set(mi,
                             e_theme_edje_file_get("base/theme/borders",
-                                                  "e/widgets/border/default/stacking"),
-                            "e/widgets/border/default/stacking");
+                                                  "e/widgets/border/default/basic"),
+                                                  "e/widgets/border/default/basic");
+
+   mi = e_menu_item_new(m);
+   e_menu_item_separator_set(mi, 1);
 
    if (!(((bd->client.icccm.min_w == bd->client.icccm.max_w) &&
          (bd->client.icccm.min_h == bd->client.icccm.max_h)) ||
         (bd->lock_user_maximize)))
      {
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, _("Maximize"));
-       e_menu_item_submenu_set(mi, bd->border_maximize_menu);
-       e_menu_item_icon_edje_set(mi,
-                                 e_theme_edje_file_get("base/theme/borders",
-                                                       "e/widgets/border/default/maximize"),
-                                 "e/widgets/border/default/maximize");
+       /* Only allow to change layer for windows in "normal" layers */
+       if ((!bd->lock_user_maximize) && (!bd->shaded) &&
+           ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
+         {
+            mi = e_menu_item_new(m);
+            e_menu_item_label_set(mi, _("Maximize"));
+            e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_maximize_pre, bd);
+            e_menu_item_icon_edje_set(mi,
+                                      e_theme_edje_file_get("base/theme/borders",
+                                                            "e/widgets/border/default/maximize"),
+                                      "e/widgets/border/default/maximize");
+         }
      }
 
-   mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, _("State"));
-   e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_state_pre, bd);
-   e_menu_item_icon_edje_set(mi,
-                            e_theme_edje_file_get("base/theme/borders",
-                                                  "e/widgets/border/default/stick"),
-                            "e/widgets/border/default/stick");
-
-   mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, _("Skip"));
-   e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_skip, bd);
-   e_menu_item_icon_edje_set(mi,
-                            e_theme_edje_file_get("base/theme/borders",
-                                                  "e/widgets/border/default/skip"),
-                            "e/widgets/border/default/skip");
-
-#if 1
    if (!bd->internal)
      {
-       mi = e_menu_item_new(m);
-       e_menu_item_separator_set(mi, 1);
-
-       if (bd->desktop)
+       if ((!bd->lock_user_iconify) && (!bd->fullscreen))
          {
             mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Edit Icon"));
-            e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
-             e_util_desktop_menu_item_icon_add(bd->desktop, "16x16", mi);
-
-            mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Add To Favorites Menu"));
-            e_menu_item_callback_set(mi, _e_border_menu_cb_fav_add, bd);
-            e_util_menu_item_edje_icon_set(mi, "enlightenment/favorites");
-
-            if (e_configure_registry_exists("keyboard_and_mouse/key_bindings"))
-               {
-                 mi = e_menu_item_new(m);
-                 e_menu_item_label_set(mi, _("Add Keyboard Shortcut"));
-                 e_menu_item_callback_set(mi, _e_border_menu_cb_kbdshrtct_add, bd);
-                 e_util_menu_item_edje_icon_set(mi, "enlightenment/keys");
-              }
-            mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Add To Launcher"));
-            e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_ibar_add_pre, bd);
-            e_util_menu_item_edje_icon_set(mi, "enlightenment/ibar_applications");
+            e_menu_item_label_set(mi, _("Iconify"));
+            e_menu_item_callback_set(mi, _e_border_menu_cb_iconify, bd);
+            e_menu_item_icon_edje_set(mi,
+                                      e_theme_edje_file_get("base/theme/borders",
+                                                            "e/widgets/border/default/minimize"),
+                                      "e/widgets/border/default/minimize");
          }
-       else if (bd->client.icccm.class) /* icons with no class useless to borders */
+       /* Only allow to change layer for windows in "normal" layers */
+       if ((!bd->lock_user_stacking) &&
+           ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
          {
             mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Create Icon"));
-            e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
+            e_menu_item_label_set(mi, _("Lower"));
+            e_menu_item_callback_set(mi, _e_border_menu_cb_lower, bd);
+            e_menu_item_icon_edje_set(mi,
+                                      e_theme_edje_file_get("base/theme/borders",
+                                                            "e/widgets/border/default/stack_on_top"),
+                                      "e/widgets/border/default/stack_below");
+
+            mi = e_menu_item_new(m);
+            e_menu_item_label_set(mi, _("Raise"));
+            e_menu_item_callback_set(mi, _e_border_menu_cb_raise, bd);
+            e_menu_item_icon_edje_set(mi,
+                                      e_theme_edje_file_get("base/theme/borders",
+                                                            "e/widgets/border/default/stack_on_top"),
+                                      "e/widgets/border/default/stack_on_top");
          }
      }
-#endif
-
-   mi = e_menu_item_new(m);
-   e_menu_item_separator_set(mi, 1);
-
-   mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, _("Window Properties"));
-   e_menu_item_callback_set(mi, _e_border_menu_cb_prop, bd);
-   e_menu_item_icon_edje_set(mi,
-                            e_theme_edje_file_get("base/theme/borders",
-                                                  "e/widgets/border/default/properties"),
-                            "e/widgets/border/default/properties");
 
    mi = e_menu_item_new(m);
    e_menu_item_separator_set(mi, 1);
@@ -320,7 +201,7 @@ e_int_border_menu_create(E_Border *bd)
        e_menu_item_icon_edje_set(mi,
                                  e_theme_edje_file_get("base/theme/borders",
                                                        "e/widgets/border/default/kill"),
-                                 "e/widgets/border/default/kill");
+                                                       "e/widgets/border/default/kill");
      }
 
    if (!bd->lock_close)
@@ -331,47 +212,8 @@ e_int_border_menu_create(E_Border *bd)
        e_menu_item_icon_edje_set(mi,
                                  e_theme_edje_file_get("base/theme/borders",
                                                        "e/widgets/border/default/close"),
-                                 "e/widgets/border/default/close");
+                                                       "e/widgets/border/default/close");
      }
-
-   if (!bd->internal)
-     {
-       mi = e_menu_item_new(m);
-       e_menu_item_separator_set(mi, 1);
-
-       /* Only allow to change layer for windows in "normal" layers */
-       if ((!bd->lock_user_stacking) &&
-           ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
-         {
-            mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Raise"));
-            e_menu_item_callback_set(mi, _e_border_menu_cb_raise, bd);
-            e_menu_item_icon_edje_set(mi,
-                                      e_theme_edje_file_get("base/theme/borders",
-                                                            "e/widgets/border/default/stack_on_top"),
-                                      "e/widgets/border/default/stack_on_top");
-
-            mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Lower"));
-            e_menu_item_callback_set(mi, _e_border_menu_cb_lower, bd);
-            e_menu_item_icon_edje_set(mi,
-                                      e_theme_edje_file_get("base/theme/borders",
-                                                            "e/widgets/border/default/stack_on_top"),
-                                      "e/widgets/border/default/stack_below");
-         }
-
-       if ((!bd->lock_user_iconify) && (!bd->fullscreen))
-         {
-            mi = e_menu_item_new(m);
-            e_menu_item_label_set(mi, _("Iconify"));
-            e_menu_item_callback_set(mi, _e_border_menu_cb_iconify, bd);
-            e_menu_item_icon_edje_set(mi,
-                                      e_theme_edje_file_get("base/theme/borders",
-                                                            "e/widgets/border/default/minimize"),
-                                      "e/widgets/border/default/minimize");
-         }
-     }
-
 }
        
 EAPI void
@@ -390,18 +232,6 @@ e_int_border_menu_del(E_Border *bd)
 {
    int was_menu = 0;
 
-   if (bd->border_stacking_menu)
-     {
-       e_object_del(E_OBJECT(bd->border_stacking_menu));
-       bd->border_stacking_menu = NULL;
-       was_menu = 1;
-     }
-   if (bd->border_maximize_menu)
-     {
-       e_object_del(E_OBJECT(bd->border_maximize_menu));
-       bd->border_maximize_menu = NULL;
-       was_menu = 1;
-     }
    if (bd->border_menu)
      {
        e_object_del(E_OBJECT(bd->border_menu));
@@ -499,6 +329,67 @@ _e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi)
 }
 
 static void
+_e_border_menu_cb_maximize_pre(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+   E_Menu *subm;
+   E_Menu_Item *submi;
+   E_Border *bd;
+   Evas *evas;
+
+   bd = data;
+   if (!bd) return;
+
+   subm = e_menu_new();
+   e_object_data_set(E_OBJECT(subm), bd);
+   e_menu_item_submenu_set(mi, subm);
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Maximize"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 3);
+   e_menu_item_toggle_set(submi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH);
+   e_menu_item_callback_set(submi, _e_border_menu_cb_maximize, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/maximize"),
+                            "e/widgets/border/default/maximize");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Maximize vertically"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 3);
+   e_menu_item_toggle_set(submi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL);
+   e_menu_item_callback_set(submi, _e_border_menu_cb_maximize_vertically, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/maximize"),
+                            "e/widgets/border/default/maximize");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Maximize horizontally"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 3);
+   e_menu_item_toggle_set(submi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL);
+   e_menu_item_callback_set(submi, _e_border_menu_cb_maximize_horizontally, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/maximize"),
+                            "e/widgets/border/default/maximize");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Unmaximize"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 3);
+   e_menu_item_toggle_set(submi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_NONE);
+   e_menu_item_callback_set(submi, _e_border_menu_cb_unmaximize, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/maximize"),
+                            "e/widgets/border/default/maximize");
+}
+
+
+static void
 _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi)
 {
    E_Border *bd;
@@ -573,6 +464,122 @@ _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
 }
 
 static void
+_e_border_menu_cb_application_add_pre(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+   E_Menu *subm;
+   E_Menu_Item *submi;
+   E_Border *bd;
+   Evas *evas;
+
+   bd = data;
+   if (!bd) return;
+
+   subm = e_menu_new();
+   e_object_data_set(E_OBJECT(subm), bd);
+   e_menu_item_submenu_set(mi, subm);
+
+   if (e_configure_registry_exists("keyboard_and_mouse/key_bindings"))
+     {
+       submi = e_menu_item_new(subm);
+       e_menu_item_label_set(submi, _("Keyboard Shortcut"));
+       e_menu_item_callback_set(submi, _e_border_menu_cb_kbdshrtct_add, bd);
+       e_util_menu_item_edje_icon_set(submi, "enlightenment/keys");
+     }
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("To Favorites Menu"));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_fav_add, bd);
+   e_util_menu_item_edje_icon_set(submi, "enlightenment/favorites");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("To Launcher"));
+   e_menu_item_submenu_pre_callback_set(submi, _e_border_menu_cb_ibar_add_pre, bd);
+   e_util_menu_item_edje_icon_set(submi, "enlightenment/ibar_applications");
+}
+
+static void
+_e_border_menu_cb_more_pre(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+   E_Menu *subm;
+   E_Menu_Item *submi;
+   E_Border *bd;
+   Evas *evas;
+
+   bd = data;
+   if (!bd) return;
+
+   subm = e_menu_new();
+   e_object_data_set(E_OBJECT(subm), bd);
+   e_menu_item_submenu_set(mi, subm);
+
+   if (!bd->lock_border)
+     {
+       submi = e_menu_item_new(subm);
+       e_menu_item_label_set(submi, _("Border"));
+       e_menu_item_submenu_pre_callback_set(submi, _e_border_menu_cb_border_pre, bd);
+       e_menu_item_icon_edje_set(submi,
+                                 e_theme_edje_file_get("base/theme/borders",
+                                                       "e/widgets/border/default/borderless"),
+                                 "e/widgets/border/default/borderless");
+     }
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Skip"));
+   e_menu_item_submenu_pre_callback_set(submi, _e_border_menu_cb_skip_pre, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/skip"),
+                            "e/widgets/border/default/skip");
+
+   if ((!bd->lock_user_stacking) &&
+       ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
+     {
+       submi = e_menu_item_new(subm);
+       e_menu_item_label_set(submi, _("Stacking"));
+       e_menu_item_submenu_pre_callback_set(submi, _e_border_menu_cb_stacking_pre, bd);
+        e_menu_item_icon_edje_set(submi,
+                                 e_theme_edje_file_get("base/theme/borders",
+                                                       "e/widgets/border/default/stacking"),
+                                 "e/widgets/border/default/stacking");
+     }
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("State"));
+   e_menu_item_submenu_pre_callback_set(submi, _e_border_menu_cb_state_pre, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/stick"),
+                            "e/widgets/border/default/stick");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_separator_set(submi, 1);
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Remember"));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_remember, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/remember"),
+                            "e/widgets/border/default/remember");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Window Locks"));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_locks, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/locks"),
+                            "e/widgets/border/default/locks");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Window Properties"));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_prop, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/properties"),
+                            "e/widgets/border/default/properties");
+}
+
+static void
 _e_border_menu_cb_prop(void *data, E_Menu *m, E_Menu_Item *mi)
 {
    E_Border *bd;
@@ -766,6 +773,59 @@ _e_border_menu_cb_unpin(void *data, E_Menu *m, E_Menu_Item *mi)
 }
 
 static void
+_e_border_menu_cb_stacking_pre(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+   E_Menu *subm;
+   E_Menu_Item *submi;
+   E_Border *bd;
+   Evas *evas;
+
+   bd = data;
+   if (!bd) return;
+
+   subm = e_menu_new();
+   e_object_data_set(E_OBJECT(subm), bd);
+   e_menu_item_submenu_set(mi, subm);
+
+   /* Only allow to change layer for windows in "normal" layers */
+   e_menu_category_set(subm,"border/stacking");
+   e_menu_category_data_set("border/stacking",bd);
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Always On Top"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 2);
+   e_menu_item_toggle_set(submi, (bd->layer == 150 ? 1 : 0));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_on_top, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/stack_on_top"),
+                            "e/widgets/border/default/stack_on_top");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Normal"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 2);
+   e_menu_item_toggle_set(submi, (bd->layer == 100 ? 1 : 0));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_normal, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/stack_normal"),
+                            "e/widgets/border/default/stack_normal");
+
+   submi = e_menu_item_new(subm);
+   e_menu_item_label_set(submi, _("Always Below"));
+   e_menu_item_radio_set(submi, 1);
+   e_menu_item_radio_group_set(submi, 2);
+   e_menu_item_toggle_set(submi, (bd->layer == 50 ? 1 : 0));
+   e_menu_item_callback_set(submi, _e_border_menu_cb_below, bd);
+   e_menu_item_icon_edje_set(submi,
+                            e_theme_edje_file_get("base/theme/borders",
+                                                  "e/widgets/border/default/stack_below"),
+                            "e/widgets/border/default/stack_below");
+}
+
+static void
 _e_border_menu_cb_raise(void *data, E_Menu *m, E_Menu_Item *mi)
 {
    E_Border *bd;
@@ -978,7 +1038,7 @@ _e_border_menu_cb_state_pre(void *data, E_Menu *m, E_Menu_Item *mi)
 }
 
 static void
-_e_border_menu_cb_skip(void *data, E_Menu *m, E_Menu_Item *mi)
+_e_border_menu_cb_skip_pre(void *data, E_Menu *m, E_Menu_Item *mi)
 {
    E_Border *bd = data;
    E_Menu *subm;