Skip to content

Commit bb8c656

Browse files
committed
fix: Signals during the process of adding dock animations
Signals during the process of adding dock animations Log: Signals during the process of adding dock animations pms: BUG-314923
1 parent 4c11f38 commit bb8c656

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

panels/dock/dockpanel.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ QRect DockPanel::geometry()
181181
}
182182

183183
QRect DockPanel::frontendWindowRect()
184+
{
185+
return frontendWindowRect(0, 0);
186+
}
187+
188+
QRect DockPanel::frontendWindowRect(int transformOffsetX, int transformOffsetY)
184189
{
185190
if(!window()) return QRect();
186191

@@ -192,17 +197,19 @@ QRect DockPanel::frontendWindowRect()
192197
switch (position()) {
193198
case Top:
194199
xOffset = (screenGeometry.width() - geometry.width()) / 2;
200+
yOffset = transformOffsetY;
195201
break;
196202
case Bottom:
197203
xOffset = (screenGeometry.width() - geometry.width()) / 2;
198-
yOffset = screenGeometry.height() - geometry.height();
204+
yOffset = screenGeometry.height() - geometry.height() + transformOffsetY;
199205
break;
200206
case Right:
201-
xOffset = screenGeometry.width() - geometry.width();
207+
xOffset = screenGeometry.width() - geometry.width() + transformOffsetX;
202208
yOffset = (screenGeometry.height() - geometry.height()) / 2;
203209
break;
204210
case Left:
205-
yOffset = screenGeometry.height() - geometry.height();
211+
xOffset = transformOffsetX;
212+
yOffset = (screenGeometry.height() - geometry.height()) / 2;
206213
break;
207214
}
208215

@@ -337,6 +344,11 @@ void DockPanel::openDockSettings() const
337344
.call();
338345
}
339346

347+
void DockPanel::notifyDockPositionChanged(int offsetX, int offsetY)
348+
{
349+
Q_EMIT frontendWindowRectChanged(frontendWindowRect(offsetX, offsetY));
350+
}
351+
340352
void DockPanel::launcherVisibleChanged(bool visible)
341353
{
342354
if (visible == m_launcherShown) return;

panels/dock/package/main.qml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,40 @@ Window {
114114
}
115115
}
116116

117+
Connections {
118+
target: dockTransform
119+
enabled: Qt.platform.pluginName === "xcb" && hideShowAnimation.running
120+
121+
function onXChanged() {
122+
if (dock.useColumnLayout) {
123+
Panel.notifyDockPositionChanged(dockTransform.x, 0)
124+
}
125+
}
126+
127+
function onYChanged() {
128+
if (!dock.useColumnLayout) {
129+
Panel.notifyDockPositionChanged(0, dockTransform.y)
130+
}
131+
}
132+
}
133+
134+
Connections {
135+
target: dock
136+
enabled: Qt.platform.pluginName !== "xcb" && hideShowAnimation.running
137+
138+
function onWidthChanged() {
139+
if (dock.useColumnLayout) {
140+
Panel.notifyDockPositionChanged()
141+
}
142+
}
143+
144+
function onHeightChanged() {
145+
if (!dock.useColumnLayout) {
146+
Panel.notifyDockPositionChanged()
147+
}
148+
}
149+
}
150+
117151
Timer {
118152
id: hideTimer
119153
interval: 500

0 commit comments

Comments
 (0)