1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 12:13:00 +01:00

Add time values

Remove auto close when no content is active
This commit is contained in:
Elias Steurer 2024-03-01 19:20:25 +01:00
parent 471a407246
commit c1a81588d9
5 changed files with 63 additions and 22 deletions

View File

@ -24,9 +24,28 @@ Item {
Text {
id: txt
text: root.linePosition + "-"+ (root.linePosition * root.lineWidth).toFixed(2) + "\n" + Math.floor( dragHandler.xAxis.minimum) + " - "+ Math.floor(dragHandler.xAxis.maximum)
//text: root.linePosition + "-"+ (root.linePosition * root.lineWidth).toFixed(2) + "\n" + Math.floor( dragHandler.xAxis.minimum) + " - "+ Math.floor(dragHandler.xAxis.maximum)
text: {
const normalized = root.x / root.lineWidth; // Your existing normalization
let totalHours = normalized * 24;
let hours = Math.floor(totalHours); // Gets the whole hour part
let minutes = Math.round((totalHours - hours) * 60); // Calculates the minutes
// Check if minutes rolled over to 60, adjust hours and minutes accordingly
if (minutes === 60) {
hours += 1; // Increment hours by 1
minutes = 0; // Reset minutes to 0
}
// Ensure hours wrap correctly at 24
if (hours === 24) {
hours = 0;
}
return hours + ":" + minutes.toString().padStart(2, '0')
}
color: "white"
visible: false
visible: !root.isLast
anchors{
horizontalCenter: parent.horizontalCenter
top: parent.top

View File

@ -11,14 +11,6 @@ Rectangle {
signal remove(var index)
signal lineSelected(var index)
border.width: root.selected ? 2 : 0
border.color: "gold"
Behavior on color {
id: colorBehavior
ColorAnimation {
duration: 400
}
}
Text {
id: text
color: "white"
@ -30,13 +22,18 @@ Rectangle {
}
}
Rectangle {
color: "gold"
anchors.fill: parent
visible: root.selected
}
Rectangle {
id: indicatorLineVertical
width: 5
height: 30
color: parent.color
border.width: root.selected ? 2 : 0
border.color: "gold"
color: root.selected ? "gold" : parent.color
anchors{
horizontalCenter: parent.horizontalCenter
top: parent.bottom

View File

@ -4,7 +4,7 @@ import QtQuick.Layouts
Control {
id: root
height: 250
height: 220
implicitWidth: 800
topPadding: 40
leftPadding: 40
@ -61,8 +61,8 @@ Control {
function createSection(index, stopPosition, section) {
console.log("Adding at:", index, stopPosition)
//console.assert(isFloat(stopPosition))
//console.assert(isFloat(stopPosition))
let haComponent = Qt.createComponent("LineHandle.qml")
if (haComponent.status === Component.Error) {
console.assert(haComponent.errorString())
@ -224,6 +224,35 @@ Control {
enabled: true
}
RowLayout {
anchors.fill: parent
Repeater {
model: 24
Item {
width: 20
height: 40
required property int index
Text {
color: "gray"
text: index
anchors {
horizontalCenter: parent.horizontalCenter
}
}
Rectangle {
color: "gray"
width: 1
height: 5
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
}
}
}
}
ToolButton {
text: ""
onClicked: {

View File

@ -50,14 +50,14 @@ Util.Popup {
border.width: 1
radius: 3
Layout.fillWidth: true
Layout.preferredHeight: 280
Layout.preferredHeight: 240
ColumnLayout {
spacing: 20
spacing: 10
anchors {
fill: parent
margins: 40
margins: 20
}
Text {
@ -66,7 +66,6 @@ Util.Popup {
color: Material.primaryTextColor
font.family: App.settings.font
font.weight: Font.Light
width: 400
Layout.fillWidth: true
Layout.preferredHeight: 30
}
@ -200,7 +199,6 @@ Util.Popup {
if (!App.screenPlayManager.removeAllWallpapers(
true))
print("Unable to close all wallpaper!")
root.close()
}
}
@ -218,7 +216,6 @@ Util.Popup {
onClicked: {
if (!App.screenPlayManager.removeAllWidgets())
print("Unable to close all widgets!")
root.close()
}
}
}

View File

@ -303,7 +303,6 @@ Rectangle {
}
ToolButton {
id: miConfig
enabled: quickActionRow.contentActive
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_video_settings.svg"
icon.width: root.iconWidth