Skip to content

Commit 3076b78

Browse files
committed
Fix separator swap threshold for rightward drag
1 parent f8fc283 commit 3076b78

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/gui/customizabletoolbar.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ void CustomizableToolBar::updateDrag(const QPoint &globalPos)
182182
m_floatLabel->move(clampedX, clampedY);
183183

184184
const int dragFloatLeft = mapFromGlobal(QPoint(clampedX, 0)).x();
185+
const int dragFloatRight = mapFromGlobal(QPoint(clampedX + fw, 0)).x();
185186
const int dragFloatCentre = mapFromGlobal(QPoint(clampedX + fw / 2, 0)).x();
186187
const bool movingLeft = (dragFloatCentre < m_lastFloatCentreX);
187188
m_lastFloatCentreX = dragFloatCentre;
@@ -212,7 +213,7 @@ void CustomizableToolBar::updateDrag(const QPoint &globalPos)
212213
}
213214

214215
// Use float left edge for separators when moving left, centre otherwise
215-
const int compareX = (a->isSeparator() && movingLeft) ? dragFloatLeft : dragFloatCentre;
216+
const int compareX = a->isSeparator() ? (movingLeft ? dragFloatLeft : dragFloatRight) : dragFloatCentre;
216217
if (compareX < threshold)
217218
{
218219
newInsertBefore = a;

0 commit comments

Comments
 (0)