readonly property real widthNavigationBarCollapsed: widthNavigationButtonIcon
readonly property real widthNavigationBarExpanded: widthNavigationButton
+ readonly property color colourCommandBarBackground: "#cecece"
+ readonly property color colourCommandBarFont: "#131313"
+ readonly property color colourCommandBarFontDisabled: "#636363"
+ readonly property real heightCommandBar: heightCommandButton
+ readonly property int pixelSizeCommandBarIcon: 32
+ readonly property int pixelSizeCommandBarText: 12
+
+ readonly property real widthCommandButton: 80
+ readonly property real heightCommandButton: widthCommandButton
+
property alias fontAwesome: fontAwesomeLoader.name
}
<file alias="qmldir">components/qmldir</file>
<file alias="NavigationButton.qml">components/NavigationButton.qml</file>
<file alias="NavigationBar.qml">components/NavigationBar.qml</file>
+ <file alias="CommandBar.qml">components/CommandBar.qml</file>
+ <file alias="CommandButton.qml">components/CommandButton.qml</file>
</qresource>
</RCC>
--- /dev/null
+import QtQuick 2.10
+import assets 1.0
+import components 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
+ }
+ }
+ }
+ }
+
+}
--- /dev/null
+import QtQuick 2.10
+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 : Style.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.pixelSizeCommandBarText
+ color: command.ui_canExecute ? Style.colourCommandBarFont : Style.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)
+ }
+ }
+ ]
+ }
+
+}
module components
NavigationButton 1.0 NavigationButton.qml
NavigationBar 1.0 NavigationBar.qml
+CommandBar 1.0 CommandBar.qml
+CommandButton 1.0 CommandButton.qml
import QtQuick 2.10
import assets 1.0
+import components 1.0
Item {
Rectangle {
anchors.fill: parent
color: Style.colourBackground
+ CommandBar {
+ commandList: masterController.ui_commandController.ui_createClientViewContextCommands
+ }
+
Text {
anchors.centerIn: parent
text: "Create Client View"