| 
									
										
										
										
											2019-04-27 18:00:28 -04:00
										 |  |  | import QtQuick 2.7 | 
					
						
							|  |  |  | import QtQuick.Controls 2.2 | 
					
						
							|  |  |  | import QtQuick.Layouts 1.4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | HScalingBox { | 
					
						
							|  |  |  |     id: interfaceBox | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     property alias title: interfaceTitle.text | 
					
						
							|  |  |  |     property alias buttonModel: interfaceButtonsRepeater.model | 
					
						
							|  |  |  |     property var buttonCallbacks: [] | 
					
						
							|  |  |  |     property string enterButtonTarget: "" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     default property alias body: interfaceBody.children | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function clickEnterButtonTarget() { | 
					
						
							|  |  |  |         for (var i = 0; i < buttonModel.length; i++) { | 
					
						
							|  |  |  |             var btn = interfaceButtonsRepeater.itemAt(i) | 
					
						
							|  |  |  |             if (btn.name === enterButtonTarget) { btn.clicked() } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-28 12:47:51 -04:00
										 |  |  |     HColumnLayout { | 
					
						
							| 
									
										
										
										
											2019-04-27 18:00:28 -04:00
										 |  |  |         anchors.fill: parent | 
					
						
							|  |  |  |         id: mainColumn | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         HRowLayout { | 
					
						
							|  |  |  |             Layout.alignment: Qt.AlignHCenter | 
					
						
							|  |  |  |             Layout.margins: interfaceBox.margins | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             HLabel { | 
					
						
							|  |  |  |                 id: interfaceTitle | 
					
						
							|  |  |  |                 font.pixelSize: HStyle.fontSize.big | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-27 21:07:20 -04:00
										 |  |  |         Item { Layout.fillHeight: true } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-28 12:47:51 -04:00
										 |  |  |         HColumnLayout { id: interfaceBody } | 
					
						
							| 
									
										
										
										
											2019-04-27 18:00:28 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-27 21:07:20 -04:00
										 |  |  |         Item { Layout.fillHeight: true } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-27 18:00:28 -04:00
										 |  |  |         HRowLayout { | 
					
						
							|  |  |  |             Repeater { | 
					
						
							|  |  |  |                 id: interfaceButtonsRepeater | 
					
						
							|  |  |  |                 model: [] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 HButton { | 
					
						
							|  |  |  |                     property string name: modelData.name | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     id: button | 
					
						
							|  |  |  |                     text: modelData.text | 
					
						
							|  |  |  |                     iconName: modelData.iconName || "" | 
					
						
							|  |  |  |                     onClicked: buttonCallbacks[modelData.name](button) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     Layout.fillWidth: true | 
					
						
							|  |  |  |                     Layout.preferredHeight: 32 | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |