Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Qt Beer Demo #192

Draft
wants to merge 13 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions at_Qt_Brew/BrewMonitor/About.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Pdf

Pane {
id: root
width: Constants.width
height: Constants.height - 50
background: Rectangle {
id: back
// color: "#002125"
}

PdfDocument {
id: doc
source: "Images/CES-slides.pdf"
}

PdfMultiPageView {
id: view
anchors.fill: parent
document: doc
//shrink pdf to fit in parent
// next page when bottom half is tapped
MouseArea {
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.verticalCenter
anchors.bottom: parent.bottom
onClicked: {
var cur = view.currentPage
cur < 5 ? view.goToPage(cur + 1) : {}
//set back.color to a randomized color
back.color = Qt.rgba(Math.random(), Math.random(),
Math.random(), 1)
}
}

//prev page when top half is tapped
MouseArea {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.verticalCenter
onClicked: {
var cur = view.currentPage
cur ? view.goToPage(cur - 1) : {}
}
}

Component.onCompleted: {
view.scaleToWidth(parent.width, parent.height)
//workaround for visual bug in pdf initial display position
view.goToPage(0)
}
}

Component.onCompleted: {
//workaround for visual bug in pdf initial display position
view.goToPage(3)
}
}
13 changes: 13 additions & 0 deletions at_Qt_Brew/BrewMonitor/AppSettings.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pragma Singleton

import QtQuick
import QtCore

Settings {
property bool isDarkTheme: Qt.styleHints.colorScheme === Qt.Dark
// property color backgroundColor: AppSettings.isDarkTheme ? "#000000" : "#EFFCF6"
// property color accentColor: "purple"
// property color primaryTextColor: "#FFFFFF"
// property color accentTextColor: AppSettings.isDarkTheme ? "#D9D9D9" : "#898989"
// property color iconColor: AppSettings.isDarkTheme ? "#D9D9D9" : "#00414A"
}
Loading