WIP: Refactor and create reusable CuraComboBox

This commit is contained in:
Lipu Fei 2019-03-12 14:36:08 +01:00
parent 3e4624774a
commit 752a48cacd
4 changed files with 175 additions and 133 deletions

View file

@ -8,6 +8,8 @@ import QtQuick.Layouts 1.3
import UM 1.3 as UM
import Cura 1.1 as Cura
import "../Widgets"
//
// ComboBox with dropdown options in the Machine Settings dialog.
@ -54,7 +56,6 @@ UM.TooltipArea
anchors.verticalCenter: comboBox.verticalCenter
visible: text != ""
elide: Text.ElideRight
//width: Math.max(0, settingsTabs.labelColumnWidth)
}
ListModel
@ -76,11 +77,12 @@ UM.TooltipArea
}
}
ComboBox
CuraComboBox
{
id: comboBox
width: 100
height: UM.Theme.getSize("action_button").height
model: optionsModel
textRole: "text"
currentIndex:
@ -97,6 +99,7 @@ UM.TooltipArea
}
return index
}
onActivated:
{
if(propertyProvider.properties.value != model.get(index).value)