1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-08 03:52:42 +01:00

Fix some styling issues

This commit is contained in:
Elias Steurer 2020-03-13 17:05:10 +01:00
parent d42ba8f5cf
commit d23ebfbf02
2 changed files with 112 additions and 41 deletions

View File

@ -174,6 +174,7 @@ Item {
}
}
GridView {
id: customPropertiesGridView
boundsBehavior: Flickable.DragOverBounds
@ -188,13 +189,15 @@ Item {
top: parent.top
topMargin: 60
right: parent.right
rightMargin: 40
bottom: parent.bottom
margins: 30
bottomMargin: 30
left: itmLeftWrapper.right
}
delegate: MonitorsProjectSettingItem {
id: delegate
width: parent.width - 40
selectedMonitor: monitors.activeMonitorIndex
}
@ -334,3 +337,9 @@ Item {
}
]
}
/*##^##
Designer {
D{i:0;autoSize:true;height:768;width:1366}
}
##^##*/

View File

@ -1,33 +1,32 @@
import QtQuick 2.12
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Controls.Material 2.2
import QtQuick.Layouts 1.3
import Settings 1.0
import ScreenPlay 1.0
Item {
Rectangle {
id: delegate
focus: true
height: isHeadline ? 50 : 30
width: 300
property int selectedMonitor
anchors {
left: parent.left
leftMargin: isHeadline ? 0 : 25
}
Text {
id: txtDescription
text: name
width: 100
font.pointSize: isHeadline ? 21 : 14
font.pointSize: isHeadline ? 18 : 12
anchors.verticalCenter: parent.verticalCenter
font.family: "Roboto"
font.weight: Font.Normal
color: isHeadline ? Qt.darker(Material.foreground) : Material.foreground
anchors {
left: parent.left
leftMargin: isHeadline ? 0 : 25
}
}
@ -58,13 +57,18 @@ Item {
loader.item.to = obj["to"]
loader.item.value = obj["value"]
loader.item.stepSize = obj["stepSize"]
break;
break
case "bool":
loader.sourceComponent = compCheckbox
loader.item.value = obj["value"]
break;
break
case "color":
loader.sourceComponent = compColorpicker
loader.item.value = obj["value"]
break
}
}
Component {
id: compCheckbox
@ -77,18 +81,57 @@ Item {
id: checkbox
checkable: true
checked: root.value
onCheckedChanged: {
var value = checkbox.checked
txtCheckboxValue.text = value;
ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,name,value)
}
}
Text {
id: txtCheckboxValue
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
}
onCheckedChanged: {
ScreenPlay.screenPlayManager.setWallpaperValue(
selectedMonitor, name, value)
}
}
}
}
Component {
id: compColorpicker
Item {
id: root
anchors.fill: parent
property color value
Button {
id: btnSetColor
text: qsTr("Set color")
onClicked: colorDialog.open()
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
}
}
Rectangle {
id: rctPreviewColor
radius: 3
color: root.value
border.width: 1
border.color: "gray"
width: parent.height
height: parent.height
anchors {
right: btnSetColor.left
rightMargin: 20
verticalCenter: parent.verticalCenter
}
}
ColorDialog {
id: colorDialog
title: qsTr("Please choose a color")
onAccepted: {
rctPreviewColor.color = colorDialog.color
ScreenPlay.screenPlayManager.setWallpaperValue(
selectedMonitor, name, colorDialog.color)
}
}
}
}
@ -111,16 +154,27 @@ Item {
value: root.value
stepSize: root.stepSize
live: false
width: parent.width
anchors {
verticalCenter: parent.verticalCenter
right:txtSliderValue.left
rightMargin: 20
left:parent.left
leftMargin: 20
}
onValueChanged: {
var value = Math.round(slider.value * 100) / 100;
txtSliderValue.text = value;
ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,name,value)
var value = Math.round(slider.value * 100) / 100
txtSliderValue.text = value
ScreenPlay.screenPlayManager.setWallpaperValue(
selectedMonitor, name, value)
}
}
Text {
id: txtSliderValue
color: Material.foreground
horizontalAlignment: Text.AlignRight
font.family: ScreenPlay.settings.font
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
@ -132,6 +186,14 @@ Item {
Loader {
id: loader
anchors.fill: parent
anchors.rightMargin: 10
}
}
}
/*##^##
Designer {
D{i:0;height:50;width:400}
}
##^##*/