foxes to the top panel effect

This commit is contained in:
Marco Martin 2019-12-11 23:00:38 +01:00
parent 28909aad84
commit 55635e5687
2 changed files with 30 additions and 21 deletions

View file

@ -17,9 +17,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Layouts 1.4
import QtQuick.Window 2.0 import QtQuick.Window 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kwin 2.0 import org.kde.kwin 2.0
PlasmaCore.Dialog { PlasmaCore.Dialog {
@ -28,18 +29,25 @@ PlasmaCore.Dialog {
flags: Qt.X11BypassWindowManagerHint flags: Qt.X11BypassWindowManagerHint
type: PlasmaCore.Dialog.Dock type: PlasmaCore.Dialog.Dock
mainItem: Item { mainItem: MouseArea {
width: workspace.virtualScreenSize.width width: workspace.virtualScreenSize.width
height: units.iconSizes.medium height: units.iconSizes.medium
RowLayout {
anchors.fill: parent
PlasmaComponents.ToolButton { PlasmaComponents.ToolButton {
anchors.left: parent.left Layout.fillWidth: true
iconSource: "applications-other" Layout.fillHeight: true
icon.name: "applications-other"
onClicked: root.showWindowList(); onClicked: root.showWindowList();
} }
PlasmaComponents.ToolButton { PlasmaComponents.ToolButton {
anchors.horizontalCenter: parent.horizontalCenter Layout.fillWidth: true
iconSource: "go-home" Layout.fillHeight: true
icon.name: "go-home"
onClicked: { onClicked: {
root.closeWindowList(); root.closeWindowList();
workspace.slotToggleShowDesktop(); workspace.slotToggleShowDesktop();
@ -47,12 +55,14 @@ PlasmaCore.Dialog {
} }
PlasmaComponents.ToolButton { PlasmaComponents.ToolButton {
anchors.right: parent.right Layout.fillWidth: true
iconSource: "window-close" Layout.fillHeight: true
icon.name: "window-close"
enabled: workspace.activeClient enabled: workspace.activeClient
onClicked: workspace.activeClient.closeWindow(); onClicked: workspace.activeClient.closeWindow();
} }
} }
}
Component.onCompleted: { Component.onCompleted: {
KWin.registerWindow(panel); KWin.registerWindow(panel);
panel.visible = true; panel.visible = true;

View file

@ -104,7 +104,6 @@ PlasmaCore.Dialog {
anchors.fill: parent anchors.fill: parent
//parentWindow: dialog.windowId //parentWindow: dialog.windowId
client: model.client client: model.client
brightness: (model.client == workspace.activeClient) ? 1.0 : 0.6
} }
onClicked: { onClicked: {
workspace.activeClient = model.client workspace.activeClient = model.client