adding a presentation editor and ui to get there
This commit is contained in:
parent
f32c92c0ce
commit
ed58e2cda1
4 changed files with 212 additions and 2 deletions
|
@ -845,7 +845,7 @@ Item {
|
||||||
dragItemTitle = title;
|
dragItemTitle = title;
|
||||||
dragItemType = "pres";
|
dragItemType = "pres";
|
||||||
dragItemText = "";
|
dragItemText = "";
|
||||||
dragItemBackgroundType = "pres";
|
dragItemBackgroundType = "image";
|
||||||
dragItemBackground = filePath;
|
dragItemBackground = filePath;
|
||||||
} else {
|
} else {
|
||||||
presListItem.Drag.drop()
|
presListItem.Drag.drop()
|
||||||
|
@ -866,7 +866,7 @@ Item {
|
||||||
const pres = pressqlmodel.getPresentation(presentationLibraryList.currentIndex);
|
const pres = pressqlmodel.getPresentation(presentationLibraryList.currentIndex);
|
||||||
if (!editMode)
|
if (!editMode)
|
||||||
editMode = true;
|
editMode = true;
|
||||||
editType = "pres";
|
editType = "presentation";
|
||||||
editSwitch(pres);
|
editSwitch(pres);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,12 @@ Controls.Page {
|
||||||
visible: false
|
visible: false
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Presenter.PresentationEditor {
|
||||||
|
id: presentationEditor
|
||||||
|
visible: false
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Presenter.Library {
|
Presenter.Library {
|
||||||
|
@ -153,6 +159,7 @@ Controls.Page {
|
||||||
videoEditor.visible = false;
|
videoEditor.visible = false;
|
||||||
videoEditor.stop();
|
videoEditor.stop();
|
||||||
imageEditor.visible = false;
|
imageEditor.visible = false;
|
||||||
|
presentationEditor.visible = false;
|
||||||
songEditor.visible = true;
|
songEditor.visible = true;
|
||||||
songEditor.changeSong(item);
|
songEditor.changeSong(item);
|
||||||
break;
|
break;
|
||||||
|
@ -160,6 +167,7 @@ Controls.Page {
|
||||||
presentation.visible = false;
|
presentation.visible = false;
|
||||||
songEditor.visible = false;
|
songEditor.visible = false;
|
||||||
imageEditor.visible = false;
|
imageEditor.visible = false;
|
||||||
|
presentationEditor.visible = false;
|
||||||
videoEditor.visible = true;
|
videoEditor.visible = true;
|
||||||
videoEditor.changeVideo(item);
|
videoEditor.changeVideo(item);
|
||||||
break;
|
break;
|
||||||
|
@ -168,14 +176,25 @@ Controls.Page {
|
||||||
videoEditor.visible = false;
|
videoEditor.visible = false;
|
||||||
videoEditor.stop();
|
videoEditor.stop();
|
||||||
songEditor.visible = false;
|
songEditor.visible = false;
|
||||||
|
presentationEditor.visible = false;
|
||||||
imageEditor.visible = true;
|
imageEditor.visible = true;
|
||||||
imageEditor.changeImage(item);
|
imageEditor.changeImage(item);
|
||||||
break;
|
break;
|
||||||
|
case "presentation" :
|
||||||
|
presentation.visible = false;
|
||||||
|
videoEditor.visible = false;
|
||||||
|
videoEditor.stop();
|
||||||
|
songEditor.visible = false;
|
||||||
|
imageEditor.visible = false;
|
||||||
|
presentationEditor.visible = true;
|
||||||
|
presentationEditor.changePresentation(item);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
videoEditor.visible = false;
|
videoEditor.visible = false;
|
||||||
videoEditor.stop();
|
videoEditor.stop();
|
||||||
songEditor.visible = false;
|
songEditor.visible = false;
|
||||||
imageEditor.visible = false;
|
imageEditor.visible = false;
|
||||||
|
presentationEditor.visible = false;
|
||||||
presentation.visible = true;
|
presentation.visible = true;
|
||||||
editMode = false;
|
editMode = false;
|
||||||
}
|
}
|
||||||
|
|
190
src/qml/presenter/PresentationEditor.qml
Normal file
190
src/qml/presenter/PresentationEditor.qml
Normal file
|
@ -0,0 +1,190 @@
|
||||||
|
import QtQuick 2.13
|
||||||
|
import QtQuick.Controls 2.15 as Controls
|
||||||
|
import QtQuick.Dialogs 1.3
|
||||||
|
import QtQuick.Layouts 1.2
|
||||||
|
import org.kde.kirigami 2.13 as Kirigami
|
||||||
|
import "./" as Presenter
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string type: "presentation"
|
||||||
|
property var presentation
|
||||||
|
|
||||||
|
GridLayout {
|
||||||
|
id: mainLayout
|
||||||
|
anchors.fill: parent
|
||||||
|
columns: 2
|
||||||
|
rowSpacing: 5
|
||||||
|
columnSpacing: 0
|
||||||
|
|
||||||
|
Controls.ToolBar {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
id: toolbar
|
||||||
|
RowLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Controls.ComboBox {
|
||||||
|
model: Qt.fontFamilies()
|
||||||
|
implicitWidth: 300
|
||||||
|
editable: true
|
||||||
|
hoverEnabled: true
|
||||||
|
/* onCurrentTextChanged: showPassiveNotification(currentText) */
|
||||||
|
}
|
||||||
|
Controls.SpinBox {
|
||||||
|
editable: true
|
||||||
|
from: 5
|
||||||
|
to: 72
|
||||||
|
hoverEnabled: true
|
||||||
|
}
|
||||||
|
Controls.ComboBox {
|
||||||
|
model: ["PRESENTATIONS", "Center", "Right", "Justify"]
|
||||||
|
implicitWidth: 100
|
||||||
|
hoverEnabled: true
|
||||||
|
}
|
||||||
|
Controls.ToolSeparator {}
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
|
Controls.ToolSeparator {}
|
||||||
|
Controls.ToolButton {
|
||||||
|
text: "Effects"
|
||||||
|
icon.name: "presentation-auto-adjust"
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: {}
|
||||||
|
}
|
||||||
|
Controls.ToolButton {
|
||||||
|
id: backgroundButton
|
||||||
|
text: "Select Presentation"
|
||||||
|
icon.name: "fileopen"
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: backgroundType.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.Popup {
|
||||||
|
id: backgroundType
|
||||||
|
x: backgroundButton.x
|
||||||
|
y: backgroundButton.y + backgroundButton.height + 20
|
||||||
|
modal: true
|
||||||
|
focus: true
|
||||||
|
dim: false
|
||||||
|
background: Rectangle {
|
||||||
|
Kirigami.Theme.colorSet: Kirigami.Theme.Tooltip
|
||||||
|
color: Kirigami.Theme.backgroundColor
|
||||||
|
radius: 10
|
||||||
|
border.color: Kirigami.Theme.activeBackgroundColor
|
||||||
|
border.width: 2
|
||||||
|
}
|
||||||
|
closePolicy: Controls.Popup.CloseOnEscape | Controls.Popup.CloseOnPressOutsideParent
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
Controls.ToolButton {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: "Presentation"
|
||||||
|
icon.name: "emblem-presentations-symbolic"
|
||||||
|
onClicked: presentationFileDialog.open() & backgroundType.close()
|
||||||
|
}
|
||||||
|
Controls.ToolButton {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: "Presentation"
|
||||||
|
icon.name: "folder-pictures-symbolic"
|
||||||
|
onClicked: presentationFileDialog.open() & backgroundType.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.SplitView {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
handle: Item{
|
||||||
|
implicitWidth: 6
|
||||||
|
Rectangle {
|
||||||
|
height: parent.height
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
width: 1
|
||||||
|
color: Controls.SplitHandle.hovered ? Kirigami.Theme.hoverColor : Kirigami.Theme.backgroundColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Controls.SplitView.fillHeight: true
|
||||||
|
Controls.SplitView.preferredWidth: 300
|
||||||
|
Controls.SplitView.minimumWidth: 100
|
||||||
|
|
||||||
|
Controls.TextField {
|
||||||
|
id: presentationTitleField
|
||||||
|
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: 20
|
||||||
|
Layout.rightMargin: 20
|
||||||
|
|
||||||
|
placeholderText: "Title..."
|
||||||
|
text: presentation.title
|
||||||
|
padding: 10
|
||||||
|
/* onEditingFinished: updateTitle(text); */
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: empty
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
Controls.SplitView.fillHeight: true
|
||||||
|
Controls.SplitView.preferredWidth: 700
|
||||||
|
Controls.SplitView.minimumWidth: 300
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: topEmpty
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: presentationPreview
|
||||||
|
Layout.preferredWidth: 600
|
||||||
|
Layout.preferredHeight: Layout.preferredWidth / 16 * 9
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
source: presentation.filePath
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true;
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
Layout.leftMargin: 50
|
||||||
|
Layout.rightMargin: 50
|
||||||
|
Controls.ToolButton {
|
||||||
|
id: leftArrow
|
||||||
|
text: "Back"
|
||||||
|
icon.name: "back"
|
||||||
|
onClicked: presentationPreview.currentFrame = presentationPreview.currentFrame - 1
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
Controls.ToolButton {
|
||||||
|
id: rightArrow
|
||||||
|
text: "Next"
|
||||||
|
icon.name: "next"
|
||||||
|
onClicked: presentationPreview.currentFrame = presentationPreview.currentFrame + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
id: botEmpty
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function changePresentation(presentation) {
|
||||||
|
root.presentation = presentation;
|
||||||
|
print(presentation.filePath.toString());
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,6 +12,7 @@
|
||||||
<file>qml/presenter/SongEditor.qml</file>
|
<file>qml/presenter/SongEditor.qml</file>
|
||||||
<file>qml/presenter/VideoEditor.qml</file>
|
<file>qml/presenter/VideoEditor.qml</file>
|
||||||
<file>qml/presenter/ImageEditor.qml</file>
|
<file>qml/presenter/ImageEditor.qml</file>
|
||||||
|
<file>qml/presenter/PresentationEditor.qml</file>
|
||||||
<file>qml/presenter/Slide.qml</file>
|
<file>qml/presenter/Slide.qml</file>
|
||||||
<file>qml/presenter/SlideEditor.qml</file>
|
<file>qml/presenter/SlideEditor.qml</file>
|
||||||
<file>qml/presenter/DragHandle.qml</file>
|
<file>qml/presenter/DragHandle.qml</file>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue