-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guided tour of the map canvas (#5465)
- Loading branch information
Showing
8 changed files
with
147 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
cmake -S . -B $(git rev-parse --show-toplevel)/build-x64-linux -GNinja -DWITH_VCPKG=ON -DENABLE_TESTS=ON | ||
cmake -S . -B $(git rev-parse --show-toplevel)/build-x64-linux -GNinja -DWITH_VCPKG=ON -DWITH_SPIX=ON -DENABLE_TESTS=ON | ||
cmake --build $(git rev-parse --show-toplevel)/build-x64-linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
|
||
ProgressBar { | ||
id: control | ||
|
||
property int size: 56 | ||
property real strokeWidth: 6 | ||
property color color: Theme.mainColor | ||
property color backgroundColor: Theme.lightGray | ||
|
||
background: Rectangle { | ||
implicitWidth: control.size | ||
implicitHeight: control.size | ||
radius: control.width / 2 | ||
color: "transparent" | ||
border.color: control.backgroundColor | ||
border.width: control.strokeWidth | ||
} | ||
|
||
onVisualPositionChanged: { | ||
canvas.requestPaint(); | ||
} | ||
|
||
contentItem: Item { | ||
Canvas { | ||
id: canvas | ||
anchors.fill: parent | ||
antialiasing: true | ||
renderTarget: Canvas.Image | ||
property real radius: control.width / 2 - control.strokeWidth / 2 | ||
|
||
onPaint: { | ||
var ctx = canvas.getContext("2d"); | ||
ctx.clearRect(0, 0, canvas.width, canvas.height); | ||
ctx.save(); | ||
ctx.lineWidth = control.strokeWidth; | ||
ctx.strokeStyle = control.color; | ||
ctx.lineCap = "round"; | ||
ctx.beginPath(); | ||
ctx.arc(width / 2, height / 2, radius, -0.5 * Math.PI, -0.5 * Math.PI + control.visualPosition * 2 * Math.PI); | ||
ctx.stroke(); | ||
ctx.closePath(); | ||
ctx.restore(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afd8eaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Ta-daaa, freshly created APKs are available: arm64-android
Other architectures