
This required switching from a QML Window to a QQuickView in C++. I want to try to eventually subclass that in Rust, but for now it works. I'll have to still tinker with this to find out how to specifically set the screen in certain environments, but for now the user will need to move the window on their own.
66 lines
2 KiB
QML
66 lines
2 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Dialogs 1.0
|
|
import QtQuick.Controls 2.15 as Controls
|
|
import QtQuick.Layouts 1.15
|
|
import org.kde.kirigami 2.13 as Kirigami
|
|
import "./" as Presenter
|
|
import org.presenter 1.0
|
|
import Qt.labs.settings 1.0
|
|
|
|
Kirigami.OverlaySheet {
|
|
id: root
|
|
property ListModel theModel
|
|
|
|
header: Kirigami.Heading {
|
|
text: "Settings"
|
|
}
|
|
|
|
/* Component.onCompleted: { */
|
|
/* showPassiveNotification(screenModel.get(1).name) */
|
|
/* } */
|
|
|
|
Kirigami.FormLayout {
|
|
implicitHeight: Kirigami.Units.gridUnit * 30
|
|
Controls.ComboBox {
|
|
id: screenSelectionField
|
|
Kirigami.FormData.label: i18nc("@label:textbox", "Presentation Screen:")
|
|
model: screens
|
|
textRole: "name"
|
|
onActivated: {
|
|
presentationScreen = screens[currentIndex];
|
|
console.log(PresWindow.screen);
|
|
PresWindow.screen = screens[currentIndex];
|
|
console.log(PresWindow.screen);
|
|
}
|
|
|
|
popup: Controls.Popup {
|
|
y: screenSelectionField.height + 10
|
|
z: 1000
|
|
width: screenSelectionField.width
|
|
implicitHeight: contentItem.implicitHeight
|
|
padding: 1
|
|
|
|
contentItem: ListView {
|
|
clip: true
|
|
implicitHeight: contentHeight
|
|
model: screenSelectionField.popup.visible ? screenSelectionField.delegateModel : null
|
|
currentIndex: screenSelectionField.highlightedIndex
|
|
|
|
Controls.ScrollIndicator.vertical: Controls.ScrollIndicator { }
|
|
}
|
|
|
|
background: Rectangle {
|
|
border.color: Kirigami.Theme.hoverColor
|
|
radius: 2
|
|
}
|
|
}
|
|
}
|
|
Controls.ToolButton {
|
|
id: soundEffectBut
|
|
Kirigami.FormData.label: i18nc("@label:button", "Sound Effect:")
|
|
text: "Sound Effect"
|
|
onClicked: soundFileDialog.open()
|
|
}
|
|
}
|
|
|
|
}
|