Verified Commit 6dcc89c3 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/konsoleprofiles: port to `PC3.ItemDelegate`

No need to create another item.
parent ff9fd357
Pipeline #210968 passed with stage
in 1 minute and 22 seconds
......@@ -87,62 +87,39 @@ FocusScope {
ListView {
id: view
model: sortModel
clip: true
focus: true
keyNavigationWraps: true
delegate: Item {
delegate: PlasmaComponents3.ItemDelegate {
id: listdelegate
height: textMetric.paintedHeight * 2
anchors {
left: parent.left
right: parent.right
}
height: textMetric.paintedHeight * 2
function openProfile() {
/*var service = profilesSource.serviceForSource(model["DataEngineSource"])
var operation = service.operationDescription("open")
var = service.startOperationCall(operation)*/
console.error(model.profileIdentifier)
profilesModel.openProfile(model.profileIdentifier)
}
PlasmaComponents3.Label {
id: profileText
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
right: parent.right
leftMargin: 10
rightMargin: 10
}
hoverEnabled: true
text: model.name
verticalAlignment: Text.AlignVCenter
text: model.name
elide: Text.ElideRight
onClicked: {
openProfile();
}
MouseArea {
height: parent.height + 15
anchors { left: parent.left; right: parent.right;}
hoverEnabled: true
onClicked: {
openProfile();
}
onEntered: {
onHoveredChanged: {
if (hovered) {
view.currentIndex = index;
}
}
Keys.onPressed: {
if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return)
openProfile();
function openProfile() {
/*var service = profilesSource.serviceForSource(model["DataEngineSource"])
var operation = service.operationDescription("open")
var = service.startOperationCall(operation)*/
console.error(model.profileIdentifier)
profilesModel.openProfile(model.profileIdentifier)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment