visually see slides
This commit is contained in:
parent
983bb24259
commit
d70cd4091c
2 changed files with 42 additions and 70 deletions
|
@ -187,7 +187,7 @@ FocusScope {
|
||||||
spacing: Kirigami.Units.smallSpacing * 2
|
spacing: Kirigami.Units.smallSpacing * 2
|
||||||
cacheBuffer: 900
|
cacheBuffer: 900
|
||||||
reuseItems: true
|
reuseItems: true
|
||||||
model: ServiceItemModel
|
model: SlideModel
|
||||||
delegate: Presenter.PreviewSlideListDelegate {}
|
delegate: Presenter.PreviewSlideListDelegate {}
|
||||||
|
|
||||||
Kirigami.WheelHandler {
|
Kirigami.WheelHandler {
|
||||||
|
|
|
@ -8,18 +8,14 @@ import org.presenter 1.0
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
// Lets set the outerModelData so we can access that data here.
|
// Lets set the outerModelData so we can access that data here.
|
||||||
property var outerModelData: model;
|
|
||||||
|
|
||||||
implicitHeight: Kirigami.Units.gridUnit * 6.5
|
implicitHeight: Kirigami.Units.gridUnit * 6.5
|
||||||
implicitWidth: {
|
implicitWidth: Kirigami.Units.gridUnit * 10
|
||||||
let slides = outerModelData.slideNumber === 0 ? 1 : outerModelData.slideNumber
|
|
||||||
return Kirigami.Units.gridUnit * 10 * slides + Kirigami.Units.smallSpacing * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: previewHighlight
|
id: previewHighlight
|
||||||
|
anchors.centerIn: parent
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height - slidesTitle.height - 5
|
||||||
border.color: Kirigami.Theme.highlightColor
|
border.color: Kirigami.Theme.highlightColor
|
||||||
radius: 5
|
radius: 5
|
||||||
color: {
|
color: {
|
||||||
|
@ -29,74 +25,50 @@ Item {
|
||||||
Kirigami.Theme.backgroundColor
|
Kirigami.Theme.backgroundColor
|
||||||
}
|
}
|
||||||
|
|
||||||
// I couldn't get another listview to work but I may try it again
|
Presenter.Slide {
|
||||||
Row {
|
id: previewSlideItem
|
||||||
id: slidesList
|
anchors.centerIn: parent
|
||||||
spacing: Kirigami.Units.smallSpacing * 2
|
implicitWidth: height / 9 * 16
|
||||||
anchors.fill: parent
|
implicitHeight: parent.height - Kirigami.Units.smallSpacing * 2
|
||||||
padding: Kirigami.Units.smallSpacing * 2
|
textSize: width / 4
|
||||||
Repeater {
|
itemType: type
|
||||||
id: slidesListRepeater
|
imageSource: imageBackground
|
||||||
model: outerModelData.slideNumber === 0 ? 1 : outerModelData.slideNumber
|
videoSource: videoBackground
|
||||||
Component.onCompleted: {
|
audioSource: ""
|
||||||
if (name === "Death Was Arrested") {
|
chosenFont: font
|
||||||
console.log("Number of slides: " + outerModelData.slideNumber);
|
text: text
|
||||||
console.log("model number: " + model);
|
pdfIndex: slideIndex
|
||||||
}
|
preview: true
|
||||||
}
|
editMode: true
|
||||||
/* Rectangle { width: 20; height: 20; radius: 10; color: "green" } */
|
|
||||||
Presenter.Slide {
|
|
||||||
id: previewSlideItem
|
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 10 - Kirigami.Units.smallSpacing * 2
|
|
||||||
implicitHeight: width / 16 * 9
|
|
||||||
textSize: width / 4
|
|
||||||
itemType: outerModelData.type
|
|
||||||
imageSource: outerModelData.backgroundType === "image" ? background : ""
|
|
||||||
videoSource: outerModelData.backgroundType === "video" ? background : ""
|
|
||||||
audioSource: ""
|
|
||||||
chosenFont: outerModelData.font
|
|
||||||
text: outerModelData.text[index] === "This is demo text" ? "" : outerModelData.text[index]
|
|
||||||
pdfIndex: outerModelData.type != "presentation" ? 0 : index
|
|
||||||
preview: true
|
|
||||||
editMode: true
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: innerMouse
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: changeSlideAndIndex(outerModelData, index)
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: slidesTitle
|
id: slidesTitle
|
||||||
width: parent.width * 7
|
width: parent.width * 7
|
||||||
anchors.top: slidesList.bottom
|
anchors.top: previewHighlight.bottom
|
||||||
anchors.leftMargin: Kirigami.Units.smallSpacing * 8
|
/* anchors.leftMargin: Kirigami.Units.smallSpacing * 8 */
|
||||||
anchors.topMargin: 5
|
anchors.topMargin: 5
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
text: name
|
text: ServiceItemModel.getItem(serviceItemId).name
|
||||||
/* font.family: "Quicksand Bold" */
|
/* font.family: "Quicksand Bold" */
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: previewerMouse
|
id: previewerMouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
/* onClicked: changeServiceItem(index) */
|
/* onClicked: changeServiceItem(index) */
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: ServiceItemModel
|
target: SlideModel
|
||||||
onDataChanged: if (active)
|
onDataChanged: if (active)
|
||||||
previewSlidesList.positionViewAtIndex(index, ListView.Contain)
|
previewSlidesList.positionViewAtIndex(index, ListView.Contain)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSlideAndIndex(serviceItem, index) {
|
function changeSlideAndIndex(serviceItem, index) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue