paysages3d/src/interface/modeler/quickapp/qml/Toolbar.qml

32 lines
886 B
QML
Raw Normal View History

2014-08-27 15:23:59 +00:00
import QtQuick 2.0
BaseRectangle {
2014-08-27 15:23:59 +00:00
default property alias children : inner_space.children
2015-08-19 23:15:08 +00:00
property bool horizontal: false
width: horizontal ? parent.width : 60
height: horizontal ? 60 : parent.height
2014-08-28 08:29:12 +00:00
color: "#50888888"
2014-08-27 15:23:59 +00:00
2015-08-19 23:15:08 +00:00
Grid {
2014-08-27 15:23:59 +00:00
id: inner_space
2015-08-19 23:15:08 +00:00
columns: parent.horizontal ? children.length : 1
rows: parent.horizontal ? 1 : children.length
spacing: (parent.horizontal ? (parent.width - children.length * tool_terrain.width) : (parent.height - children.length * tool_terrain.height)) / (children.length + 1)
2014-08-27 15:23:59 +00:00
anchors.centerIn: parent
}
2014-08-28 13:09:47 +00:00
onEnabledChanged: {
if (!enabled)
{
for (var i = 0; i < children.length; i++)
{
2015-08-20 22:25:34 +00:00
if (!children[i].toggle)
{
children[i].selected = false;
}
2014-08-28 13:09:47 +00:00
}
}
}
2014-08-27 15:23:59 +00:00
}