News:

SimuTranslator
Make Simutrans speak your language.

Something fishy with borderless items.

Started by prissi, December 07, 2020, 02:27:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prissi

Let's take the convoi details as example. Currently the convoi_detail_t element gets an extra margin, compared to the buttons before, which are after an add_table call.

So if I set the margins of the outer container container_details to zero, the buttons are indeed at zero. Even thought he buttons are inside a table.
However, even if I add explictely an extra component, the padding will not added. Even if I set the margins for that extrat table by hand.

So it seems calling set?margin on a gui_aligned_contianer DOES NOT set the maregins of said container. Rather is sets the margin for a objects in it. So it is very hard to achieve a uniform formatiing in sub_object (liek gui_scheduel or gui_vehicleinfo_t) which are indside such things, because they get extra padding.

Dwachs

Nested tables will get zero margin by default, see gui_aligned_container_t::add_component. I do not know why the details container gets some extra margin. Will look into this tonight.
Parsley, sage, rosemary, and maggikraut.

Dwachs

I do not understand your request. The elements in the convoy-detail tab are perfectly aligned to the left. All elements (besides the tab panel heads) have the same margin on the left.
Parsley, sage, rosemary, and maggikraut.

prissi

If I set the last element to be without borders, all elements have zero borders. However, it does no occur right now any more.

Thank you, you explanation was quite helpful.

So for marginless componenets (which are those which display a scrollbar, the inside tables need an explicit call to add_tabel(,)->sset_margin( scr_size(D_MARGIN_LEFT,0), scr_size(D_MARGIN_RIGHT,0) ); to have the same border than the elements in the scroll pane.