mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 18:24:46 +00:00
widgets/krunner: Restore milou
This commit is contained in:
parent
6160280b0c
commit
3f309067ef
2 changed files with 110 additions and 103 deletions
|
|
@ -15,7 +15,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
|
|
||||||
// import org.kde.milou 0.1 as Milou
|
import org.kde.milou 0.1 as Milou
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami 2.19 as Kirigami
|
||||||
|
|
||||||
import "../../components" as Components
|
import "../../components" as Components
|
||||||
|
|
@ -59,6 +59,9 @@ Item {
|
||||||
anim.restart();
|
anim.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// emitted when an item on the ListView is triggered
|
||||||
|
signal actionTriggered()
|
||||||
|
|
||||||
readonly property real closedContentY: PlasmaCore.Units.gridUnit * 5
|
readonly property real closedContentY: PlasmaCore.Units.gridUnit * 5
|
||||||
readonly property real openedContentY: 0
|
readonly property real openedContentY: 0
|
||||||
readonly property real openFactor: Math.max(0, Math.min(1, 1 - flickable.contentY / closedContentY))
|
readonly property real openFactor: Math.max(0, Math.min(1, 1 - flickable.contentY / closedContentY))
|
||||||
|
|
@ -184,108 +187,110 @@ Item {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
// Milou.ResultsListView {
|
Milou.ResultsListView {
|
||||||
// id: listView
|
id: listView
|
||||||
// queryString: queryField.text
|
queryString: queryField.text
|
||||||
// highlight: null
|
highlight: null
|
||||||
// clip: true
|
clip: true
|
||||||
// PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
|
PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
|
||||||
//
|
|
||||||
// onActivated: queryField.text = "";
|
onActivated: queryField.text = "";
|
||||||
// onUpdateQueryString: {
|
onUpdateQueryString: {
|
||||||
// queryField.text = text
|
queryField.text = text
|
||||||
// queryField.cursorPosition = cursorPosition
|
queryField.cursorPosition = cursorPosition
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// delegate: MouseArea {
|
delegate: MouseArea {
|
||||||
// id: delegate
|
id: delegate
|
||||||
// height: rowLayout.height
|
height: rowLayout.height
|
||||||
// width: listView.width
|
width: listView.width
|
||||||
//
|
|
||||||
// onClicked: {
|
onClicked: {
|
||||||
// listView.currentIndex = model.index;
|
listView.currentIndex = model.index;
|
||||||
// listView.runCurrentIndex();
|
listView.runCurrentIndex();
|
||||||
// }
|
|
||||||
// hoverEnabled: true
|
root.actionTriggered();
|
||||||
//
|
}
|
||||||
// Rectangle {
|
hoverEnabled: true
|
||||||
// anchors.fill: parent
|
|
||||||
// color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.containsMouse ? Qt.rgba(255, 255, 255, 0.05) : "transparent")
|
Rectangle {
|
||||||
// Behavior on color {
|
anchors.fill: parent
|
||||||
// ColorAnimation { duration: PlasmaCore.Units.shortDuration }
|
color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.containsMouse ? Qt.rgba(255, 255, 255, 0.05) : "transparent")
|
||||||
// }
|
Behavior on color {
|
||||||
// }
|
ColorAnimation { duration: PlasmaCore.Units.shortDuration }
|
||||||
//
|
}
|
||||||
// RowLayout {
|
}
|
||||||
// id: rowLayout
|
|
||||||
// height: PlasmaCore.Units.gridUnit * 3
|
RowLayout {
|
||||||
// anchors.top: parent.top
|
id: rowLayout
|
||||||
// anchors.left: parent.left
|
height: PlasmaCore.Units.gridUnit * 3
|
||||||
// anchors.right: parent.right
|
anchors.top: parent.top
|
||||||
// anchors.leftMargin: PlasmaCore.Units.largeSpacing
|
anchors.left: parent.left
|
||||||
// anchors.rightMargin: PlasmaCore.Units.largeSpacing
|
anchors.right: parent.right
|
||||||
//
|
anchors.leftMargin: PlasmaCore.Units.largeSpacing
|
||||||
// Kirigami.Icon {
|
anchors.rightMargin: PlasmaCore.Units.largeSpacing
|
||||||
// Layout.alignment: Qt.AlignVCenter
|
|
||||||
// source: model.decoration
|
Kirigami.Icon {
|
||||||
// implicitWidth: PlasmaCore.Units.iconSizes.medium
|
Layout.alignment: Qt.AlignVCenter
|
||||||
// implicitHeight: PlasmaCore.Units.iconSizes.medium
|
source: model.decoration
|
||||||
// }
|
implicitWidth: PlasmaCore.Units.iconSizes.medium
|
||||||
//
|
implicitHeight: PlasmaCore.Units.iconSizes.medium
|
||||||
// ColumnLayout {
|
}
|
||||||
// Layout.fillWidth: true
|
|
||||||
// Layout.alignment: Qt.AlignVCenter
|
ColumnLayout {
|
||||||
// spacing: PlasmaCore.Units.smallSpacing
|
Layout.fillWidth: true
|
||||||
//
|
Layout.alignment: Qt.AlignVCenter
|
||||||
// PlasmaComponents.Label {
|
spacing: PlasmaCore.Units.smallSpacing
|
||||||
// id: title
|
|
||||||
// Layout.fillWidth: true
|
PlasmaComponents.Label {
|
||||||
// Layout.leftMargin: PlasmaCore.Units.smallSpacing * 2
|
id: title
|
||||||
// Layout.rightMargin: PlasmaCore.Units.largeSpacing
|
Layout.fillWidth: true
|
||||||
//
|
Layout.leftMargin: PlasmaCore.Units.smallSpacing * 2
|
||||||
// maximumLineCount: 1
|
Layout.rightMargin: PlasmaCore.Units.largeSpacing
|
||||||
// elide: Text.ElideRight
|
|
||||||
// text: typeof modelData !== "undefined" ? modelData : model.display
|
maximumLineCount: 1
|
||||||
// color: "white"
|
elide: Text.ElideRight
|
||||||
//
|
text: typeof modelData !== "undefined" ? modelData : model.display
|
||||||
// font.pointSize: PlasmaCore.Theme.defaultFont.pointSize
|
color: "white"
|
||||||
// }
|
|
||||||
// PlasmaComponents.Label {
|
font.pointSize: PlasmaCore.Theme.defaultFont.pointSize
|
||||||
// id: subtitle
|
}
|
||||||
// Layout.fillWidth: true
|
PlasmaComponents.Label {
|
||||||
// Layout.leftMargin: PlasmaCore.Units.smallSpacing * 2
|
id: subtitle
|
||||||
// Layout.rightMargin: PlasmaCore.Units.largeSpacing
|
Layout.fillWidth: true
|
||||||
//
|
Layout.leftMargin: PlasmaCore.Units.smallSpacing * 2
|
||||||
// maximumLineCount: 1
|
Layout.rightMargin: PlasmaCore.Units.largeSpacing
|
||||||
// elide: Text.ElideRight
|
|
||||||
// text: model.subtext || ""
|
maximumLineCount: 1
|
||||||
// color: "white"
|
elide: Text.ElideRight
|
||||||
// opacity: 0.8
|
text: model.subtext || ""
|
||||||
//
|
color: "white"
|
||||||
// font.pointSize: Math.round(PlasmaCore.Theme.defaultFont.pointSize * 0.8)
|
opacity: 0.8
|
||||||
// }
|
|
||||||
// }
|
font.pointSize: Math.round(PlasmaCore.Theme.defaultFont.pointSize * 0.8)
|
||||||
//
|
}
|
||||||
// Repeater {
|
}
|
||||||
// id: actionsRepeater
|
|
||||||
// model: typeof actions !== "undefined" ? actions : []
|
Repeater {
|
||||||
//
|
id: actionsRepeater
|
||||||
// Controls.ToolButton {
|
model: typeof actions !== "undefined" ? actions : []
|
||||||
// icon: modelData.icon || ""
|
|
||||||
// visible: modelData.visible || true
|
Controls.ToolButton {
|
||||||
// enabled: modelData.enabled || true
|
icon: modelData.icon || ""
|
||||||
//
|
visible: modelData.visible || true
|
||||||
// Accessible.role: Accessible.Button
|
enabled: modelData.enabled || true
|
||||||
// Accessible.name: modelData.text
|
|
||||||
// checkable: checked
|
Accessible.role: Accessible.Button
|
||||||
// checked: delegate.activeAction === index
|
Accessible.name: modelData.text
|
||||||
// focus: delegate.activeAction === index
|
checkable: checked
|
||||||
// onClicked: delegate.ListView.view.runAction(index)
|
checked: delegate.activeAction === index
|
||||||
// }
|
focus: delegate.activeAction === index
|
||||||
// }
|
onClicked: delegate.ListView.view.runAction(index)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,8 @@ MobileShell.HomeScreen {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: openFactor > 0
|
visible: openFactor > 0
|
||||||
|
|
||||||
|
onActionTriggered: search.close()
|
||||||
|
|
||||||
topMargin: root.topMargin
|
topMargin: root.topMargin
|
||||||
bottomMargin: root.bottomMargin
|
bottomMargin: root.bottomMargin
|
||||||
leftMargin: root.leftMargin
|
leftMargin: root.leftMargin
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue