Many improovements, dark mode is now functional

This commit is contained in:
Dorian Zedler 2021-06-17 13:50:18 +02:00
parent 229732762c
commit c62af2e172
Signed by: dorian
GPG key ID: 989DE36109AFA354
75 changed files with 124 additions and 137 deletions

View file

@ -0,0 +1,21 @@
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
Button {
id: control
property alias horizontalAlignment: label.horizontalAlignment
property alias verticalAlignment: label.verticalAlignment
contentItem: Label {
id: label
text: control.text
font: control.font
color: !control.enabled ? control.Material.hintTextColor :
control.flat && control.highlighted ? control.Material.accentColor :
control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.foreground
}
}

View file

@ -113,14 +113,17 @@ ColoredItemDelegate {
ToolButton {
id: bookmarkTb
icon.name: competitionDel.thisIsFavored ? "pinFilled":"pin"
text: "\uf005"
font.family: competitionDel.thisIsFavored ? fa5solid.name : fa5regular.name
onClicked: {
control.editFavorites(!competitionDel.thisIsFavored, parseInt(thisData['WetId']))
}
Layout.alignment: Layout.Right
Behavior on icon.name {
Behavior on font.family {
SequentialAnimation {
NumberAnimation {
property: "scale"

View file

@ -83,9 +83,9 @@ Rectangle {
Layout.alignment: Layout.Center
enabled: speedFlowChartProduct.status === Product.Registered
text: speedFlowChartProduct.status === Product.Registered
? "Buy now for " + speedFlowChartProduct.price
? "\uf218 Buy now for " + speedFlowChartProduct.price
: qsTr("This item is currently unavailable")
icon.name: "buy"
font.family: fa5solid.name
onClicked: speedFlowChartProduct.purchase()
}

View file

@ -39,26 +39,38 @@ Page {
}
height: menuGr.buttonSize * 0.3
spacing: anchors.topMargin * 0.5
}
Grid {
GridLayout {
id: menuGr
anchors.centerIn: parent
anchors {
top: headerBadge.bottom
bottom: bottomDigitalrockDisclaimerLabel.top
left: parent.left
right: parent.right
margins: headerBadge.anchors.topMargin
}
rows: app.landscape() ? 1:2
columns: app.landscape() ? 2:1
rows: app.landscape() ? 1:5
columns: app.landscape() ? 5:1
spacing: !app.landscape() ? parent.height * 0.08:parent.width * 0.1
rowSpacing: app.landscape() ? parent.width * 0.1:headerBadge.anchors.topMargin
columnSpacing: rowSpacing
property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.2
property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.19
Item {
Layout.fillHeight: true
Layout.preferredWidth: 0
}
FancyButton {
id: davBt
height: menuGr.buttonSize
width: height
Layout.preferredHeight: menuGr.buttonSize
Layout.preferredWidth: menuGr.buttonSize
Layout.alignment: Layout.Center
image: Material.theme === Material.Dark ? "qrc:/icons/dav-dark.png":"qrc:/icons/dav.png"
@ -71,46 +83,55 @@ Page {
FancyButton {
id: sacBt
height: menuGr.buttonSize
width: height
Layout.preferredHeight: menuGr.buttonSize
Layout.preferredWidth: menuGr.buttonSize
Layout.alignment: Layout.Center
image: Material.theme === Material.Dark ? "qrc:/icons/sac-dark.png":"qrc:/icons/sac.png"
onClicked: {
app.openWidget({nation:"SUI"})
}
}
Item {
Layout.fillHeight: true
visible: !app.landscape()
}
RowLayout {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: bottomDigitalrockDisclaimerLabel.top
}
GridLayout {
Layout.preferredHeight: app.landscape() ? menuGr.buttonSize : menuGr.buttonSize / 2
Layout.maximumWidth: app.landscape() ? menuGr.buttonSize : menuGr.buttonSize * 2
Layout.alignment: Layout.Center
Button {
id: ifscDisclaimerButton
columns: app.landscape() ? 1:2
rows: app.landscape() ? 4:2
Repeater {
id: buttonRepeater
property var buttons: [
["\uf059 IFSC results", ifscDisclaimerDialog.open],
["\uf029 Scan QR code", null],
[Material.theme === Material.Light ? "\uf042 Dark mode":"\uf042 Light mode", app.toggleDarkMode],
["\uf05a About blueROCK", aboutBluerockDisclaimerDialog.open]
]
model: buttons
delegate: Button {
Layout.fillWidth: true
flat: true
font.bold: true
font.pixelSize: aboutBluerockDisclaimerButton.font.pixelSize
text: "Where are the IFSC results?"
font.family: fa5solid.name
font.pixelSize: height * 0.4
font.capitalization: Font.MixedCase
onClicked: ifscDisclaimerDialog.open()
text: modelData[0]
onClicked: buttonRepeater.buttons[index][1]()
}
}
Button {
id: aboutBluerockDisclaimerButton
flat: true
font.pixelSize: bottomDigitalrockDisclaimerLabel.paintedHeight * (Qt.platform.os === "android" ? 0.8:0.735)
text: "About blueROCK"
onClicked: aboutBluerockDisclaimerDialog.open()
}
}

View file

@ -42,7 +42,9 @@ DataListView {
control.changeYear()
}
icon.name: "year"
text: "\uf133"
font.family: fa5solid.name
}
ToolButton {
@ -61,7 +63,7 @@ DataListView {
}
}
compCats.push( {"text": qsTr("Pinned"), "data": {"sort_rank":0, "cat_id":[-1]}} )
compCats.push( {"text": qsTr("Favorites"), "data": {"sort_rank":0, "cat_id":[-1]}} )
compCats.sort(function(a, b) {
return a['data']['sort_rank'] - b['data']['sort_rank'];
@ -70,7 +72,8 @@ DataListView {
filterSelectPu.appear(compCats, qsTr("Select Filters"), "")
}
icon.name: "filter"
text: "\uf0b0"
font.family: fa5solid.name
}
ToolButton {
@ -80,7 +83,8 @@ DataListView {
control.openCup()
}
icon.name: "cup"
text: "\uf091"
font.family: fa5solid.name
}
}

View file

@ -37,7 +37,8 @@ DataListView {
control.changeCat()
}
icon.name: "menu"
text: "\uf142"
font.family: fa5solid.name
}
property var widgetData: currentWidgetData

View file

@ -46,7 +46,8 @@ DataListView {
onClicked: control.changeCat()
icon.name: "menu"
text: "\uf142"
font.family: fa5solid.name
}
ToolButton {
@ -61,7 +62,8 @@ DataListView {
speedFlowChartPopup.toggle()
}
icon.name: "flowchart"
text: "\uf0e8"
font.family: fa5solid.name
}
}

View file

@ -38,7 +38,8 @@ DataListView {
control.changeCat()
}
icon.name: "menu"
text: "\uf142"
font.family: fa5solid.name
}
function getSubtitle() {

View file

@ -42,7 +42,7 @@ Window {
property var colorShade: Material.theme === Material.Light ? Material.Shade300 : Material.Shade700
property color nationalAdultsColor: Material.color(Material.Green, colorShade)
property color nationalYouthColor: Material.color(Material.LightGreen, colorShade)
property color federalColor: Material.backgroundColor
property color federalColor: Material.color(Material.Grey, colorShade)
// comp cats source:
// - https://github.com/ralfbecker/ranking/blob/master/sitemgr/digitalrock/dav_calendar.php
@ -125,7 +125,7 @@ Window {
anchors.fill: parent
Material.theme: Material.Dark
Material.theme: appSettings.read("darkTheme") === "true" ? Material.Dark:Material.Light
Component.onCompleted: {
//loadingDl.open()
@ -136,6 +136,16 @@ Window {
//openWidget({person: 6623})
}
FontLoader {
id: fa5solid
source: "qrc:/fonts/fa5solid.otf"
}
FontLoader {
id: fa5regular
source: "qrc:/fonts/fa5regular.otf"
}
Shortcut {
sequences: ["Esc", "Back"]
enabled: mainStack.depth > 1
@ -146,8 +156,8 @@ Window {
id: serverConn
Component.onCompleted: {
var params = serverConn.getParamsFromUrl("https://www.digitalrock.de/egroupware/ranking/sitemgr/digitalrock/eliste.html#!comp=11471&cat=GER_F_A")
app.openWidget(params)
//var params = serverConn.getParamsFromUrl("https://www.digitalrock.de/egroupware/ranking/sitemgr/digitalrock/eliste.html#!comp=11471&cat=GER_F_A")
//app.openWidget(params)
}
}
@ -235,7 +245,9 @@ Window {
height: parent.height
onClicked: app.goBack()
icon.name: "back"
text: "\uf053"
font.family: fa5solid.name
}
Column {
@ -513,6 +525,13 @@ Window {
return app.height < app.width
}
function toggleDarkMode() {
var dark = app.Material.theme === Material.Light
app.Material.theme = dark ? Material.Dark : Material.Light
appSettings.write("darkTheme", dark)
}
function largeScreen() {
return Math.min(app.width, app.height) > 750
}

View file

@ -27,5 +27,6 @@
<file>Components/BlueRockBadge.qml</file>
<file>Components/DisclaimerDialog.qml</file>
<file>Components/ColoredItemDelegate.qml</file>
<file>Components/AlignedButton.qml</file>
</qresource>
</RCC>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

View file

@ -1,24 +0,0 @@
[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

View file

@ -8,68 +8,7 @@
<file>icons/cup.png</file>
<file>Banner.png</file>
<file>icons/more_black.png</file>
<file>icons/bluerock/20x20/back.png</file>
<file>icons/bluerock/20x20/cup.png</file>
<file>icons/bluerock/20x20/drawer.png</file>
<file>icons/bluerock/20x20/menu.png</file>
<file>icons/bluerock/20x20@2/back.png</file>
<file>icons/bluerock/20x20@2/cup.png</file>
<file>icons/bluerock/20x20@2/drawer.png</file>
<file>icons/bluerock/20x20@2/menu.png</file>
<file>icons/bluerock/20x20@3/back.png</file>
<file>icons/bluerock/20x20@3/cup.png</file>
<file>icons/bluerock/20x20@3/drawer.png</file>
<file>icons/bluerock/20x20@3/menu.png</file>
<file>icons/bluerock/20x20@4/back.png</file>
<file>icons/bluerock/20x20@4/cup.png</file>
<file>icons/bluerock/20x20@4/drawer.png</file>
<file>icons/bluerock/20x20@4/menu.png</file>
<file>icons/bluerock/index.theme</file>
<file>icons/bluerock/20x20/calendar.png</file>
<file>icons/bluerock/20x20@2/calendar.png</file>
<file>icons/bluerock/20x20@3/calendar.png</file>
<file>icons/bluerock/20x20@4/calendar.png</file>
<file>icons/bluerock/20x20/filter.png</file>
<file>icons/bluerock/20x20/year.png</file>
<file>icons/bluerock/20x20@2/filter.png</file>
<file>icons/bluerock/20x20@2/year.png</file>
<file>icons/bluerock/20x20@3/filter.png</file>
<file>icons/bluerock/20x20@3/year.png</file>
<file>icons/bluerock/20x20@4/filter.png</file>
<file>icons/bluerock/20x20@4/year.png</file>
<file>icons/bluerock/20x20/flowchart.png</file>
<file>icons/bluerock/20x20@2/flowchart.png</file>
<file>icons/bluerock/20x20@3/flowchart.png</file>
<file>icons/bluerock/20x20@4/flowchart.png</file>
<file>icons/bluerock/20x20/bookmark.png</file>
<file>icons/bluerock/20x20/bookmarkFilled.png</file>
<file>icons/bluerock/20x20@2/bookmark.png</file>
<file>icons/bluerock/20x20@2/bookmarkFilled.png</file>
<file>icons/bluerock/20x20@3/bookmark.png</file>
<file>icons/bluerock/20x20@3/bookmarkFilled.png</file>
<file>icons/bluerock/20x20@4/bookmark.png</file>
<file>icons/bluerock/20x20@4/bookmarkFilled.png</file>
<file>icons/bluerock/20x20/buy.png</file>
<file>icons/bluerock/20x20@2/buy.png</file>
<file>icons/bluerock/20x20@3/buy.png</file>
<file>icons/bluerock/20x20@4/buy.png</file>
<file>icons/lock.png</file>
<file>icons/bluerock/20x20/star.png</file>
<file>icons/bluerock/20x20/starFilled.png</file>
<file>icons/bluerock/20x20@2/star.png</file>
<file>icons/bluerock/20x20@2/starFilled.png</file>
<file>icons/bluerock/20x20@3/star.png</file>
<file>icons/bluerock/20x20@3/starFilled.png</file>
<file>icons/bluerock/20x20@4/star.png</file>
<file>icons/bluerock/20x20@4/starFilled.png</file>
<file>icons/bluerock/20x20/pin.png</file>
<file>icons/bluerock/20x20/pinFilled.png</file>
<file>icons/bluerock/20x20@2/pin.png</file>
<file>icons/bluerock/20x20@2/pinFilled.png</file>
<file>icons/bluerock/20x20@3/pin.png</file>
<file>icons/bluerock/20x20@3/pinFilled.png</file>
<file>icons/bluerock/20x20@4/pin.png</file>
<file>icons/bluerock/20x20@4/pinFilled.png</file>
<file>icons/blueRockHold.png</file>
<file>screenshots/SpeedFlowchartDemo/android/1.jpeg</file>
<file>screenshots/SpeedFlowchartDemo/android/2.jpeg</file>
@ -79,5 +18,7 @@
<file>screenshots/SpeedFlowchartDemo/ios/3.jpeg</file>
<file>icons/dav-dark.png</file>
<file>icons/sac-dark.png</file>
<file>fonts/fa5regular.otf</file>
<file>fonts/fa5solid.otf</file>
</qresource>
</RCC>

View file

@ -20,7 +20,6 @@
#include <QGuiApplication>
#include <QtQml/QQmlContext>
#include <QQmlApplicationEngine>
#include <QIcon>
#include <QStyleFactory>
#include <QUrl>
@ -35,8 +34,6 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("Material");
QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << ":/resources/shared/icons");
QIcon::setThemeName("bluerock");
qmlRegisterType<BlueRockBackend>("de.itsblue.blueROCK", 1, 0, "BlueRockBackend");
qmlRegisterType<AppSettings>("de.itsblue.blueROCK", 1, 0, "AppSettings");