mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-24 18:03:53 +03:00
drag a maximized window from panel
This commit is contained in:
parent
722d656bfa
commit
b8ad6fceeb
@ -1891,6 +1891,19 @@ QVariantList DockView::containmentActions()
|
||||
return actions;
|
||||
}
|
||||
|
||||
void DockView::disableGrabItemBehavior()
|
||||
{
|
||||
setMouseGrabEnabled(false);
|
||||
}
|
||||
|
||||
void DockView::restoreGrabItemBehavior()
|
||||
{
|
||||
setMouseGrabEnabled(true);
|
||||
|
||||
if (mouseGrabberItem()) {
|
||||
mouseGrabberItem()->ungrabMouse();
|
||||
}
|
||||
}
|
||||
|
||||
//!BEGIN overriding context menus behavior
|
||||
void DockView::mousePressEvent(QMouseEvent *event)
|
||||
|
@ -245,6 +245,9 @@ public slots:
|
||||
|
||||
void updateAbsDockGeometry(bool bypassChecks = false);
|
||||
|
||||
Q_INVOKABLE void disableGrabItemBehavior();
|
||||
Q_INVOKABLE void restoreGrabItemBehavior();
|
||||
|
||||
protected slots:
|
||||
void showConfigurationInterface(Plasma::Applet *applet) override;
|
||||
|
||||
|
@ -29,6 +29,8 @@ import org.kde.kquickcontrolsaddons 2.0
|
||||
import org.kde.draganddrop 2.0 as DragDrop
|
||||
import org.kde.plasma.plasmoid 2.0
|
||||
|
||||
import org.kde.taskmanager 0.1 as TaskManager
|
||||
|
||||
import org.kde.latte 0.1 as Latte
|
||||
|
||||
import "applet" as Applet
|
||||
@ -1637,6 +1639,41 @@ DragDrop.DropArea {
|
||||
startCheckRestoreZoomTimer()
|
||||
}
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
dock.disableGrabItemBehavior();
|
||||
drawWindowTimer.start();
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: drawWindowTimer
|
||||
interval: 350
|
||||
onTriggered: {
|
||||
if (rootMouseArea.pressed) {
|
||||
tasksModel.requestMove(tasksModel.activeTask);
|
||||
restoreGrabberTimer.start();
|
||||
} else {
|
||||
dock.restoreGrabItemBehavior();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: restoreGrabberTimer
|
||||
interval: 350
|
||||
onTriggered: {
|
||||
dock.restoreGrabItemBehavior();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TaskManager.TasksModel {
|
||||
id: tasksModel
|
||||
sortMode: TaskManager.TasksModel.SortVirtualDesktop
|
||||
groupMode: TaskManager.TasksModel.GroupDisabled
|
||||
|
||||
screenGeometry: plasmoid.screenGeometry
|
||||
filterByScreen: plasmoid.configuration.showForCurrentScreenOnly
|
||||
}
|
||||
|
||||
Loader{
|
||||
|
Loading…
x
Reference in New Issue
Block a user