mirror of
https://github.com/kbumsik/VirtScreen.git
synced 2025-03-09 15:40:18 +00:00
QML: Added combobox to select device (no real effect on select yet)
This commit is contained in:
parent
6bee3d556a
commit
1e11c99b50
2 changed files with 32 additions and 1 deletions
26
main.qml
26
main.qml
|
|
@ -138,6 +138,32 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: "Device"; Layout.fillWidth: true }
|
||||
ComboBox {
|
||||
id: deviceComboBox
|
||||
textRole: "name"
|
||||
model: []
|
||||
|
||||
Component.onCompleted: {
|
||||
var screens = backend.screens;
|
||||
var list = [];
|
||||
for (var i = 0; i < screens.length; i++) {
|
||||
list.push(screens[i]);
|
||||
}
|
||||
deviceComboBox.model = list;
|
||||
}
|
||||
delegate: ItemDelegate {
|
||||
width: deviceComboBox.width
|
||||
text: modelData.name
|
||||
font.weight: deviceComboBox.currentIndex === index ? Font.DemiBold : Font.Normal
|
||||
highlighted: ListView.isCurrentItem
|
||||
enabled: modelData.connected? false: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue