some changes to the gridview and presentation previewer
This commit is contained in:
parent
1dfe58c996
commit
ca399bb8cd
3 changed files with 161 additions and 118 deletions
|
@ -275,7 +275,7 @@ Controls.Page {
|
||||||
function present(present) {
|
function present(present) {
|
||||||
if (present)
|
if (present)
|
||||||
{
|
{
|
||||||
presentation.loadVideo();
|
/* presentation.loadVideo(); */
|
||||||
console.log("For window: Screen is: " + pWindow.screen + " And selected screen is: " + presentationScreen);
|
console.log("For window: Screen is: " + pWindow.screen + " And selected screen is: " + presentationScreen);
|
||||||
pWindow.showFullScreen();
|
pWindow.showFullScreen();
|
||||||
/* pWindow.screen = presentationScreen; */
|
/* pWindow.screen = presentationScreen; */
|
||||||
|
|
|
@ -46,13 +46,17 @@ FocusScope {
|
||||||
text: "Solo"
|
text: "Solo"
|
||||||
icon.name: "viewimage"
|
icon.name: "viewimage"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: serviceThing.slapVariantAround(ServiceItemModel.getItems());
|
onClicked: {
|
||||||
|
stack.replace(presenterView)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Controls.ToolButton {
|
Controls.ToolButton {
|
||||||
text: "Grid"
|
text: "Grid"
|
||||||
icon.name: "view-app-grid-symbolic"
|
icon.name: "view-app-grid-symbolic"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: serviceThing.checkActive();
|
onClicked: {
|
||||||
|
stack.replace(gridView)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Controls.ToolButton {
|
Controls.ToolButton {
|
||||||
text: "Details"
|
text: "Details"
|
||||||
|
@ -80,148 +84,186 @@ FocusScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Controls.StackView {
|
||||||
id: presenterView
|
id: stack
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
initialItem: presenterView
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: presenterView
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: slideArea
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.bottomMargin: previewSlidesList.height
|
Item {
|
||||||
|
id: slideArea
|
||||||
|
implicitWidth: parent.width
|
||||||
|
implicitHeight: parent.height - previewSlidesList.height
|
||||||
|
/* anchors.bottomMargin: previewSlidesList.height */
|
||||||
|
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
source: "arrow-left"
|
source: "arrow-left"
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 7
|
implicitWidth: Kirigami.Units.gridUnit * 7
|
||||||
implicitHeight: Kirigami.Units.gridUnit * 10
|
implicitHeight: Kirigami.Units.gridUnit * 10
|
||||||
anchors.right: previewSlide.left
|
anchors.right: previewSlide.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressed: previousSlideAction()
|
onPressed: previousSlideAction()
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Presenter.Slide {
|
||||||
|
id: previewSlide
|
||||||
|
implicitWidth: root.width - 400 > 200 ? root.width - 400 : 200
|
||||||
|
implicitHeight: width / 16 * 9
|
||||||
|
anchors.centerIn: parent
|
||||||
|
textSize: SlideObject.fontSize
|
||||||
|
itemType: SlideObject.type
|
||||||
|
imageSource: SlideObject.imageBackground
|
||||||
|
videoSource: SlideObject.videoBackground
|
||||||
|
audioSource: SlideObject.audio
|
||||||
|
chosenFont: SlideObject.font
|
||||||
|
text: SlideObject.text
|
||||||
|
pdfIndex: SlideObject.pdfIndex
|
||||||
|
preview: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.Icon {
|
||||||
|
source: "arrow-right"
|
||||||
|
implicitWidth: Kirigami.Units.gridUnit * 7
|
||||||
|
implicitHeight: Kirigami.Units.gridUnit * 10
|
||||||
|
anchors.left: previewSlide.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: nextSlideAction()
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 2
|
||||||
|
width: previewSlide.width
|
||||||
|
/* Layout.alignment: Qt.AlignHCenter, Qt.AlignTop */
|
||||||
|
anchors.top: previewSlide.bottom
|
||||||
|
anchors.topMargin: 10
|
||||||
|
anchors.horizontalCenter: previewSlide.horizontalCenter
|
||||||
|
/* Layout.columnSpan: 3 */
|
||||||
|
visible: itemType === "video";
|
||||||
|
Controls.ToolButton {
|
||||||
|
Layout.preferredWidth: 25
|
||||||
|
Layout.preferredHeight: 25
|
||||||
|
icon.name: previewSlide.mpvIsPlaying ? "media-pause" : "media-play"
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: SlideObject.playPause();
|
||||||
|
}
|
||||||
|
Controls.Slider {
|
||||||
|
id: videoSlider
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 25
|
||||||
|
from: 0
|
||||||
|
to: previewSlide.mpvDuration
|
||||||
|
value: previewSlide.mpvPosition
|
||||||
|
live: true
|
||||||
|
onMoved: changeVidPos(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.Switch {
|
||||||
|
text: "Loop"
|
||||||
|
checked: previewSlide.mpvLoop === "inf" ? true : false
|
||||||
|
onToggled: mainPage.loopVideo()
|
||||||
|
Keys.onLeftPressed: previousSlideAction()
|
||||||
|
Keys.onRightPressed: nextSlideAction()
|
||||||
|
Keys.onUpPressed: previousSlideAction()
|
||||||
|
Keys.onDownPressed: nextSlideAction()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Presenter.Slide {
|
ListView {
|
||||||
id: previewSlide
|
// The active items X value from root
|
||||||
implicitWidth: root.width - 400 > 200 ? root.width - 400 : 200
|
property int activeX
|
||||||
implicitHeight: width / 16 * 9
|
id: previewSlidesList
|
||||||
anchors.centerIn: parent
|
anchors.bottom: parent.bottom
|
||||||
textSize: SlideObject.fontSize
|
width: parent.width
|
||||||
itemType: SlideObject.type
|
height: Kirigami.Units.gridUnit * 9
|
||||||
imageSource: SlideObject.imageBackground
|
orientation: ListView.Horizontal
|
||||||
videoSource: SlideObject.videoBackground
|
spacing: Kirigami.Units.smallSpacing * 2
|
||||||
audioSource: SlideObject.audio
|
cacheBuffer: 900
|
||||||
chosenFont: SlideObject.font
|
reuseItems: true
|
||||||
text: SlideObject.text
|
model: SlideModel
|
||||||
pdfIndex: SlideObject.pdfIndex
|
delegate: Presenter.PreviewSlideListDelegate {}
|
||||||
preview: true
|
|
||||||
|
Kirigami.WheelHandler {
|
||||||
|
id: wheelHandler
|
||||||
|
target: previewSlidesList
|
||||||
|
filterMouseEvents: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.ScrollBar.horizontal: Controls.ScrollBar {
|
||||||
|
active: hovered || pressed
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Icon {
|
Rectangle {
|
||||||
source: "arrow-right"
|
id: activeHighlightBar
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 7
|
width: Kirigami.Units.gridUnit * 10
|
||||||
implicitHeight: Kirigami.Units.gridUnit * 10
|
height: Kirigami.Units.gridUnit / 4
|
||||||
anchors.left: previewSlide.right
|
y: previewSlidesList.y + Kirigami.Units.gridUnit * 6.15
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
x: previewSlidesList.currentItem.x + Kirigami.Units.smallSpacing
|
||||||
MouseArea {
|
radius: 5
|
||||||
anchors.fill: parent
|
color: Kirigami.Theme.negativeTextColor
|
||||||
onPressed: nextSlideAction()
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
Behavior on x { PropertyAnimation {
|
||||||
}
|
properties: "x"
|
||||||
|
easing.type: Easing.InOutElastic;
|
||||||
|
easing.period: 1.5
|
||||||
|
duration: 150
|
||||||
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
spacing: 2
|
|
||||||
width: previewSlide.width
|
|
||||||
/* Layout.alignment: Qt.AlignHCenter, Qt.AlignTop */
|
|
||||||
anchors.top: previewSlide.bottom
|
|
||||||
anchors.topMargin: 10
|
|
||||||
anchors.horizontalCenter: previewSlide.horizontalCenter
|
|
||||||
/* Layout.columnSpan: 3 */
|
|
||||||
visible: itemType === "video";
|
|
||||||
Controls.ToolButton {
|
|
||||||
Layout.preferredWidth: 25
|
|
||||||
Layout.preferredHeight: 25
|
|
||||||
icon.name: previewSlide.mpvIsPlaying ? "media-pause" : "media-play"
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: SlideObject.playPause();
|
|
||||||
}
|
|
||||||
Controls.Slider {
|
|
||||||
id: videoSlider
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 25
|
|
||||||
from: 0
|
|
||||||
to: previewSlide.mpvDuration
|
|
||||||
value: previewSlide.mpvPosition
|
|
||||||
live: true
|
|
||||||
onMoved: changeVidPos(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
Controls.Switch {
|
|
||||||
text: "Loop"
|
|
||||||
checked: previewSlide.mpvLoop === "inf" ? true : false
|
|
||||||
onToggled: mainPage.loopVideo()
|
|
||||||
Keys.onLeftPressed: previousSlideAction()
|
|
||||||
Keys.onRightPressed: nextSlideAction()
|
|
||||||
Keys.onUpPressed: previousSlideAction()
|
|
||||||
Keys.onDownPressed: nextSlideAction()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
Component {
|
||||||
|
id: gridView
|
||||||
|
/* Layout.fillHeight: true */
|
||||||
|
/* Layout.fillWidth: true */
|
||||||
|
/* Layout.alignment: Qt.AlignTop */
|
||||||
|
/* visible: false */
|
||||||
|
|
||||||
|
GridView {
|
||||||
// The active items X value from root
|
// The active items X value from root
|
||||||
property int activeX
|
property int activeX
|
||||||
id: previewSlidesList
|
id: previewSlidesGrid
|
||||||
anchors.bottom: presenterView.bottom
|
anchors.fill: parent
|
||||||
width: parent.width
|
cellWidth: Kirigami.Units.gridUnit * 11
|
||||||
height: Kirigami.Units.gridUnit * 9
|
cellHeight: Kirigami.Units.gridUnit * 8
|
||||||
orientation: ListView.Horizontal
|
/* spacing: Kirigami.Units.smallSpacing * 2 */
|
||||||
spacing: Kirigami.Units.smallSpacing * 2
|
cacheBuffer: 200
|
||||||
cacheBuffer: 900
|
reuseItems: false
|
||||||
reuseItems: true
|
clip: true
|
||||||
model: SlideModel
|
model: SlideModel
|
||||||
delegate: Presenter.PreviewSlideListDelegate {}
|
delegate: Presenter.PreviewSlideListDelegate { showVidBG: false }
|
||||||
|
|
||||||
Kirigami.WheelHandler {
|
Kirigami.WheelHandler {
|
||||||
id: wheelHandler
|
id: gridWheelHandler
|
||||||
target: previewSlidesList
|
target: previewSlidesGrid
|
||||||
filterMouseEvents: true
|
filterMouseEvents: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.ScrollBar.horizontal: Controls.ScrollBar {
|
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||||
active: hovered || pressed
|
active: hovered || pressed
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: activeHighlightBar
|
|
||||||
width: Kirigami.Units.gridUnit * 10
|
|
||||||
height: Kirigami.Units.gridUnit / 4
|
|
||||||
y: previewSlidesList.y + Kirigami.Units.gridUnit * 6.15
|
|
||||||
x: previewSlidesList.currentItem.x + Kirigami.Units.smallSpacing
|
|
||||||
radius: 5
|
|
||||||
color: Kirigami.Theme.negativeTextColor
|
|
||||||
|
|
||||||
Behavior on x { PropertyAnimation {
|
|
||||||
properties: "x"
|
|
||||||
easing.type: Easing.InOutElastic;
|
|
||||||
easing.period: 1.5
|
|
||||||
duration: 150
|
|
||||||
}}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: gridView
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
visible: false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
implicitHeight: Kirigami.Units.gridUnit * 6.5
|
implicitHeight: Kirigami.Units.gridUnit * 6.5
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 10
|
implicitWidth: Kirigami.Units.gridUnit * 10
|
||||||
|
property bool showVidBG
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: previewHighlight
|
id: previewHighlight
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
@ -31,7 +32,7 @@ Item {
|
||||||
textSize: model.fontSize
|
textSize: model.fontSize
|
||||||
itemType: model.type
|
itemType: model.type
|
||||||
imageSource: model.imageBackground
|
imageSource: model.imageBackground
|
||||||
videoSource: model.videoBackground
|
videoSource: showVidBG ? model.videoBackground : ""
|
||||||
audioSource: ""
|
audioSource: ""
|
||||||
chosenFont: model.font
|
chosenFont: model.font
|
||||||
text: model.text
|
text: model.text
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue