1
0
Fork 0
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:
Bumsik Kim 2018-05-09 21:09:32 -04:00
parent 6bee3d556a
commit 1e11c99b50
No known key found for this signature in database
GPG key ID: E31041C8EC5B01C6
2 changed files with 32 additions and 1 deletions

View file

@ -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
}
}
}
}
}