2014-08-27 15:23:59 +00:00
|
|
|
import QtQuick 2.0
|
2015-08-28 09:40:35 +00:00
|
|
|
import QtQuick.Controls 1.2
|
2014-08-27 15:23:59 +00:00
|
|
|
|
2015-08-18 16:22:16 +00:00
|
|
|
BaseRectangle {
|
2014-08-27 15:23:59 +00:00
|
|
|
|
2015-08-28 09:40:35 +00:00
|
|
|
id: toolbar
|
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
|
2015-08-23 22:39:31 +00:00
|
|
|
property list<BasePanel> panels
|
2015-08-28 09:40:35 +00:00
|
|
|
property var current
|
2015-08-19 23:15:08 +00:00
|
|
|
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-28 09:40:35 +00:00
|
|
|
ExclusiveGroup {
|
|
|
|
id: exclusive_checked
|
|
|
|
}
|
|
|
|
|
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
|
2015-08-28 09:40:35 +00:00
|
|
|
|
|
|
|
onChildrenChanged: {
|
|
|
|
for (var i = 0; i < children.length; ++i)
|
|
|
|
{
|
|
|
|
children[i].toolbar = toolbar;
|
|
|
|
if (!children[i].toggle)
|
|
|
|
{
|
|
|
|
children[i].exclusiveGroup = exclusive_checked;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-08-27 15:23:59 +00:00
|
|
|
}
|
|
|
|
}
|