Add a GUI_FORCE_WIDGET_MINIMUM_SIZE macro.

This way it's possible to force the (minimum) size of a widget.
This commit is contained in:
Mark de Wever 2009-07-12 16:13:05 +00:00
parent 3cdc96164e
commit f137241df0

View file

@ -150,6 +150,72 @@
#enddef
# Forces a wiget to be of a certain size.
# Depending of the flags of the parent widget the item will grow
#
# WIDTH Minimum width for the widget.
# HEIGHT Minimum height for the widget.
# WIDGET The widget to add into the item.
#
# eg instead of
# [label]
# # Note Foo has trailing spaces to force extra width.
# label = "
# Foo
# "
# [label]
# you can do:
#
# {GUI_FORCE_WIDGET_MINIMUM_SIZE 150 75 (
# [label]
# label = "Foo"
# [label]
# )}
#
#define GUI_FORCE_WIDGET_MINIMUM_SIZE WIDTH HEIGHT WIDGET
[stacked_widget]
definition = "default"
[stack]
[layer]
[row]
[column]
[spacer]
definition = "default"
width = "{WIDTH}"
height = "{HEIGHT}"
[/spacer]
[/column]
[/row]
[/layer]
[layer]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = "true"
vertical_grow = "true"
{WIDGET}
[/column]
[/row]
[/layer]
[/stack]
[/stacked_widget]
#enddef
###############################################################################
### ###
### Macros for the tiny gui. ###