KCMUtils

ScrollView.qml
1/*
2 SPDX-FileCopyrightText: 2018 Marco Martin <mart@kde.org>
3 SPDX-FileCopyrightText: 2023 ivan tkachenko <me@ratijas.tk>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8import QtQuick 2.7
9import QtQuick.Controls 2.2 as QQC2
10import org.kde.kirigami 2.3 as Kirigami
11
12/**
13 * A ScrollView containing a GridView, with the default behavior about
14 * sizing and background as recommended by the user interface guidelines
15 * For most KControl modules, it's recommended to use instead the GridViewKCM
16 * component as the root element of your module.
17 * @code
18 * import org.kde.kcmutils as KCM
19 * KCM.ScrollView {
20 * view: ListView {
21 * ...
22 * }
23 * }
24 * @endcode
25 * @see GridViewKCM
26 */
27QQC2.ScrollView {
28 id: scroll
29
30 /**
31 * view: GridView
32 * Exposes the internal flickable
33 */
34 property Flickable view
35 property bool framedView: true
36
37 contentItem: view
38 onViewChanged: {
39 view.parent = scroll;
40 if (!view.KeyNavigation.up) {
41 view.KeyNavigation.up = Qt.binding(() => root.globalToolBarItem);
42 }
43 }
44
45 activeFocusOnTab: false
46 Kirigami.Theme.colorSet: Kirigami.Theme.View
47 Kirigami.Theme.inherit: false
48
49 Component.onCompleted: {
50 if (background) {
51 background.visible = Qt.binding(() => framedView);
52 }
53 }
54
55 QQC2.ScrollBar.horizontal.visible: false
56}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.