fuse the top panel with krunner

This commit is contained in:
Marco Martin 2019-10-04 12:59:58 +02:00
parent 08b1e9a47d
commit 592481da73
3 changed files with 28 additions and 8 deletions

View file

@ -35,6 +35,7 @@ Rectangle {
color: listView.visible ? Qt.rgba(0, 0, 0, 0.8) : "transparent" color: listView.visible ? Qt.rgba(0, 0, 0, 0.8) : "transparent"
property alias showingResults: listView.visible property alias showingResults: listView.visible
property int inputHeight: queryField.height + background.fixedMargins.top/2 + background.fixedMargins.bottom property int inputHeight: queryField.height + background.fixedMargins.top/2 + background.fixedMargins.bottom
property int topPadding: 0
MouseArea { MouseArea {
enabled: listView.visible enabled: listView.visible
@ -70,14 +71,14 @@ Rectangle {
} }
ColumnLayout { ColumnLayout {
height: Qt.inputMethod.keyboardRectangle.height > 0 ? (Math.min(implicitHeight, background.height, Qt.inputMethod.keyboardRectangle.y - plasmoid.availableScreenRect.y)) : implicitHeight height: Qt.inputMethod.keyboardRectangle.height > 0 ? (Math.min(implicitHeight, background.height, Qt.inputMethod.keyboardRectangle.y - plasmoid.availableScreenRect.y)) : implicitHeight + anchors.topMargin
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
top: parent.top top: parent.top
topMargin: background.fixedMargins.top / 2 topMargin: background.fixedMargins.top / 2 + krunner.topPadding
leftMargin: background.fixedMargins.left / 2 leftMargin: background.fixedMargins.left
rightMargin: background.fixedMargins.right / 2 rightMargin: background.fixedMargins.right
} }
PlasmaComponents.TextField { PlasmaComponents.TextField {
id: queryField id: queryField

View file

@ -325,11 +325,11 @@ Item {
id: krunner id: krunner
z: 998 z: 998
height: plasmoid.availableScreenRect.height height: plasmoid.availableScreenRect.height
topPadding: plasmoid.availableScreenRect.y
anchors { anchors {
top: parent.top top: parent.top
left: parent.left left: parent.left
right: parent.right right: parent.right
topMargin: plasmoid.availableScreenRect.y
} }
} }
} }

View file

@ -24,6 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace
import org.kde.taskmanager 0.1 as TaskManager
import "LayoutManager.js" as LayoutManager import "LayoutManager.js" as LayoutManager
@ -32,14 +33,18 @@ import "quicksettings"
PlasmaCore.ColorScope { PlasmaCore.ColorScope {
id: root id: root
width: 480 width: 480
height: 640 height: 30
//colorGroup: PlasmaCore.Theme.ComplementaryColorGroup //colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
Plasmoid.backgroundHints: showingApp ? PlasmaCore.Types.StandardBackground : PlasmaCore.Types.NoBackground
property Item toolBox property Item toolBox
property int buttonHeight: width/4 property int buttonHeight: width/4
property bool reorderingApps: false property bool reorderingApps: false
property var layoutManager: LayoutManager property var layoutManager: LayoutManager
readonly property bool showingApp: tasksModel.activeTask && tasksModel.activeTask.valid && !tasksModel.data(tasksModel.activeTask, TaskManager.AbstractTasksModel.IsFullScreen)
Containment.onAppletAdded: { Containment.onAppletAdded: {
addApplet(applet, x, y); addApplet(applet, x, y);
LayoutManager.save(); LayoutManager.save();
@ -77,6 +82,16 @@ PlasmaCore.ColorScope {
LayoutManager.restore(); LayoutManager.restore();
} }
TaskManager.TasksModel {
id: tasksModel
sortMode: TaskManager.TasksModel.SortVirtualDesktop
groupMode: TaskManager.TasksModel.GroupDisabled
screenGeometry: plasmoid.screenGeometry
filterByScreen: plasmoid.configuration.showForCurrentScreenOnly
}
PlasmaCore.DataSource { PlasmaCore.DataSource {
id: statusNotifierSource id: statusNotifierSource
engine: "statusnotifieritem" engine: "statusnotifieritem"
@ -113,7 +128,7 @@ PlasmaCore.ColorScope {
interval: 60 * 1000 interval: 60 * 1000
} }
Rectangle { Item {
z: 1 z: 1
//parent: slidingPanel.visible && !slidingPanel.wideScreen ? panelContents : root //parent: slidingPanel.visible && !slidingPanel.wideScreen ? panelContents : root
anchors { anchors {
@ -122,7 +137,11 @@ PlasmaCore.ColorScope {
bottom: parent.bottom bottom: parent.bottom
} }
height: root.height height: root.height
color: PlasmaCore.ColorScope.backgroundColor Rectangle {
anchors.fill: parent
color: PlasmaCore.ColorScope.backgroundColor
opacity: showingApp
}
Loader { Loader {
id: strengthLoader id: strengthLoader