diff --git a/Gui/Employees/EmployeesTable.qml b/Gui/Employees/EmployeesTable.qml index 53dfcd8..d9fd007 100644 --- a/Gui/Employees/EmployeesTable.qml +++ b/Gui/Employees/EmployeesTable.qml @@ -58,85 +58,85 @@ ColumnLayout { onClicked: contentStack.push("AddEmployee.qml") } } - HorizontalHeaderView { - Layout.fillWidth: true - implicitHeight: 40 - movableColumns: true //@disable-check M16 - syncView: appliEmpTable - - delegate: Rectangle { - Layout.fillWidth: true - border.color: palette.base - color: palette.alternateBase - implicitHeight: 40 - implicitWidth: 1 - - Text { - color: palette.text - elide: Text.ElideRight - height: parent.height - horizontalAlignment: Text.AlignHCenter - text: model.display - verticalAlignment: Text.AlignVCenter - width: parent.width - } - } - } - TableView { - id: appliEmpTable - + ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true - alternatingRows: true - columnSpacing: 1 - model: employee_model - resizableColumns: true - rowSpacing: 2 - selectionBehavior: TableView.SelectRows - z: 1 + spacing: 2 - ScrollBar.vertical: ScrollBar { - policy: appliEmpTable.contentHeight > appliEmpTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - } - delegate: Rectangle { - required property bool current - required property bool selected + HorizontalHeaderView { + movableColumns: true + syncView: employeesTable - color: selected ? palette.highlight : (appliEmpTable.alternatingRows && row % 2 !== 0 ? palette.base : palette.alternateBase) - implicitHeight: 25 - implicitWidth: appliEmpTable.width / appliEmpTable.columns + delegate: Rectangle { + Layout.fillWidth: true + color: Colors.primary + implicitHeight: 33 + implicitWidth: 1 - Text { - color: palette.text - elide: Text.ElideRight - height: parent.height - leftPadding: 9 - text: (model.display === null || model.display === undefined) ? "" : model.display - verticalAlignment: Text.AlignVCenter - width: parent.width - } - MouseArea { - property bool hovered: false - - anchors.fill: parent - hoverEnabled: true - - onDoubleClicked: { - contentStack.push("EmployeeDetails.qml", { - selectedEmployee: row - }); - } - onEntered: { - appliEmpTable.selectionModel.select(appliEmpTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows); + Text { + color: Colors.primaryContrast + elide: Text.ElideRight + font: Typography.smallBold + height: parent.height + horizontalAlignment: Text.AlignLeft + padding: Dimensions.s + text: model.display + verticalAlignment: Text.AlignVCenter + width: parent.width } } } - selectionModel: ItemSelectionModel { - model: appliEmpTable.model + TableView { + id: employeesTable + + Layout.fillHeight: true + Layout.fillWidth: true + columnSpacing: 2 + model: employee_model + resizableColumns: true + rowSpacing: 2 + selectionBehavior: TableView.SelectRows + z: 1 + + ScrollBar.vertical: ScrollBar { + policy: ScrollBar.AsNeeded + } + delegate: Rectangle { + required property bool selected + + color: selected ? Colors.primaryHighlight : Colors.transparent + implicitHeight: 33 + implicitWidth: employeesTable.width / employeesTable.columns + + Text { + color: Colors.foreground + elide: Text.ElideRight + font: Typography.small + height: parent.height + padding: Dimensions.s + text: (model.display === null || model.display === undefined) ? "" : model.display + verticalAlignment: Text.AlignVCenter + width: parent.width + } + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + + onClicked: { + contentStack.push("EmployeeDetails.qml", { + selectedEmployee: row + }); + } + onEntered: { + employeesTable.selectionModel.select(employeesTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows); + } + } + } + selectionModel: ItemSelectionModel { + model: employeesTable.model + } } } - Item { - Layout.fillWidth: true - } } diff --git a/TeroStyle/BarButton.qml b/TeroStyle/BarButton.qml index 7243d3c..6439374 100644 --- a/TeroStyle/BarButton.qml +++ b/TeroStyle/BarButton.qml @@ -29,7 +29,7 @@ T.ToolButton { } Label { color: parent.color - font: Typography.small + font: Typography.smaller text: control.text x: parent.width * .5 - width * .5 } diff --git a/TeroStyle/Colors.qml b/TeroStyle/Colors.qml index 6331749..7d8a7d4 100644 --- a/TeroStyle/Colors.qml +++ b/TeroStyle/Colors.qml @@ -12,6 +12,7 @@ QtObject { readonly property color primaryContrast: "#fdfdfd" readonly property color primaryLighter: Qt.lighter(primary, 1.5) readonly property color primaryShade: theme === dark ? primaryLighter : Qt.darker(primary, 1.5) + readonly property color primaryHighlight: theme === dark ? Qt.darker(primary, 2- Colors.highlightOpacity) : Qt.lighter(primary, 2- Colors.highlightOpacity) readonly property color foreground: theme === dark ? "#fdfdfd" : "#110b0c" readonly property color background: theme === dark ? "#303136" : "#eff1f5" readonly property color mantle: theme === dark ? "#1E1E23" : "#e7e9ef" diff --git a/TeroStyle/Typography.qml b/TeroStyle/Typography.qml index ae12c22..a5fe7fc 100644 --- a/TeroStyle/Typography.qml +++ b/TeroStyle/Typography.qml @@ -11,7 +11,25 @@ Item { letterSpacing: 0, kerning: true }) + readonly property font small: ({ + family: body.family, + pointSize: 14, + weight: Font.Medium, + letterSpacing: body.letterSpacing, + kerning: body.kerning + }) + + + readonly property font smallBold: ({ + family: small.family, + pointSize: small.pointSize, + weight: Font.Bold, + letterSpacing: small.letterSpacing, + kerning: small.kerning + }) + + readonly property font smaller: ({ family: body.family, pointSize: 11, weight: Font.DemiBold,