1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 19:42:45 +01:00

Change sidebar monitor selection to no longer clip

Add flickable when the selection area is bigger than the sidebar
This commit is contained in:
Elias Steurer 2020-07-13 18:00:22 +02:00
parent 7c0b5741af
commit 5f0d81df9e
3 changed files with 30 additions and 9 deletions

View File

@ -139,9 +139,9 @@ Item {
} }
} }
Rectangle { Item {
id: sidebarBackground id: sidebarBackground
color: Material.theme === Material.Light ? "white" : Material.background
anchors { anchors {
top: navBackground.bottom top: navBackground.bottom
right: parent.right right: parent.right
@ -150,6 +150,12 @@ Item {
leftMargin: 5 leftMargin: 5
} }
Rectangle {
anchors.fill: parent
color: Material.theme === Material.Light ? "white" : Material.background
opacity: 0.95
}
Rectangle { Rectangle {
id: imageWrapper id: imageWrapper
height: 237 height: 237

View File

@ -7,10 +7,12 @@ import ScreenPlay 1.0
Rectangle { Rectangle {
id: rect id: rect
color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background) color: Material.theme === Material.Light ? Material.background : Qt.darker(
Material.background)
height: availableHeight height: availableHeight
width: parent.width width: parent.width
clip: true
// Width of the Sidebar or Space that should be used // Width of the Sidebar or Space that should be used
property real availableWidth: 0 property real availableWidth: 0
@ -52,7 +54,7 @@ Rectangle {
for (var i = 0; i < rp.count; i++) { for (var i = 0; i < rp.count; i++) {
rp.itemAt(i).isSelected = false rp.itemAt(i).isSelected = false
} }
rp.itemAt(0).isSelected = true rp.itemAt(0).isSelected = true
getActiveMonitors() getActiveMonitors()
} }
@ -83,15 +85,13 @@ Rectangle {
isWidthGreaterThanHeight = true isWidthGreaterThanHeight = true
} }
if(rp.count === 1){ if (rp.count === 1) {
availableWidth = availableWidth *.66 availableWidth = availableWidth * .66
} }
var dynamicHeight = availableWidth * windowsDelta var dynamicHeight = availableWidth * windowsDelta
var dynamicWidth = availableHeight * windowsDelta var dynamicWidth = availableHeight * windowsDelta
// Delta (height/width) // Delta (height/width)
var monitorHeightRationDelta = 0 var monitorHeightRationDelta = 0
var monitorWidthRationDelta = 0 var monitorWidthRationDelta = 0
@ -110,21 +110,36 @@ Rectangle {
rp.itemAt(i).width = rp.itemAt(i).width * monitorWidthRationDelta rp.itemAt(i).width = rp.itemAt(i).width * monitorWidthRationDelta
rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta
rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta
rp.contentWidth += rp.itemAt(i).width
rp.contentHeight += rp.itemAt(i).height
} }
rp.contentWidth += 200
rp.contentHeight += 200
} }
Flickable { Flickable {
id: flickable
anchors.fill: parent anchors.fill: parent
contentWidth: rp.contentWidth
contentHeight: rp.contentHeight
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AlwaysOff
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
} }
ScrollBar.horizontal: ScrollBar { ScrollBar.horizontal: ScrollBar {
policy: ScrollBar.AlwaysOff
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
} }
Repeater { Repeater {
id: rp id: rp
model: ScreenPlay.monitorListModel model: ScreenPlay.monitorListModel
property int contentWidth
property int contentHeight
Component.onCompleted: rp.itemAt(0).isSelected = true Component.onCompleted: rp.itemAt(0).isSelected = true

View File

@ -64,7 +64,7 @@ Item {
anchors.left: icon.right anchors.left: icon.right
anchors.leftMargin: 10 anchors.leftMargin: 10
font.pointSize: 14 font.pointSize: 14
color: Material.foreground color: Material.primaryTextColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.family: ScreenPlay.settings.font font.family: ScreenPlay.settings.font
font.weight: Font.Normal font.weight: Font.Normal