some minor ui fixes and ui for play/pause button for first slide
This commit is contained in:
parent
f5bff344c3
commit
7237601a3b
3 changed files with 81 additions and 18 deletions
|
@ -63,17 +63,17 @@ Item {
|
||||||
id: playArea
|
id: playArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: editMode
|
enabled: editMode
|
||||||
onPressed: mpv.playPause();
|
/* onPressed: mpv.playPause(); */
|
||||||
cursorShape: preview ? Qt.ArrowCursor : Qt.BlankCursor
|
cursorShape: preview ? Qt.ArrowCursor : Qt.BlankCursor
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.ProgressBar {
|
/* Controls.ProgressBar { */
|
||||||
anchors.top: parent.bottom
|
/* anchors.top: parent.bottom */
|
||||||
visible: editMode
|
/* width: mpv.width */
|
||||||
width: parent.width - 400
|
/* visible: editMode */
|
||||||
value: mpv.position
|
/* value: mpv.position */
|
||||||
to: mpv.duration
|
/* to: mpv.duration */
|
||||||
}
|
/* } */
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
|
@ -18,34 +18,82 @@ Item {
|
||||||
property string font
|
property string font
|
||||||
property real fontSize
|
property real fontSize
|
||||||
|
|
||||||
|
property bool playingVideo: false
|
||||||
|
|
||||||
property ListModel songs: songModel
|
property ListModel songs: songModel
|
||||||
|
|
||||||
|
property var firstItem
|
||||||
|
|
||||||
|
Controls.ToolButton {
|
||||||
|
id: playBackgroundButton
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
text: playingVideo ? "Pause" : "Play"
|
||||||
|
icon.name: playingVideo ? "media-pause" : "media-play"
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: playPauseSlide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Controls.ProgressBar {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: playBackgroundButton.right
|
||||||
|
anchors.leftMargin: 10
|
||||||
|
width: parent.width - playBackgroundButton.width - 10
|
||||||
|
height: playBackgroundButton.height
|
||||||
|
/* visible: editMode */
|
||||||
|
value: firstItem.mpvPosition
|
||||||
|
to: firstItem.mpvDuration
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: slideList
|
id: slideList
|
||||||
anchors.fill: parent
|
anchors.top: playBackgroundButton.bottom
|
||||||
|
anchors.topMargin: 20
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 10
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 20
|
||||||
|
width: parent.width
|
||||||
model: songModel
|
model: songModel
|
||||||
clip: true
|
clip: true
|
||||||
cacheBuffer: 900
|
cacheBuffer: 900
|
||||||
reuseItems: true
|
reuseItems: true
|
||||||
spacing: Kirigami.Units.gridUnit
|
spacing: Kirigami.Units.gridUnit
|
||||||
flickDeceleration: 4000
|
/* flickDeceleration: 4000 */
|
||||||
/* boundsMovement: Flickable.StopAtBounds */
|
/* boundsMovement: Flickable.StopAtBounds */
|
||||||
synchronousDrag: true
|
synchronousDrag: true
|
||||||
delegate: Presenter.Slide {
|
delegate: Presenter.Slide {
|
||||||
id: representation
|
id: representation
|
||||||
editMode: true
|
editMode: true
|
||||||
imageSource: root.imageBackground
|
imageSource: song.backgroundType = "image" ? song.background : ""
|
||||||
videoSource: root.videoBackground
|
videoSource: song.backgroundType = "video" ? song.background : ""
|
||||||
hTextAlignment: root.hTextAlignment
|
hTextAlignment: root.hTextAlignment
|
||||||
vTextAlignment: root.vTextAlignment
|
vTextAlignment: root.vTextAlignment
|
||||||
chosenFont: root.font
|
chosenFont: song.font
|
||||||
textSize: root.fontSize
|
textSize: song.fontSize
|
||||||
preview: true
|
preview: true
|
||||||
text: verse
|
text: verse
|
||||||
implicitWidth: slideList.width
|
implicitWidth: slideList.width
|
||||||
implicitHeight: width * 9 / 16
|
implicitHeight: width * 9 / 16
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Kirigami.WheelHandler {
|
||||||
|
id: wheelHandler
|
||||||
|
target: slideList
|
||||||
|
filterMouseEvents: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||||
|
parent: slideList.parent
|
||||||
|
anchors.top: slideList.top
|
||||||
|
anchors.left: slideList.right
|
||||||
|
anchors.bottom: slideList.bottom
|
||||||
|
active: hovered || pressed
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
@ -96,4 +144,11 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function playPauseSlide() {
|
||||||
|
firstItem = slideList.itemAtIndex(0)
|
||||||
|
playingVideo = !playingVideo;
|
||||||
|
slideList.itemAtIndex(0).editMode = false;
|
||||||
|
slideList.itemAtIndex(0).loadVideo();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,10 +224,10 @@ Item {
|
||||||
Layout.preferredWidth: 500
|
Layout.preferredWidth: 500
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.bottomMargin: 30
|
Layout.bottomMargin: 20
|
||||||
Layout.topMargin: 30
|
Layout.topMargin: 10
|
||||||
Layout.rightMargin: 20
|
Layout.rightMargin: 0
|
||||||
Layout.leftMargin: 20
|
Layout.leftMargin: 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,13 +328,19 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateBackground(background, backgroundType) {
|
function updateBackground(background, backgroundType) {
|
||||||
|
song.background = background;
|
||||||
|
song.backgroundType = backgroundType;
|
||||||
songsqlmodel.updateBackground(songIndex, background);
|
songsqlmodel.updateBackground(songIndex, background);
|
||||||
songsqlmodel.updateBackgroundType(songIndex, backgroundType);
|
songsqlmodel.updateBackgroundType(songIndex, backgroundType);
|
||||||
print("changed background");
|
print("changed background");
|
||||||
if (backgroundType === "image") {
|
if (backgroundType === "image") {
|
||||||
//todo
|
//todo
|
||||||
|
slideEditor.videoBackground = "";
|
||||||
|
slideEditor.imageBackground = background;
|
||||||
} else {
|
} else {
|
||||||
//todo
|
//todo
|
||||||
|
slideEditor.imageBackground = "";
|
||||||
|
slideEditor.videoBackground = background;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,11 +358,13 @@ Item {
|
||||||
function updateFont(font) {
|
function updateFont(font) {
|
||||||
changeSlideFont(font, false);
|
changeSlideFont(font, false);
|
||||||
songsqlmodel.updateFont(songIndex, font);
|
songsqlmodel.updateFont(songIndex, font);
|
||||||
|
song.font = font;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFontSize(fontSize) {
|
function updateFontSize(fontSize) {
|
||||||
changeSlideFontSize(fontSize, false);
|
changeSlideFontSize(fontSize, false);
|
||||||
songsqlmodel.updateFontSize(songIndex, fontSize);
|
songsqlmodel.updateFontSize(songIndex, fontSize);
|
||||||
|
song.fontSize = fontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSlideHAlignment(alignment) {
|
function changeSlideHAlignment(alignment) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue