makeing PresentationEditor layout make more sense

This commit is contained in:
Chris Cochrun 2022-10-14 07:17:36 -05:00
parent 175182a32b
commit 8c3ebedf18

View file

@ -25,19 +25,16 @@ Item {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
Controls.ComboBox {
model: Qt.fontFamilies() Controls.TextField {
implicitWidth: 300 id: presentationTitleField
editable: true Layout.preferredWidth: 300
hoverEnabled: true placeholderText: "Title..."
/* onCurrentTextChanged: showPassiveNotification(currentText) */ text: presentation.title
} padding: 10
Controls.SpinBox { onEditingFinished: updateTitle(text);
editable: true
from: 5
to: 72
hoverEnabled: true
} }
Controls.ComboBox { Controls.ComboBox {
model: ["PRESENTATIONS", "Center", "Right", "Justify"] model: ["PRESENTATIONS", "Center", "Right", "Justify"]
implicitWidth: 100 implicitWidth: 100
@ -96,90 +93,53 @@ Item {
} }
} }
Controls.SplitView { ColumnLayout {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
/* Layout.minimumWidth: 300 */
Layout.alignment: Qt.AlignCenter
Layout.columnSpan: 2 Layout.columnSpan: 2
handle: Item{ spacing: 5
implicitWidth: 6
Rectangle { Item {
height: parent.height id: topEmpty
anchors.horizontalCenter: parent.horizontalCenter Layout.preferredHeight: 30
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 { Image {
id: presentationTitleField id: presentationPreview
Layout.preferredWidth: 1000
Layout.preferredWidth: 300 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 Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
placeholderText: "Title..."
text: presentation.title
padding: 10
onEditingFinished: updateTitle(text);
} }
Controls.ToolButton {
Item { id: rightArrow
id: empty text: "Next"
Layout.fillHeight: true icon.name: "next"
onClicked: presentationPreview.currentFrame = presentationPreview.currentFrame + 1
} }
} }
ColumnLayout { Item {
Controls.SplitView.fillHeight: true id: botEmpty
Controls.SplitView.preferredWidth: 700 Layout.fillHeight: true
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
}
} }
} }
} }