Re: double click to maximize window



lewst@yahoo.com writes:

> I'm using gnome with enlightenment and would like to
> program the middle (2nd) mouse button to maximize the
> window to fill the whole screen when I double click
> on the window's titlebar.
>
> How would I go about this?  The enlightenment configuration
> tool through the gnome command center allows me to set
> keyboard bindings to do this, but not mouse behavior.

I changed middle button to iconfiy.  The easiest way would doubtless
be to change ACTION_MOVE, but I interpreted comments from rasterman to
indicate that we shouldn't change the standard actions.  So I made a
CUSTOM_THEME_ACTION_MOVE.

Then you go into the borders directory of the theme in question and
invoke it.

In detail
~/.enlightenment/themes/BrushedMetal-Allan/borders/DEFAULT/border.cfg
begins with


  /*
  ****************************************************************
  * Have the main bar use my CUSTOM_MOVE_ACTION_MOVE instead of
  * the normal one action_move.
  * The difference is middle button now iconifies instead of shades.
  ****************************************************************
  */

  __BORDER __BGN
    __NAME DEFAULT
    __BORDER_SIZE_LEFT 4
    __BORDER_SIZE_RIGHT 4
    __BORDER_SIZE_TOP 22
    __BORDER_SIZE_BOTTOM 4
    __SHADE_DIRECTION __UP
    __CHANGES_SHAPE __OFF

    __BORDER_PART __BGN
        __ICLASS B0
        __ACLASS CUSTOM_THEME_ACTION_MOVE /* this is the change */
        __CURSOR MOVE
        __MIN_WIDTH 0
        __MAX_WIDTH 99999
      __MIN_HEIGHT 23

Assuming you want this in other than the DEFAULT border, look at
.../borders/*/border.cfg and replace all ACTION_MOVES.

Now to define CUSTOM_THEME_ACTION_MOVE:
~/.enlightenment/actionclasses.cfg begins with the
code below (see lines ending with <---)
instead of __A_ICONIFY you probably want something like
__A_MAX_WIDTH conservative  
(look in /usr/share/enlightenment/config/actionclasses.cfg)


  /*
  ******************************************************************************
  * r1.2
  *
  * This is a file from /usr/share/enlightenment.
  * I have it here to define my new action class, CUSTOM_THEME_ACTION_MOVE.
  * (Rasterman wants all new classes to use the name CUSTOM_THEME_something.)
  * The old action classes are here as well since including this file
  * in my .enlightenment seems to void the copy of this file in
  * /usr/share/enlightenment
  ******************************************************************************
  */

  #include <definitions>

  __E_CFG_VERSION 0

  /*
  ******************************************************************************
  * Internally used and looked for actions
  ******************************************************************************
  * ACTION_BUTTON_DRAG is looked for by e to determine what "action" by a user
  * will be applied to every button to start a button drag. if u dont like just
  * moving and dragging (in case you accidentally keep doing it to buttons)
  * add a modifer like alt, so u need to hold alt down whilst dragging to
  * actually drag the button around
  */
  __ACLASS __BGN
    __NAME ACTION_BUTTON_DRAG
    __TOOLTIP_TEXT "Click and drag to move desktop"
    __TOOLTIP_TEXT "(on any desktop but desktop 0)"
    __TYPE __TYPE_NORMAL
    __ALLOW_ANY_BUTTON __ON
    __ALLOW_ANY_MODIFIER_KEYS __ON
    __ALLOW_ANY_KEY __ON
    __EVENT __MOUSE_PRESS
    __ACTION __A_DRAG_BUTTON
  __END

  /*
  ******************************************************************************
  * Actionclasses for buttons
  ******************************************************************************
  */

  /*
  ******************************************************************************
  * The only new action I want is a minor modification of ACTION_MOVE.
  * Specifically, I want middle button to iconify rather than shade
  * As per the README from rasterman, it is named CUSTOM_THEME_something
  ******************************************************************************
  */

  __ACLASS __BGN
    __NAME CUSTOM_THEME_ACTION_MOVE
    __TOOLTIP_TEXT "Move"
    __TYPE __TYPE_NORMAL
    __TOOLTIP_ACTION_TEXT "Move this window."
    __EVENT __MOUSE_PRESS
    __BUTTON 1
    __ACTION __A_MOVE
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Iconify (Minimize) this window."  <---
    __EVENT __MOUSE_PRESS                                    <---
    __BUTTON 2                                               <---
    __ACTION __A_ICONIFY                                     <---
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Show the Window Options menu."
    __EVENT __MOUSE_PRESS
    __BUTTON 3
    __ACTION __A_SHOW_MENU "named WINOPS_MENU"
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Go Back a Desktop"
      __EVENT __MOUSE_PRESS
      __BUTTON 4
      __ALLOW_ANY_MODIFIER_KEYS __ON
      __ACTION __A_DESKTOP_PREV
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Go Forward a Desktop"
      __EVENT __MOUSE_PRESS
      __BUTTON 5
      __ALLOW_ANY_MODIFIER_KEYS __ON
      __ACTION __A_DESKTOP_NEXT
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Toggle the shaded (rolled-up) state of this window."
    __EVENT __DOUBLE_CLICK
    __ALLOW_ANY_BUTTON __ON
    __ACTION __A_SHADE
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Show/Hide group borders."
    __EVENT __MOUSE_PRESS
    __BUTTON 2
    __MODIFIER_KEY __SHIFT
    __ACTION __A_SHOWHIDE_GROUP
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Start a group."
    __EVENT __MOUSE_PRESS
    __BUTTON 1
    __MODIFIER_KEY __SHIFT
    __ACTION __A_START_GROUP
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Add to current group."
    __EVENT __MOUSE_PRESS
    __BUTTON 1
    __MODIFIER_KEY __CTRL
    __ACTION __A_ADD_TO_GROUP
    __NEXT_ACTION
    __TOOLTIP_ACTION_TEXT "Break this window's group."
    __EVENT __MOUSE_PRESS
    __BUTTON 1
    __MODIFIER_KEY __CTRL_SHIFT
    __ACTION __A_BREAK_GROUP
  __END



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]