Add position arguments for menus

...utilizing x,y coordinates where values can be a number, a negative
number, a percentage or "center".

- (0,0) is top left corner
- (-0,-0) is bottom right corner
- % is percentage of width and/or height
- 'center' centers the menu vertically and/or horizontally

    <action name="ShowMenu">
      <menu>root-menu</menu>
      <position>
        <x>0</x>
        <y>0</y>
      </position>
    </action>

Note: both x and y values must be supplied for positioning to work.
This commit is contained in:
Droc 2024-09-05 07:52:23 -05:00 committed by Johan Malm
parent f3b2766892
commit 8850368ab9
2 changed files with 78 additions and 2 deletions

View file

@ -123,6 +123,17 @@ Actions are used in menus and keyboard/mouse bindings.
upper-left corner of the window associated with the action. Default is
yes.
*position* Show the menu in the specified position on the monitor
that has cursor focus, see below.
The position tag has two sub-tags. <x> and <y> specify a position and
take either a pixel value, the string "center" which will center the
menu in that dimension, or a relative value specified as a percentage
A relative value is interpreted in terms of the monitor the menu will
be shown on, and will be relative to the left/top edge of the menu
window and monitor for positive values, and to the right/bottom edge
for negative values.
*<action name="SetDecorations" decorations="value" forceSSD="no" />*
Set decorations of focused window.