Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderView.qml
Show First 20 Lines • Show All 1070 Lines • ▼ Show 20 Line(s) | 1060 | Folder.ItemViewAdapter { | |||
---|---|---|---|---|---|
1071 | } | 1071 | } | ||
1072 | } | 1072 | } | ||
1073 | 1073 | | |||
1074 | PlasmaComponents.TextArea { | 1074 | PlasmaComponents.TextArea { | ||
1075 | id: editor | 1075 | id: editor | ||
1076 | 1076 | | |||
1077 | visible: false | 1077 | visible: false | ||
1078 | 1078 | | |||
1079 | wrapMode: isPopup ? TextEdit.NoWrap : TextEdit.Wrap | 1079 | wrapMode: root.useListViewMode ? TextEdit.NoWrap : TextEdit.Wrap | ||
1080 | 1080 | | |||
1081 | textMargin: 0 | 1081 | textMargin: 0 | ||
1082 | 1082 | | |||
1083 | horizontalAlignment: isPopup ? TextEdit.AlignHLeft : TextEdit.AlignHCenter | 1083 | horizontalAlignment: root.useListViewMode ? TextEdit.AlignHLeft : TextEdit.AlignHCenter | ||
1084 | 1084 | | |||
1085 | property Item targetItem: null | 1085 | property Item targetItem: null | ||
1086 | 1086 | | |||
1087 | onTargetItemChanged: { | 1087 | onTargetItemChanged: { | ||
1088 | if (targetItem != null) { | 1088 | if (targetItem != null) { | ||
1089 | var xy = getXY(); | 1089 | var xy = getXY(); | ||
1090 | x = xy[0]; | 1090 | x = xy[0]; | ||
1091 | y = xy[1]; | 1091 | y = xy[1]; | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
1139 | 1139 | | |||
1140 | Keys.onReleased: { | 1140 | Keys.onReleased: { | ||
1141 | adjustSize(); | 1141 | adjustSize(); | ||
1142 | } | 1142 | } | ||
1143 | 1143 | | |||
1144 | function getXY() { | 1144 | function getXY() { | ||
1145 | var pos = main.mapFromItem(targetItem, targetItem.labelArea.x, targetItem.labelArea.y); | 1145 | var pos = main.mapFromItem(targetItem, targetItem.labelArea.x, targetItem.labelArea.y); | ||
1146 | var _x, _y; | 1146 | var _x, _y; | ||
1147 | if(isPopup) { | 1147 | if (root.useListViewMode) { | ||
1148 | _x = targetItem.labelArea.x - __style.padding.left; | 1148 | _x = targetItem.labelArea.x - __style.padding.left; | ||
1149 | _y = pos.y - __style.padding.top; | 1149 | _y = pos.y - __style.padding.top; | ||
1150 | } else { | 1150 | } else { | ||
1151 | _x = targetItem.x + Math.abs(Math.min(gridView.contentX, gridView.originX)); | 1151 | _x = targetItem.x + Math.abs(Math.min(gridView.contentX, gridView.originX)); | ||
1152 | _x += (targetItem.width/2 - targetItem.label.paintedWidth/2 - __style.padding.left); | 1152 | _x += (targetItem.width/2 - targetItem.label.paintedWidth/2 - __style.padding.left); | ||
1153 | _x += scrollArea.viewport.x; | 1153 | _x += scrollArea.viewport.x; | ||
1154 | 1154 | | |||
1155 | if (verticalScrollBarPolicy == Qt.ScrollBarAlwaysOn | 1155 | if (verticalScrollBarPolicy == Qt.ScrollBarAlwaysOn | ||
1156 | && gridView.effectiveLayoutDirection == Qt.RightToLeft) { | 1156 | && gridView.effectiveLayoutDirection == Qt.RightToLeft) { | ||
1157 | _x -= __verticalScrollBar.parent.verticalScrollbarOffset; | 1157 | _x -= __verticalScrollBar.parent.verticalScrollbarOffset; | ||
1158 | } | 1158 | } | ||
1159 | 1159 | | |||
1160 | _y = pos.y + units.smallSpacing - __style.padding.top; | 1160 | _y = pos.y + units.smallSpacing - __style.padding.top; | ||
1161 | } | 1161 | } | ||
1162 | return([ _x, _y ]); | 1162 | return([ _x, _y ]); | ||
1163 | } | 1163 | } | ||
1164 | 1164 | | |||
1165 | function getWidth(addWidthVerticalScroller) { | 1165 | function getWidth(addWidthVerticalScroller) { | ||
1166 | var _width = isPopup ? targetItem.width - units.largeSpacing * 2 : targetItem.label.paintedWidth; | 1166 | var _width = root.useListViewMode ? targetItem.width - units.largeSpacing * 2 : targetItem.label.paintedWidth; | ||
1167 | return _width + __style.padding.left + __style.padding.right + | 1167 | return _width + __style.padding.left + __style.padding.right + | ||
1168 | (addWidthVerticalScroller ? __verticalScrollBar.parent.verticalScrollbarOffset : 0); | 1168 | (addWidthVerticalScroller ? __verticalScrollBar.parent.verticalScrollbarOffset : 0); | ||
1169 | } | 1169 | } | ||
1170 | 1170 | | |||
1171 | function getHeight(addWidthHoriozontalScroller, init) { | 1171 | function getHeight(addWidthHoriozontalScroller, init) { | ||
1172 | var _height; | 1172 | var _height; | ||
1173 | if(isPopup || init) { | 1173 | if(isPopup || init) { | ||
1174 | _height = targetItem.labelArea.height + __style.padding.top + __style.padding.bottom; | 1174 | _height = targetItem.labelArea.height + __style.padding.top + __style.padding.bottom; | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |