mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-23 02:29:56 +00:00
initial plasma6 support
This commit is contained in:
@ -15,8 +15,8 @@
|
||||
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
|
||||
***************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.3 as QtControls
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls
|
||||
|
||||
|
||||
Row {
|
||||
@ -32,22 +32,24 @@ Row {
|
||||
|
||||
signal valueEdited(string newValue)
|
||||
|
||||
QtControls.Label {
|
||||
Label {
|
||||
id: label
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
QtControls.ComboBox {
|
||||
|
||||
ComboBox {
|
||||
id: comboBox
|
||||
width: parent.width * 3 / 5
|
||||
textRole: 'label'
|
||||
onCurrentIndexChanged: valueEdited(comboBox.model[comboBox.currentIndex]['name'])
|
||||
textRole: "label"
|
||||
onCurrentIndexChanged: valueEdited(comboBox.model[comboBox.currentIndex]["name"])
|
||||
|
||||
Component.onCompleted: {
|
||||
var total = comboBox.model.length
|
||||
for (var i = 0; i < total; i++) {
|
||||
if (comboBox.model[i]["name"] == value)
|
||||
const total = comboBox.model.length
|
||||
for (let i = 0; i < total; i++) {
|
||||
if (comboBox.model[i]["name"] === value)
|
||||
comboBox.currentIndex = i
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user