Suggestion : allow aligning buttons in standard window actions frame

Hi
Sometimes we want them on the left (which is by default), but If we want to align them on center or right, we need to include the frame in a hbox and act on the hbox alignment.
I understand that frame is a static container, but the generated made-in frame ‘windowactions’ could put the buttons in a hbox inside itself so that we can change buttons alignment.
Mike

Strange : once you have put the windowActions in a hbox, then remove it from the hbox and put it back in the root layout, suddenly setting the alignment on windowActions frame works.

Hi,

When you adjust the align setting of the windowActions frame, you adjust its position on the layout. But when it has width = 100% and height = 100% it takes all the available space, so that is why you do not notice the changes.


<layout expand="windowActions"
            spacing="true">
        ....
        <frame id="windowActions"
               align="MIDDLE_CENTER"
               screen="editWindowActions"></frame>
    </layout>

If to specify a fixed size of the frame its align becomes noticeable.


<layout spacing="true">
       ...
        <frame id="windowActions"
               align="TOP_RIGHT"
               height="100px"
               screen="editWindowActions"
               width="200px"></frame>
    </layout>

But there is a better way to change buttons alignment.
You can extend the editWindowActions frame. Specify align for the hbox. And use the custom frame on your screens instead of default windowActions.
Descriptor:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        class="com.company.untitled.web.newentity.RightEwaScreen"
        extends="/com/haulmont/cuba/gui/edit-window.actions.xml"
        messagesPack="com.company.untitled.web.newentity">
    <layout>
        <hbox align="TOP_RIGHT">
            <button id="windowCommit"></button>
            <button id="windowClose"></button>
        </hbox>
    </layout>
</window>

Part of screens.xml:


<screen-config xmlns="http://schemas.haulmont.com/cuba/screens.xsd">
    <include file="com/company/untitled/screens.xml"></include>
....
    <screen id="right-editWindowActions"
            template="com/company/untitled/web/newentity/right_ewa_screen.xml"></screen>
</screen-config>

Screen controller:


<layout spacing="true">
...
        <frame id="windowActions"
               align="TOP_RIGHT"
               screen="right-editWindowActions"></frame>
    </layout>

Great, thanks Rostislav