diff --git a/src/activities/server/components/CommandBar.qml b/src/activities/server/components/CommandBar.qml new file mode 100644 index 000000000..df08b6bad --- /dev/null +++ b/src/activities/server/components/CommandBar.qml @@ -0,0 +1,33 @@ +import QtQuick 2.9 +import assets 1.0 + +Item { + property alias commandList: commandRepeater.model + + anchors { + left: parent.left + bottom: parent.bottom + right: parent.right + } + height: Style.heightCommandBar + + Rectangle { + anchors.fill: parent + color: Style.colourCommandBarBackground + + Row { + anchors { + top: parent.top + bottom: parent.bottom + right: parent.right + } + + Repeater { + id: commandRepeater + delegate: CommandButton { + command: modelData + } + } + } + } +} diff --git a/src/activities/server/components/CommandButton.qml b/src/activities/server/components/CommandButton.qml new file mode 100644 index 000000000..e36bd060f --- /dev/null +++ b/src/activities/server/components/CommandButton.qml @@ -0,0 +1,66 @@ +import QtQuick 2.9 +import CM 1.0 +import assets 1.0 + +Item { + property Command command + width: Style.widthCommandButton + height: Style.heightCommandButton + + Rectangle { + id: background + anchors.fill: parent + color: Style.colourCommandBarBackground + + Text { + id: textIcon + anchors { + centerIn: parent + verticalCenterOffset: -10 + } + font { + family: Style.fontAwesome + pixelSize: Style.pixelSizeCommandBarIcon + } + color: command.ui_canExecute ? Style.colourCommandBarFont : colourCommandBarFontDisabled + text: command.ui_iconCharacter + horizontalAlignment: Text.AlignHCenter + } + + Text { + id: textDescription + anchors { + top: textIcon.bottom + bottom: parent.bottom + left: parent.left + right: parent.right + } + font.pixelSize: Style.pixelSizeNavigationBarText + color: command.ui_canExecute ? Style.colourCommandBarFont : colourCommandBarFontDisabled + text: command.ui_description + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + onEntered: background.state = "hover" + onExited: background.state = "" + onClicked: if(command.ui_canExecute) { + command.executed(); + } + } + + states: [ + State { + name: "hover" + PropertyChanges { + target: background + color: Qt.darker(Style.colourCommandBarBackground) + } + } + ] + } +} diff --git a/src/activities/server/components/qmldir b/src/activities/server/components/qmldir new file mode 100644 index 000000000..6a34ad711 --- /dev/null +++ b/src/activities/server/components/qmldir @@ -0,0 +1,5 @@ +module components +NavigationButton 1.0 NavigationButton.qml +NavigationBar 1.0 NavigationBar.qml +CommandButton 1.0 CommandButton.qml +CommandBar 1.0 CommandBar.qml diff --git a/src/activities/server/views/CreateClientView.qml b/src/activities/server/views/CreateClientView.qml index 96a00d179..9a71bc7fe 100644 --- a/src/activities/server/views/CreateClientView.qml +++ b/src/activities/server/views/CreateClientView.qml @@ -1,13 +1,20 @@ import QtQuick 2.0 import "../../../core" +import components 1.0 + Item { Rectangle { anchors.fill: parent color: Style.colourBackground Text { anchors.centerIn: parent - text: "Createclient View" + text: "CreateClient View" } } + + + CommandBar { + + } }