moment/src/qml/Base/HInterfaceBox.qml
miruka 519d3610ef Change HTextField borders, SignIn disable buttons
By default now, fields have a transparent border if not focused and
accent-color border if focused.
Set `bordered: false` for no border at all.

The register and forgot buttons on the SignIn screen are now disabled,
since their functions aren't implemented yet.
2019-07-18 20:39:13 -04:00

65 lines
1.6 KiB
QML

// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Layouts 1.12
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 (let i = 0; i < buttonModel.length; i++) {
let btn = interfaceButtonsRepeater.itemAt(i)
if (btn.name === enterButtonTarget) { btn.clicked() }
}
}
HColumnLayout {
anchors.fill: parent
id: mainColumn
HRowLayout {
Layout.alignment: Qt.AlignHCenter
Layout.margins: interfaceBox.margins
HLabel {
id: interfaceTitle
font.pixelSize: theme.fontSize.big
}
}
HSpacer {}
HColumnLayout { id: interfaceBody }
HSpacer {}
HRowLayout {
Repeater {
id: interfaceButtonsRepeater
model: []
HUIButton {
property string name: modelData.name
id: button
text: modelData.text
iconName: modelData.iconName || ""
enabled: modelData.enabled === false ? false : true
onClicked: buttonCallbacks[modelData.name](button)
Layout.fillWidth: true
Layout.preferredHeight: theme.avatar.size
}
}
}
}
}