Qt-Secret/Qt-Secret-GUI/modules/EncryptDecryptMenu.qml

43 lines
868 B
QML
Raw Normal View History

import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
RowLayout {
id: encryptDecryptMenu
2019-07-30 21:55:17 +03:00
property double verticalSize: 0.1
property bool encryptState: true
signal changeState()
signal getEncrypDecrypt()
spacing: 20
Layout.minimumHeight: 50
Layout.fillWidth: true
2019-07-30 21:55:17 +03:00
Layout.maximumHeight: parentItem.height * verticalSize
RadioButton {
text: qsTr("Encryption")
2019-07-30 21:55:17 +03:00
checked: true
onToggled: {
encryptState = true
changeState()
}
}
RadioButton {
text: qsTr("Decryption")
2019-07-30 21:55:17 +03:00
onToggled: {
encryptState = false
changeState()
}
}
2019-07-30 21:55:17 +03:00
Button {
id: processButton
text: (encryptDecryptMenu.encryptState ? qsTr("Encrypt") : qsTr("Decrypt"))
onClicked: getEncrypDecrypt()
2019-07-30 21:55:17 +03:00
}
}