Another feature request

8 messages - 1152 views

In another thread I just said that it would be nice to be able to modify the top and/or bottom bar of the screen widget. But just realised that it would actually be enough that I could turn the top and bottom bars off completely.. I know I can set their styles so that they are in essence invisible, but just a simple way to turn them off would be nice so that they aren't created etc. Maybe have like topbar="false|true" bottombar="false|true" in the xml definition of the screen.. That way I could turn them off and just create my own bars in the xml. Like this:

<screen topbar="false" style="layout:borderlayout">
    <container id="topbar" style="layout-data:bld(north)">
    </container>
    <container id="desktop">
    </container>
</screen>

Hi,

I'm not sure to understand but, if the attribute title is not define for the screen, the topbar isn't displayed. so it will be an equivalent to topbar="false". As the bottombar isn't displayed when firstmenu or secondmenu widget are not set. However you cannot switch them displayable or not like you could do with a boolean attribute.

This is not actually completely true.. If I don't define the title attribute for the screen, the topbar is still displayed.. Or at least some of it, depending on the style it has. Or at least in my application the topbar is still visible after removing title attribute. I guess it shows the amount that is defined as padding for the topbar.

Yes, actually the TopBar is created even if there's no title. And you can hide it only via styles, else padding margin, etc will be visible.

I proposed to add a new way to acces to internal widgets like the topBar for the Screen :

<screen title="MyTitle">

    <topbar><picture src="icon.png" style="layout-data:sld(right,-1,-1)"/></topbar>

</screen>

In this example <topbar> do not create a new widget instance but it retrieve the internel screen topbar widget instance. And then use it as normal widget to add the picture child.

Caution : TopBar layout is fixed to StaticLayout and can't be changed.

In the same way you can acces to bottomBar on a Screen widget.

I think it might be a good idea to be able to disable the topbar altogether. That way I could draw the topbar by using widgets as I see fit. For example if I wan't to have an icon on the left, then the title and on the right another icon or something similar. The bottombar I understand that it has to be bound to the screen a bit more tightly as it displays the menus, but the topbar has no apparent function which would require it to be bound that tightly to the screen widget.

In the new solution, the topBar is not created by default. It is created only if a title is set, or if a tag <topBar> is present.

In this way you can customize as you want the topBar (and bottomBar) if you use the <topbar> tag. Title attribute and <topbar> tag could be used together but you can use an other Text widget to display a title.

The only one restriction is that the topBar (and bottomBar) layout is a StaticLayout and can't be changed because of internal managment of title, firstMenu and secondMenu. But staticLayout is enouth flexible to what ever you want, like put a full size container with an other layout ...

Aah.. Yes.. Sound excellent. Just what I needed. Thanks.

Try to switch to 1.0.0RC2