Changeset View
Changeset View
Standalone View
Standalone View
src/localFileConfiguration/package/contents/ui/main.qml
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public License | 14 | * You should have received a copy of the GNU Lesser General Public License | ||
15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | import QtQuick 2.7 | 18 | import QtQuick 2.7 | ||
19 | import QtQuick.Controls 1.4 | 19 | import QtQuick.Controls 2.3 | ||
20 | import QtQuick.Layouts 1.3 | 20 | import QtQuick.Layouts 1.3 | ||
21 | import QtQuick.Dialogs 1.2 | 21 | import QtQuick.Dialogs 1.2 | ||
22 | import QtQml.Models 2.3 | 22 | import QtQml.Models 2.3 | ||
23 | import org.kde.kcm 1.0 | 23 | import org.kde.kcm 1.0 | ||
24 | 24 | | |||
25 | Item { | 25 | Item { | ||
26 | //implicitWidth and implicitHeight will be used as initial size | 26 | //implicitWidth and implicitHeight will be used as initial size | ||
27 | //when loaded in kcmshell5 | 27 | //when loaded in kcmshell5 | ||
Show All 22 Lines | |||||
50 | Component { | 50 | Component { | ||
51 | id: pathDelegate | 51 | id: pathDelegate | ||
52 | 52 | | |||
53 | Item { | 53 | Item { | ||
54 | id: delegateItem | 54 | id: delegateItem | ||
55 | 55 | | |||
56 | height: 3 * 30 | 56 | height: 3 * 30 | ||
57 | 57 | | |||
58 | width: pathList.width | 58 | width: scrollBar.visible ? pathList.width - scrollBar.width : pathList.width | ||
59 | 59 | | |||
60 | Rectangle { | 60 | Rectangle { | ||
61 | anchors.fill: parent | 61 | anchors.fill: parent | ||
62 | anchors.margins: 0.1 * 30 | 62 | anchors.margins: 0.1 * 30 | ||
63 | 63 | | |||
64 | color: myPalette.base | 64 | color: myPalette.base | ||
65 | 65 | | |||
66 | MouseArea { | 66 | MouseArea { | ||
67 | anchors.fill: parent | 67 | anchors.fill: parent | ||
68 | 68 | | |||
69 | hoverEnabled: true | 69 | hoverEnabled: true | ||
70 | 70 | | |||
71 | onEntered: pathList.currentIndex = delegateItem.DelegateModel.itemsIndex | 71 | onEntered: pathList.currentIndex = delegateItem.DelegateModel.itemsIndex | ||
72 | 72 | | |||
73 | Label { | 73 | Label { | ||
74 | text: modelData | 74 | text: modelData | ||
75 | 75 | | |||
76 | anchors.centerIn: parent | 76 | anchors.centerIn: parent | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | ToolButton { | 79 | ToolButton { | ||
80 | iconName: 'list-remove' | 80 | icon.name: 'list-remove' | ||
81 | 81 | | |||
82 | Accessible.onPressAction: onClicked | 82 | Accessible.onPressAction: onClicked | ||
83 | 83 | | |||
84 | anchors.top: parent.top | 84 | anchors.top: parent.top | ||
85 | anchors.right: parent.right | 85 | anchors.right: parent.right | ||
86 | 86 | | |||
87 | onClicked: | 87 | onClicked: | ||
88 | { | 88 | { | ||
89 | var oldPaths = kcm.rootPath | 89 | var oldPaths = kcm.rootPath | ||
90 | oldPaths.splice(delegateItem.DelegateModel.itemsIndex, 1) | 90 | oldPaths.splice(delegateItem.DelegateModel.itemsIndex, 1) | ||
91 | kcm.rootPath = oldPaths | 91 | kcm.rootPath = oldPaths | ||
92 | } | 92 | } | ||
93 | } | 93 | } | ||
94 | } | 94 | } | ||
95 | } | 95 | } | ||
96 | } | 96 | } | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | RowLayout { | 99 | RowLayout { | ||
100 | spacing: 0 | 100 | spacing: 0 | ||
101 | 101 | | |||
102 | anchors.fill: parent | 102 | anchors.fill: parent | ||
103 | 103 | | |||
104 | ScrollView { | | |||
105 | flickableItem.boundsBehavior: Flickable.StopAtBounds | | |||
mgallien: Please put this back. I do not feel like overshooting is of any value here. | |||||
In general I think this behavior should be controlled globally rather than determined by each app or even each scrollview (that just makes everything inconsistent). But you're right, it's unrelated to this patch and should not be changed here. ngraham: In general I think this behavior should be controlled globally rather than determined by each… | |||||
flickableItem.boundsBehavior: Flickable.StopAtBounds astippich: flickableItem.boundsBehavior: Flickable.StopAtBounds
does not exist in qqc2. I cleaned up the… | |||||
106 | | ||||
107 | Layout.fillWidth: true | | |||
108 | Layout.fillHeight: true | | |||
109 | | ||||
110 | ListView { | 104 | ListView { | ||
111 | id:pathList | 105 | id:pathList | ||
112 | 106 | | |||
113 | anchors.fill: parent | 107 | Layout.fillWidth: true | ||
108 | Layout.fillHeight: true | ||||
109 | boundsBehavior: Flickable.StopAtBounds | ||||
114 | 110 | | |||
115 | model: DelegateModel { | 111 | model: DelegateModel { | ||
116 | model: kcm.rootPath | 112 | model: kcm.rootPath | ||
117 | 113 | | |||
118 | delegate: pathDelegate | 114 | delegate: pathDelegate | ||
119 | } | 115 | } | ||
120 | 116 | | |||
121 | highlight: highlightBar | 117 | ScrollBar.vertical: ScrollBar { | ||
118 | id: scrollBar | ||||
122 | } | 119 | } | ||
120 | | ||||
121 | highlight: highlightBar | ||||
123 | } | 122 | } | ||
124 | 123 | | |||
125 | ColumnLayout { | 124 | ColumnLayout { | ||
126 | Layout.fillHeight: true | 125 | Layout.fillHeight: true | ||
127 | Layout.leftMargin: !LayoutMirroring.enabled ? (0.3 * 30) : 0 | 126 | Layout.leftMargin: !LayoutMirroring.enabled ? (0.3 * 30) : 0 | ||
128 | Layout.rightMargin: LayoutMirroring.enabled ? (0.3 * 30) : 0 | 127 | Layout.rightMargin: LayoutMirroring.enabled ? (0.3 * 30) : 0 | ||
129 | 128 | | |||
130 | Button { | 129 | Button { | ||
Show All 29 Lines |
Please put this back. I do not feel like overshooting is of any value here.