Skip to content

Commit

Permalink
Refs #2. Updated visuals of the Dashboard Selector screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
SBriere committed Mar 18, 2024
1 parent df39bd1 commit f5c8791
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Frontend/DashboardsViewer/DashboardsViewer.qmlproject.qtds
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtDesignStudio 4.4.0, 2024-03-11T08:06:35. -->
<!-- Written by QtDesignStudio 4.4.0, 2024-03-15T13:33:11. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
14 changes: 6 additions & 8 deletions Frontend/DashboardsViewer/content/App.qml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 6.2
import QtQuick.VirtualKeyboard 6.2
import QtQuick.Controls 6.2

import DashboardsViewer
import "screens"
import "ui"

import DashboardsViewer.ConfigParser 1.0
import OpenTeraLibs.UserClient 1.0
Expand Down Expand Up @@ -56,16 +54,16 @@ Window {
color: "white"
}



//Logout button
Button {
BasicButton {
id: logoutButton
text: "Logout"
anchors.right: parent.right
anchors.top: parent.top
anchors.verticalCenter: parent.verticalCenter
color: "darkred"
hoverColor: "red"
width: 100
height: parent.height
//height: parent.height
onClicked: {
UserClient.disconnect();
}
Expand Down
12 changes: 9 additions & 3 deletions Frontend/DashboardsViewer/content/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ qt6_add_qml_module(content
dataSources/ParticipantSessionListDataSource.qml
# Delegates
delegates/BaseDelegate.qml
delegates/ParticipantDelegate.qml
delegates/SessionDelegate.qml
delegates/SiteProjectDelegate.qml
delegates/DashboardDelegate.qml
delegates/GenericItemDelegate.qml
delegates/ParticipantDelegate.qml
delegates/SessionDelegate.qml

RESOURCES
fonts/Arimo-VariableFont_wght.ttf

images/logos/LogoOpenTera.png

images/icons/dashboard.png
images/icons/project.png
images/icons/site.png

)
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Item {
var reply = UserClient.get(url, params);

reply.requestSucceeded.connect(function(response, statusCode) {
console.log("Success", response, statusCode);
//console.log("Success", response, statusCode);

//Make sure model is empty
myModel.clear();

//Print number of elements
console.log("Number of elements: ", response.length);
//console.log("Number of elements: ", response.length);

//Add session
response.forEach(function(item) {
Expand Down
81 changes: 81 additions & 0 deletions Frontend/DashboardsViewer/content/delegates/DashboardDelegate.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Effects
import QtQuick.Layouts
import DashboardsViewer 1.0

Item {
width: GridView.view.cellWidth - 10
height: mainLayout.implicitHeight + 10 //GridView.view.cellHeight - 10

signal itemClicked(var id, var definition)

states: [
State {
name: "hover"
when: mouseZone.containsMouse && enabled
PropertyChanges {
target: recBackground
color: "#44ffffff"
}
}
]

MouseArea {
id: mouseZone
anchors.fill: parent
propagateComposedEvents: true
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: function(){
//console.log("Click! " + model.id + " - " + model.definition);
itemClicked(model.id, model.definition);
}
}
Rectangle{
id: recBackground
anchors.fill: parent
radius: 5
color: "transparent"
}

ColumnLayout{
id: mainLayout
anchors.fill: parent
anchors.margins: 5
spacing: 5

Item{
height: imgDashboard.height
Layout.fillWidth: true

Image{
id: imgDashboard
anchors.centerIn: parent
source: "../images/icons/dashboard.png"
fillMode: Image.PreserveAspectFit
height: 64
}
MultiEffect{
source: imgDashboard
anchors.fill: source
shadowEnabled: true
shadowScale: 0.90
}
}

Text {
Layout.fillWidth: true
Layout.fillHeight: true
text: model.name
color: model.color //Constants.textColor
font.pixelSize: Constants.smallFontSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignTop
wrapMode: Text.WordWrap
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
style: Text.Outline
font.bold: true
}
}
}

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Frontend/DashboardsViewer/content/screens/Dashboard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Item {

Button {
id: closeButton
anchors.left: loadButton.right
anchors.left: parent.left
anchors.top: parent.top
width: 150
height: 60
Expand Down
Loading

0 comments on commit f5c8791

Please sign in to comment.