Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ QRect DockPanel::geometry()
}

QRect DockPanel::frontendWindowRect()
{
return frontendWindowRect(0, 0);
}

QRect DockPanel::frontendWindowRect(int transformOffsetX, int transformOffsetY)
{
if(!window()) return QRect();

Expand All @@ -192,17 +197,19 @@ QRect DockPanel::frontendWindowRect()
switch (position()) {
case Top:
xOffset = (screenGeometry.width() - geometry.width()) / 2;
yOffset = transformOffsetY;
break;
case Bottom:
xOffset = (screenGeometry.width() - geometry.width()) / 2;
yOffset = screenGeometry.height() - geometry.height();
yOffset = screenGeometry.height() - geometry.height() + transformOffsetY;
break;
case Right:
xOffset = screenGeometry.width() - geometry.width();
xOffset = screenGeometry.width() - geometry.width() + transformOffsetX;
yOffset = (screenGeometry.height() - geometry.height()) / 2;
break;
case Left:
yOffset = screenGeometry.height() - geometry.height();
xOffset = transformOffsetX;
yOffset = (screenGeometry.height() - geometry.height()) / 2;
break;
}

Expand Down Expand Up @@ -337,6 +344,11 @@ void DockPanel::openDockSettings() const
.call();
}

void DockPanel::notifyDockPositionChanged(int offsetX, int offsetY)
{
Q_EMIT frontendWindowRectChanged(frontendWindowRect(offsetX, offsetY));
}

void DockPanel::launcherVisibleChanged(bool visible)
{
if (visible == m_launcherShown) return;
Expand Down
34 changes: 34 additions & 0 deletions panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,40 @@ Window {
}
}

Connections {
target: dockTransform
enabled: Qt.platform.pluginName === "xcb" && hideShowAnimation.running

function onXChanged() {
if (dock.useColumnLayout) {
Panel.notifyDockPositionChanged(dockTransform.x, 0)
}
}

function onYChanged() {
if (!dock.useColumnLayout) {
Panel.notifyDockPositionChanged(0, dockTransform.y)
}
}
}

Connections {
target: dock
enabled: Qt.platform.pluginName !== "xcb" && hideShowAnimation.running

function onWidthChanged() {
if (dock.useColumnLayout) {
Panel.notifyDockPositionChanged()
}
}

function onHeightChanged() {
if (!dock.useColumnLayout) {
Panel.notifyDockPositionChanged()
}
}
}

Timer {
id: hideTimer
interval: 500
Expand Down