diff --git a/android-sources/AndroidManifest.xml b/android-sources/AndroidManifest.xml index d6d2aa8..7b7d720 100644 --- a/android-sources/AndroidManifest.xml +++ b/android-sources/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/blueROCK.pro b/blueROCK.pro index b71e460..e49c8e5 100644 --- a/blueROCK.pro +++ b/blueROCK.pro @@ -22,7 +22,10 @@ SOURCES += \ sources/serverconn.cpp RESOURCES += resources/qml/qml.qrc \ - resources/shared/shared.qrc + resources/shared/shared.qrc \ + #resources/shared/icons/bluerock/index.theme \ + #$$files(resources/shared/icons/*.png, true) + # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = @@ -40,4 +43,6 @@ HEADERS += \ DISTFILES += \ CHANGELOG.md \ - android-sources/AndroidManifest.xml + android-sources/AndroidManifest.xml \ + resources/shared/icons/bluerock/index.theme \ + $$files(resources/shared/icons/*.png, true) diff --git a/resources/qml/Components/FancyButton.qml b/resources/qml/Components/FancyButton.qml index 568058c..ce20aee 100644 --- a/resources/qml/Components/FancyButton.qml +++ b/resources/qml/Components/FancyButton.qml @@ -20,7 +20,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.4 import QtGraphicalEffects 1.0 -Button { +ToolButton { id: control property string image @@ -33,36 +33,19 @@ Button { property double glowScale: 0.75 property double glowOpacity: 1 - scale: control.pressed ? 0.8:1 - - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - Behavior on backgroundColor { ColorAnimation { duration: 200 } } - contentItem: Text { - visible: false - } - - Text { - id: conetntText - text: qsTr(control.text) - anchors.centerIn: parent - font: parent.font - color: control.textColor - opacity: control.enabled ? 1:0.4 - } - - background: Item { + contentItem: Item { id: controlBackgroundContainer + anchors.fill: parent + + opacity: 1 + RectangularGlow { id: effect glowRadius: control.glowRadius @@ -84,7 +67,7 @@ Button { radius: height * 0.5 - color: control.backgroundColor + color: control.down ? Qt.darker(control.backgroundColor, 1.03) : control.backgroundColor Image { id: buttonIcon @@ -100,7 +83,23 @@ Button { scale: control.imageScale } + + Behavior on color { + ColorAnimation { + duration: 100 + } + } } } + Text { + id: conetntText + text: qsTr(control.text) + anchors.centerIn: parent + font: parent.font + color: control.textColor + opacity: control.enabled ? 1:0.4 + } + + } diff --git a/resources/qml/Components/PullRefresher.qml b/resources/qml/Components/PullRefresher.qml index f5cd304..16d6dc2 100644 --- a/resources/qml/Components/PullRefresher.qml +++ b/resources/qml/Components/PullRefresher.qml @@ -1,21 +1,3 @@ -/* - blueROCK - for digital rock - Copyright (C) 2019 Dorian Zedler - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - import QtQuick 2.9 import QtQuick.Controls 2.4 import QtGraphicalEffects 1.0 @@ -33,7 +15,7 @@ Item { property int preRefreshDelay: 1000 // delay before reload funcion is called property int refreshPosition: height * 1.2 // position of the item when refreshing - property int dragOutPosition: height * 2 // position of the item when starting to refresh + property int dragOutPosition: height * 1.8 // position of the item when starting to refresh property color backgroundColor: "white" // color for the pre-defined background property color pullIndicatorColor: "black" // color for the pre-defined pull indicator @@ -87,7 +69,7 @@ Item { var lineWidth = 2 var progress = drawProgress - + console.log(progress) // modify all values to math the progress arrowHeight = arrowHeight * progress @@ -147,14 +129,15 @@ Item { anchors { top: control.target.top horizontalCenter: control.target.horizontalCenter - topMargin: control.position - height * 1.1 + topMargin: control.position - height } onUserPositionChanged: { - if(control.state === "idle" && userPosition >= control.dragOutPosition){ + console.log(userPosition) + if(control.state === "idle" && userPosition >= control.dragOutPosition * 0.9){ control.state = "ready" } - else if(control.state === "ready" && userPosition < control.dragOutPosition){ + else if(control.state === "ready" && userPosition < control.dragOutPosition * 0.9){ control.state = "refreshing" preRefreshTimer.start() } @@ -197,7 +180,7 @@ Item { Behavior on minimumPosition { enabled: control.state !== "hidden" && control.state !== "idle" NumberAnimation { - duration: 200 + duration: 100 } } @@ -228,7 +211,7 @@ Item { PropertyChanges { target: control minimumPosition: userPosition > maximumPosition ? maximumPosition:userPosition - userPosition: Math.abs( target.verticalOvershoot ) + userPosition: -1 / (Math.abs( target.verticalOvershoot * 0.001 ) + 1 / control.dragOutPosition * 0.001) + control.dragOutPosition // Math.abs( target.verticalOvershoot ) maximumPosition: control.dragOutPosition } @@ -242,8 +225,8 @@ Item { PropertyChanges { target: control maximumPosition: control.dragOutPosition - userPosition: Math.abs( target.verticalOvershoot ) - minimumPosition: control.maximumPosition - 1 + userPosition: -1 / (Math.abs( target.verticalOvershoot * 0.001 ) + 1 / control.dragOutPosition * 0.001) + control.dragOutPosition // Math.abs( target.verticalOvershoot ) + minimumPosition: userPosition > maximumPosition - 1 ? maximumPosition - 1:userPosition } PropertyChanges { @@ -296,7 +279,7 @@ Item { transitions: [ Transition { NumberAnimation { - duration: 200 + duration: 100 properties: "rotation, opacity" } }, diff --git a/resources/qml/Widgets/CalendarWidget.qml b/resources/qml/Widgets/CalendarWidget.qml index 8664adb..c790a52 100644 --- a/resources/qml/Widgets/CalendarWidget.qml +++ b/resources/qml/Widgets/CalendarWidget.qml @@ -18,6 +18,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.3 import "../Components" @@ -27,99 +28,31 @@ DataListView { property bool ready property string title: (params.nation === "" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTr("competition calendar") + " " + control.year - property Component headerComponent: Row { + property Component headerComponent: RowLayout { - anchors { - top: parent.top - bottom: parent.bottom - right: parent.right - rightMargin: 5 - } + height: parent.height - width: childrenRect.width + spacing: 0 - spacing: width * 0.1 - - Button { + ToolButton { id:yearToolBt - anchors { - verticalCenter: parent.verticalCenter - } - - height: parent.height * 0.5 - width: height - onClicked: { control.changeYear() } - onPressed: yearToolBt.scale = 0.9 - onReleased: yearToolBt.scale = 1.0 - - background: Image { - - anchors.centerIn: parent - - source: "qrc:/icons/calendar.png" - - height: parent.height > parent.width ? parent.width : parent.height - width: height - - mipmap: true - - fillMode: Image.PreserveAspectFit - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - } + icon.name: "calendar" } - Button { + ToolButton { id: cupToolBt - anchors { - verticalCenter: parent.verticalCenter - } - - height: parent.height * 0.5 - width: height - onClicked: { control.openCup() } - onPressed: cupToolBt.scale = 0.9 - onReleased: cupToolBt.scale = 1.0 - - background: Image { - - anchors.centerIn: parent - - source: "qrc:/icons/cup.png" - - height: parent.height > parent.width ? parent.width : parent.height - width: height - - mipmap: true - - fillMode: Image.PreserveAspectFit - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - } + icon.name: "cup" } - - Item { - id: spacer - height: parent.height - width: 1 - } - } property var widgetData: currentWidgetData diff --git a/resources/qml/Widgets/RegistrationWidget.qml b/resources/qml/Widgets/RegistrationWidget.qml index 8a33bbe..7486880 100644 --- a/resources/qml/Widgets/RegistrationWidget.qml +++ b/resources/qml/Widgets/RegistrationWidget.qml @@ -30,49 +30,14 @@ DataListView { property string subTitle: getSubtitle() property bool titleIsPageTitle: true - property Component headerComponent: Item { - - height: parent.height - width: moreToolBt.width * 1.5 - - Button { + property Component headerComponent: ToolButton { id: moreToolBt - anchors { - verticalCenter: parent.verticalCenter - right: parent.right - rightMargin: parent.width * 0.5 - } - - height: parent.height * 0.5 - width: height - onClicked: { control.changeCat() } - onPressed: moreToolBt.scale = 0.9 - onReleased: moreToolBt.scale = 1.0 - - background: Image { - - anchors.centerIn: parent - - source: "qrc:/icons/more_black.png" - - height: parent.height > parent.width ? parent.width : parent.height - width: height - - mipmap: true - - fillMode: Image.PreserveAspectFit - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - } - } + icon.name: "menu" } property var widgetData: currentWidgetData @@ -134,8 +99,9 @@ DataListView { var selectOptions = [] for(var prop in cats){ - if (cats.hasOwnProperty(prop) && !control.subTitle.includes(cats[prop]['name'])) { + if (cats.hasOwnProperty(prop) && parseInt(cats[prop]["GrpId"]) !== parseInt(params.cat)) { // append all cats and ignore the current one + //console.log("found cat: ", cats[prop]['name']) selectOptions.push({text: cats[prop]['name'], data:{cat: cats[prop]['GrpId']}}) } } diff --git a/resources/qml/Widgets/ResultWidget.qml b/resources/qml/Widgets/ResultWidget.qml index 626fed2..17c311f 100644 --- a/resources/qml/Widgets/ResultWidget.qml +++ b/resources/qml/Widgets/ResultWidget.qml @@ -31,49 +31,14 @@ DataListView { property string subTitle: getSubtitle() property bool titleIsPageTitle: true - property Component headerComponent: Item { - - height: parent.height - width: moreToolBt.width * 1.5 - - Button { + property Component headerComponent: ToolButton { id: moreToolBt - anchors { - verticalCenter: parent.verticalCenter - right: parent.right - rightMargin: parent.width * 0.5 - } - - height: parent.height * 0.5 - width: height - onClicked: { control.changeCat() } - onPressed: moreToolBt.scale = 0.9 - onReleased: moreToolBt.scale = 1.0 - - background: Image { - - anchors.centerIn: parent - - source: "qrc:/icons/more_black.png" - - height: parent.height > parent.width ? parent.width : parent.height - width: height - - mipmap: true - - fillMode: Image.PreserveAspectFit - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - } - } + icon.name: "menu" } property var widgetData: currentWidgetData @@ -137,8 +102,9 @@ DataListView { var selectOptions = [] for(var prop in cats){ - if (cats.hasOwnProperty(prop) && !control.subTitle.includes(cats[prop]['name'])) { + if (cats.hasOwnProperty(prop) && parseInt(cats[prop]["GrpId"]) !== parseInt(params.cat)) { // append all cats and ignore the current one + //console.log("found cat: ", cats[prop]['name']) selectOptions.push({text: cats[prop]['name'], data:{cat: cats[prop]['GrpId']}}) } } diff --git a/resources/qml/Widgets/StartlistWidget.qml b/resources/qml/Widgets/StartlistWidget.qml index 7f727f4..94d1208 100644 --- a/resources/qml/Widgets/StartlistWidget.qml +++ b/resources/qml/Widgets/StartlistWidget.qml @@ -31,49 +31,14 @@ DataListView { property string subTitle: qsTr("(Startlist)") + " " + control.widgetData['route_name'] //getSubtitle() property bool titleIsPageTitle: true - property Component headerComponent: Item { - - height: parent.height - width: moreToolBt.width * 1.5 - - Button { + property Component headerComponent: ToolButton { id: moreToolBt - anchors { - verticalCenter: parent.verticalCenter - right: parent.right - rightMargin: parent.width * 0.5 - } - - height: parent.height * 0.5 - width: height - onClicked: { control.changeCat() } - onPressed: moreToolBt.scale = 0.9 - onReleased: moreToolBt.scale = 1.0 - - background: Image { - - anchors.centerIn: parent - - source: "qrc:/icons/more_black.png" - - height: parent.height > parent.width ? parent.width : parent.height - width: height - - mipmap: true - - fillMode: Image.PreserveAspectFit - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - } - } + icon.name: "menu" } function getSubtitle() { @@ -105,8 +70,9 @@ DataListView { var selectOptions = [] for(var prop in cats){ - if (cats.hasOwnProperty(prop) && !control.subTitle.includes(cats[prop]['name'])) { + if (cats.hasOwnProperty(prop) && parseInt(cats[prop]["GrpId"]) !== parseInt(params.cat)) { // append all cats and ignore the current one + //console.log("found cat: ", cats[prop]['name']) selectOptions.push({text: cats[prop]['name'], data:{cat: cats[prop]['GrpId']}}) } } @@ -308,7 +274,7 @@ DataListView { delegate: TabButton { text: routeSelectTb.tabs[index][1] - width: Math.max(150, routeSelectTb.width / routeSelectButtonRep.model) //text.length * font.pixelSize + width: Math.max(150, root.width / routeSelectButtonRep.model) //text.length * font.pixelSize onClicked: { //console.log("changing to index: " + index + " (" + routeSelectTb.tabs[index][0] + ", " + routeSelectTb.tabs[index][1] + ")") diff --git a/resources/qml/main.qml b/resources/qml/main.qml index b33df9b..035c5e8 100644 --- a/resources/qml/main.qml +++ b/resources/qml/main.qml @@ -19,6 +19,7 @@ import QtQuick 2.9 import QtQuick.Window 2.2 import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.3 import com.itsblue.digitalRockRanking 1.0 @@ -247,27 +248,16 @@ Window { showErrorBar: true - Row { + RowLayout { anchors.fill: parent spacing: width * 0.02 - Item { - id: spacer - width: 1 - height: parent.height - } - - Button { + ToolButton { id:toolButton - anchors { - verticalCenter: parent.verticalCenter - } - - height: parent.height * 0.5 - width: height + height: parent.height onClicked: { if(!mainStack.currentItem.locked){ @@ -275,27 +265,12 @@ Window { } } - onPressed: toolButton.scale = 0.9 - onReleased: toolButton.scale = 1.0 - - background: Image { - source: "qrc:/icons/backDark.png" - - height: parent.height - width: height - - fillMode: Image.PreserveAspectFit - Behavior on scale { - PropertyAnimation { - duration: 100 - } - } - } + icon.name: "back" } Column { - anchors.verticalCenter: parent.verticalCenter + Layout.fillWidth: true height: childrenRect.height width: parent.width - extraComponentLoader.width - toolButton.width - 3 * parent.spacing @@ -381,10 +356,6 @@ Window { property int maximumWidth: parent.width * 0.4 - toolButton.width - 3 height: parent.height - anchors { - top: parent.top - bottom: parent.bottom - } onItemChanged: { width = status === Loader.Ready ? item.width:0 diff --git a/resources/shared/icons/bluerock/20x20/back.png b/resources/shared/icons/bluerock/20x20/back.png new file mode 100644 index 0000000..db43e27 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20/back.png differ diff --git a/resources/shared/icons/bluerock/20x20/calendar.png b/resources/shared/icons/bluerock/20x20/calendar.png new file mode 100644 index 0000000..61cc427 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20/calendar.png differ diff --git a/resources/shared/icons/bluerock/20x20/cup.png b/resources/shared/icons/bluerock/20x20/cup.png new file mode 100644 index 0000000..d52dbd1 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20/cup.png differ diff --git a/resources/shared/icons/bluerock/20x20/drawer.png b/resources/shared/icons/bluerock/20x20/drawer.png new file mode 100644 index 0000000..1e974ef Binary files /dev/null and b/resources/shared/icons/bluerock/20x20/drawer.png differ diff --git a/resources/shared/icons/bluerock/20x20/menu.png b/resources/shared/icons/bluerock/20x20/menu.png new file mode 100644 index 0000000..a10473d Binary files /dev/null and b/resources/shared/icons/bluerock/20x20/menu.png differ diff --git a/resources/shared/icons/bluerock/20x20@2/back.png b/resources/shared/icons/bluerock/20x20@2/back.png new file mode 100644 index 0000000..c55ab31 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@2/back.png differ diff --git a/resources/shared/icons/bluerock/20x20@2/calendar.png b/resources/shared/icons/bluerock/20x20@2/calendar.png new file mode 100644 index 0000000..53fe9b1 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@2/calendar.png differ diff --git a/resources/shared/icons/bluerock/20x20@2/cup.png b/resources/shared/icons/bluerock/20x20@2/cup.png new file mode 100644 index 0000000..b66aa2f Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@2/cup.png differ diff --git a/resources/shared/icons/bluerock/20x20@2/drawer.png b/resources/shared/icons/bluerock/20x20@2/drawer.png new file mode 100644 index 0000000..eba3b6c Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@2/drawer.png differ diff --git a/resources/shared/icons/bluerock/20x20@2/menu.png b/resources/shared/icons/bluerock/20x20@2/menu.png new file mode 100644 index 0000000..649c2a0 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@2/menu.png differ diff --git a/resources/shared/icons/bluerock/20x20@3/back.png b/resources/shared/icons/bluerock/20x20@3/back.png new file mode 100644 index 0000000..b228eb8 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@3/back.png differ diff --git a/resources/shared/icons/bluerock/20x20@3/calendar.png b/resources/shared/icons/bluerock/20x20@3/calendar.png new file mode 100644 index 0000000..434503c Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@3/calendar.png differ diff --git a/resources/shared/icons/bluerock/20x20@3/cup.png b/resources/shared/icons/bluerock/20x20@3/cup.png new file mode 100644 index 0000000..9ad32ba Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@3/cup.png differ diff --git a/resources/shared/icons/bluerock/20x20@3/drawer.png b/resources/shared/icons/bluerock/20x20@3/drawer.png new file mode 100644 index 0000000..3584ed6 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@3/drawer.png differ diff --git a/resources/shared/icons/bluerock/20x20@3/menu.png b/resources/shared/icons/bluerock/20x20@3/menu.png new file mode 100644 index 0000000..9554b69 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@3/menu.png differ diff --git a/resources/shared/icons/bluerock/20x20@4/back.png b/resources/shared/icons/bluerock/20x20@4/back.png new file mode 100644 index 0000000..dd157e7 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@4/back.png differ diff --git a/resources/shared/icons/bluerock/20x20@4/calendar.png b/resources/shared/icons/bluerock/20x20@4/calendar.png new file mode 100644 index 0000000..d799f8c Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@4/calendar.png differ diff --git a/resources/shared/icons/bluerock/20x20@4/cup.png b/resources/shared/icons/bluerock/20x20@4/cup.png new file mode 100644 index 0000000..4baaf9a Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@4/cup.png differ diff --git a/resources/shared/icons/bluerock/20x20@4/drawer.png b/resources/shared/icons/bluerock/20x20@4/drawer.png new file mode 100644 index 0000000..60d93af Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@4/drawer.png differ diff --git a/resources/shared/icons/bluerock/20x20@4/menu.png b/resources/shared/icons/bluerock/20x20@4/menu.png new file mode 100644 index 0000000..187c171 Binary files /dev/null and b/resources/shared/icons/bluerock/20x20@4/menu.png differ diff --git a/resources/shared/icons/bluerock/index.theme b/resources/shared/icons/bluerock/index.theme new file mode 100644 index 0000000..2457fde --- /dev/null +++ b/resources/shared/icons/bluerock/index.theme @@ -0,0 +1,24 @@ +[Icon Theme] +Name=blueROCK +Comment=blueROCK Icon Theme + +Directories=20x20,20x20@2,20x20@3,20x20@4 + +[20x20] +Size=20 +Type=Fixed + +[20x20@2] +Size=20 +Scale=2 +Type=Fixed + +[20x20@3] +Size=20 +Scale=3 +Type=Fixed + +[20x20@4] +Size=20 +Scale=4 +Type=Fixed diff --git a/resources/shared/shared.qrc b/resources/shared/shared.qrc index 7d1082e..c88314b 100644 --- a/resources/shared/shared.qrc +++ b/resources/shared/shared.qrc @@ -9,5 +9,30 @@ icons/cup.png Banner.png icons/more_black.png + icons/bluerock/20x20/back.png + icons/bluerock/20x20/cup.png + icons/bluerock/20x20/drawer.png + icons/bluerock/20x20/menu.png + icons/bluerock/20x20@2/back.png + icons/bluerock/20x20@2/cup.png + icons/bluerock/20x20@2/drawer.png + icons/bluerock/20x20@2/menu.png + icons/bluerock/20x20@3/back.png + icons/bluerock/20x20@3/cup.png + icons/bluerock/20x20@3/drawer.png + icons/bluerock/20x20@3/menu.png + icons/bluerock/20x20@4/back.png + icons/bluerock/20x20@4/cup.png + icons/bluerock/20x20@4/drawer.png + icons/bluerock/20x20@4/menu.png + icons/bluerock/index.theme + icons/dig_rock.klein.jpg + icons/dig_rock.klein.png + icons/favicon.png + icons/json.php.json + icons/bluerock/20x20/calendar.png + icons/bluerock/20x20@2/calendar.png + icons/bluerock/20x20@3/calendar.png + icons/bluerock/20x20@4/calendar.png diff --git a/sources/main.cpp b/sources/main.cpp index f10a139..6226180 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -20,16 +20,20 @@ #include #include #include +#include #include "headers/serverconn.h" int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QGuiApplication app(argc, argv); QQuickStyle::setStyle("Material"); + QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << ":/resources/shared/icons"); + QIcon::setThemeName("bluerock"); qmlRegisterType("com.itsblue.digitalRockRanking", 1, 0, "ServerConn");