summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <[email protected]>2017-03-01 22:35:49 +0900
committerEike Hein <[email protected]>2017-03-02 02:49:27 +0900
commit6a0b3f8a3dc580046f61ae4e01c0553377c12cbf (patch)
tree8eb895bd7be36d54605074121f51c9f782fbf9e2
parent5995ea913aebb960fdf8cb72eedbf40ba4a34fa6 (diff)
Fix rename box width calc.
Reviewers: #plasma, broulik Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4862
-rw-r--r--containments/desktop/package/contents/ui/FolderView.qml19
1 files changed, 16 insertions, 3 deletions
diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml
index 034c58a..371665f 100644
--- a/containments/desktop/package/contents/ui/FolderView.qml
+++ b/containments/desktop/package/contents/ui/FolderView.qml
@@ -1144,15 +1144,24 @@ Item {
_x = targetItem.labelArea.x - __style.padding.left;
_y = pos.y - __style.padding.top;
} else {
- _x = targetItem.x + units.largeSpacing + units.smallSpacing - __style.padding.left;
+ _x = targetItem.x + Math.abs(Math.min(gridView.contentX, gridView.originX));
+ _x += (targetItem.width/2 - targetItem.label.paintedWidth/2 - __style.padding.left);
+ _x += scrollArea.viewport.x;
+
+ if (verticalScrollBarPolicy == Qt.ScrollBarAlwaysOn
+ && gridView.effectiveLayoutDirection == Qt.RightToLeft) {
+ _x -= __verticalScrollBar.parent.verticalScrollbarOffset;
+ }
+
_y = pos.y + units.smallSpacing - __style.padding.top;
}
return([ _x, _y ]);
}
function getWidth(addWidthVerticalScroller) {
- return(targetItem.width - units.largeSpacing * 2 - (isPopup ? 0 : units.smallSpacing * 2) + __style.padding.left + __style.padding.right +
- (addWidthVerticalScroller ? __verticalScrollBar.parent.verticalScrollbarOffset : 0));
+ var _width = isPopup ? targetItem.width - units.largeSpacing * 2 : targetItem.label.paintedWidth;
+ return _width + __style.padding.left + __style.padding.right +
+ (addWidthVerticalScroller ? __verticalScrollBar.parent.verticalScrollbarOffset : 0);
}
function getHeight(addWidthHoriozontalScroller, init) {
@@ -1192,6 +1201,10 @@ Item {
width = getWidth();
}
}
+
+ var xy = getXY();
+ x = xy[0];
+ y = xy[1];
}
}