Skip to content

Commit

Permalink
Add individual signals for settings + vertical bars
Browse files Browse the repository at this point in the history
  • Loading branch information
HAMM3REXTREME committed Feb 11, 2025
1 parent 133bd38 commit 93b6385
Show file tree
Hide file tree
Showing 10 changed files with 604 additions and 409 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ qt_add_qml_module(DashBeamApp
URI DashBeam
VERSION 1.0
QML_FILES Main.qml CircleMeter.qml SettingsPage.qml
RESOURCES assets/Aldrich-Regular.ttf assets/signal_l.svg assets/signal_r.svg assets/highbeam.svg assets/handbrake.svg assets/screen_topleft.svg
RESOURCES assets/Aldrich-Regular.ttf assets/signal_l.svg assets/signal_r.svg assets/highbeam.svg assets/handbrake.svg assets/screen_topleft.svg assets/JetBrainsMono-Bold.ttf
RESOURCES android/AndroidManifest.xml android/build.gradle android/res/values/libs.xml android/res/xml/qtprovider_paths.xml android/gradle/wrapper/gradle-wrapper.jar android/gradle/wrapper/gradle-wrapper.properties android/gradle.properties android/gradlew android/gradlew.bat
QML_FILES ShiftLights.qml

)

Expand Down
315 changes: 158 additions & 157 deletions CMakeLists.txt.user

Large diffs are not rendered by default.

35 changes: 24 additions & 11 deletions CircleMeter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Item {
property bool showScreen: true
property string tickFontName: "sans-serif"
property string middleFontName: "monospace"
property real middleFontSize: radius/5
property real middleFontSize: radius / 5
property string middleText: ""

property real ghostRotation: 0
Expand Down Expand Up @@ -81,12 +81,13 @@ Item {
var labelX = width / 2 + Math.cos(
angle) * (radius - longTickLength - labelFontSize)
var labelY = height / 2 + Math.sin(
angle) * (radius - longTickLength - labelFontSize) + labelFontSize/6 // Visual offset
angle) * (radius - longTickLength - labelFontSize)
+ labelFontSize / 6 // Visual offset
ctx.font = "bold " + labelFontSize + "px " + tickFontName
ctx.fillStyle = labelFontColor
ctx.textAlign = "center"
ctx.textBaseline = "middle"
ctx.fillText((i * tickStep)+tickStart, labelX, labelY)
ctx.fillText((i * tickStep) + tickStart, labelX, labelY)
}
}
}
Expand All @@ -101,10 +102,17 @@ Item {
anchors.bottom: background.verticalCenter
transformOrigin: Item.Bottom
gradient: Gradient {
GradientStop { position: 0.0; color: needleColor } // Tip (of the needle)
GradientStop { position: 0.4; color: "#000000AA" } // Base
GradientStop {
position: 0.0
color: needleColor
} // Tip (of the needle)
GradientStop {
position: 0.4
color: "#000000AA"
} // Base
}
rotation: ((dial.needleValue - dial.tickStart)/ dial.tickStep) * (360 / dial.tickDivide) + dial.startAngle
rotation: ((dial.needleValue - dial.tickStart) / dial.tickStep)
* (360 / dial.tickDivide) + dial.startAngle
}
MultiEffect {
source: needle
Expand All @@ -125,9 +133,9 @@ Item {
width: dial.radius * 1.4 - longTickLength - labelFontSize
height: dial.radius * 1.4 - longTickLength - labelFontSize
color: dial.screenBackground
border.color: dial.strokeColor // Stroke color
border.color: dial.strokeColor // Stroke color
border.width: 1
radius: dial.width / 2 // Fully rounded (circle)
radius: dial.width / 2 // Fully rounded (circle)
anchors.centerIn: parent
Text {
anchors.centerIn: parent
Expand All @@ -139,10 +147,15 @@ Item {
textFormat: Text.RichText
}
gradient: Gradient {
GradientStop { position: 0.0; color: dial.screenBackground } // top
GradientStop { position: 1.0; color: "#060607" } // bottom
GradientStop {
position: 0.0
color: dial.screenBackground
} // top
GradientStop {
position: 1.0
color: "#060607"
} // bottom
}

}

Timer {
Expand Down
Loading

0 comments on commit 93b6385

Please sign in to comment.