mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Cura about dialog when shaked gives extra info
CURA-10770
This commit is contained in:
parent
56b8205ce0
commit
0c7d0540b9
4 changed files with 129 additions and 2 deletions
|
@ -1,10 +1,10 @@
|
|||
// Copyright (c) 2022 UltiMaker
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 2.9
|
||||
|
||||
import UM 1.5 as UM
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
UM.Dialog
|
||||
|
@ -21,6 +21,22 @@ UM.Dialog
|
|||
|
||||
backgroundColor: UM.Theme.getColor("main_background")
|
||||
|
||||
property real dialogX: base.x
|
||||
property real dialogY: base.y
|
||||
property int shakeDetected: (shakeDetector.shakeIsdetected)
|
||||
property UM.ShakeDetector shakeDetector: UM.ShakeDetector{ }
|
||||
|
||||
readonly property Timer timer : Timer
|
||||
{
|
||||
interval: 100 // Update interval in milliseconds (adjust as needed)
|
||||
running: onDialogXChanged || onDialogYChanged
|
||||
repeat: true
|
||||
onTriggered:
|
||||
{
|
||||
shakeDetector.checkForShake(dialogX, dialogY)
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: header
|
||||
|
@ -181,6 +197,31 @@ UM.Dialog
|
|||
}
|
||||
}
|
||||
|
||||
AboutDialogVersionsList{
|
||||
id: projectBuildInfoList
|
||||
|
||||
}
|
||||
|
||||
onShakeDetectedChanged:
|
||||
{
|
||||
if (!projectBuildInfoList.visible)
|
||||
{
|
||||
projectsList.visible= false;
|
||||
projectBuildInfoList.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectsList.visible = true;
|
||||
projectBuildInfoList.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
projectsList.visible = true;
|
||||
projectBuildInfoList.visible = false;
|
||||
}
|
||||
|
||||
rightButtons: Cura.TertiaryButton
|
||||
{
|
||||
//: Close about dialog button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue