Compare commits

..

No commits in common. "45c12ed2bba2a7c2d32d4169e6b378a1e1a5b367" and "392d993c8a18aaab6a8bd22146e0d5bba74c2a1e" have entirely different histories.

4 changed files with 14 additions and 191 deletions

View File

@ -13,7 +13,6 @@ qt_add_qml_module(${PROJECT_NAME}
mnemonicattached.cpp mnemonicattached.h mnemonicattached.cpp mnemonicattached.h
QML_FILES QML_FILES
ErrorNotification.qml ErrorNotification.qml
Expander.qml
LoginPage.qml LoginPage.qml
Main.qml Main.qml
MnemonicAction.qml MnemonicAction.qml

View File

@ -67,7 +67,6 @@ Control {
text: qsTr("Close") text: qsTr("Close")
onClicked: function () { onClicked: function () {
hideTimer.stop();
control.visible = false; control.visible = false;
} }
} }

View File

@ -1,93 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Shapes
Control {
id: control
default property alias contentData: pane.contentData
property alias expanded: pane.visible
property string title
clip: true
implicitHeight: triangle.implicitHeight + (expanded ? pane.implicitHeight : 0)
implicitWidth: Math.max(triangle.implicitWidth, pane.implicitWidth)
Behavior on implicitHeight {
NumberAnimation {
duration: 200
}
}
ToolButton {
id: triangle
Mnemonic.label: control.title
anchors.left: parent.left
anchors.top: parent.top
text: Mnemonic.richTextLabel
contentItem: Row {
spacing: 4
Shape {
anchors.verticalCenter: parent.verticalCenter
height: 8
rotation: control.expanded ? 90 : 0
width: 8
Behavior on rotation {
NumberAnimation {
duration: 200
}
}
ShapePath {
fillColor: "transparent"
startX: 2
startY: 0
strokeColor: triangle.palette.buttonText
strokeWidth: 1
PathLine {
x: 6
y: 4
}
PathLine {
x: 2
y: 8
}
}
}
Label {
anchors.verticalCenter: parent.verticalCenter
color: triangle.palette.buttonText
font: triangle.font
text: triangle.text
}
}
onClicked: function () {
control.expanded = !control.expanded;
}
Shortcut {
sequence: triangle.Mnemonic.sequence
onActivated: function () {
triangle.click();
}
}
}
Pane {
id: pane
anchors.left: parent.left
anchors.top: triangle.bottom
padding: 0
visible: false
}
}

View File

@ -9,13 +9,7 @@ Page {
title: qsTr("Login") title: qsTr("Login")
ColumnLayout { ColumnLayout {
anchors.centerIn: parent
GridLayout {
columns: 2
MnemonicLabel { MnemonicLabel {
Layout.alignment: Qt.AlignRight
buddy: user buddy: user
mnemonic: qsTr("&User:") mnemonic: qsTr("&User:")
} }
@ -23,14 +17,10 @@ Page {
TextField { TextField {
id: user id: user
Layout.fillWidth: true
focus: true focus: true
onAccepted: loginAction.trigger()
} }
MnemonicLabel { MnemonicLabel {
Layout.alignment: Qt.AlignRight
buddy: password buddy: password
mnemonic: qsTr("&Password:") mnemonic: qsTr("&Password:")
} }
@ -38,82 +28,10 @@ Page {
TextField { TextField {
id: password id: password
Layout.fillWidth: true
echoMode: TextInput.Password echoMode: TextInput.Password
onAccepted: loginAction.trigger()
}
}
Expander {
Layout.fillWidth: true
Layout.topMargin: 8
title: qsTr("&Advanced options")
GridLayout {
columns: 2
MnemonicLabel {
Layout.alignment: Qt.AlignRight
buddy: hostName
mnemonic: qsTr("&Host name:")
}
TextField {
id: hostName
Layout.fillWidth: true
onAccepted: loginAction.trigger()
}
MnemonicLabel {
Layout.alignment: Qt.AlignRight
buddy: port
mnemonic: qsTr("Por&t:")
}
SpinBox {
id: port
Layout.fillWidth: true
editable: true
from: 1
to: 65535
}
MnemonicLabel {
Layout.alignment: Qt.AlignRight
buddy: databaseName
mnemonic: qsTr("&Database name:")
}
TextField {
id: databaseName
Layout.fillWidth: true
onAccepted: loginAction.trigger()
}
MnemonicLabel {
Layout.alignment: Qt.AlignRight
buddy: connectOptions
mnemonic: qsTr("&Options:")
}
TextField {
id: connectOptions
Layout.fillWidth: true
onAccepted: loginAction.trigger()
}
}
} }
Button { Button {
Layout.alignment: Qt.AlignRight
action: loginAction action: loginAction
} }
} }