diff --git a/share/qtcreator/welcomescreen/examples.qml b/share/qtcreator/welcomescreen/examples.qml index 3d48acb8676930a0581e2020ac27f98691640822..6611e91aeafb4e8a33b230e97fbb75f0b0ff1b07 100644 --- a/share/qtcreator/welcomescreen/examples.qml +++ b/share/qtcreator/welcomescreen/examples.qml @@ -52,18 +52,14 @@ Rectangle { caption: qsTr("Examples") } - CustomScrollArea { - id: scrollArea; - + CustomizedGridView { anchors.rightMargin: 38 anchors.bottomMargin: 60 anchors.leftMargin: 38 anchors.topMargin: 102 anchors.fill: parent - CustomizedGridView { - model: examplesModel - } + model: examplesModel } SearchBar { diff --git a/share/qtcreator/welcomescreen/tutorials.qml b/share/qtcreator/welcomescreen/tutorials.qml index 698b60195c34fc2c614354c2749ecacf1f8c2f4d..cf8ad88ea3c138177f6202ced75b7ac7695dbacb 100644 --- a/share/qtcreator/welcomescreen/tutorials.qml +++ b/share/qtcreator/welcomescreen/tutorials.qml @@ -52,23 +52,14 @@ Rectangle { caption: qsTr("Tutorials") } - CustomScrollArea { - id: scrollArea; - + CustomizedGridView { anchors.rightMargin: 38 anchors.bottomMargin: 60 anchors.leftMargin: 38 anchors.topMargin: 102 anchors.fill: parent - clip: true - - horizontalScrollBar.visible: false - frame: false - - CustomizedGridView { - model: tutorialsModel - } + model: tutorialsModel } SearchBar { diff --git a/share/qtcreator/welcomescreen/widgets/CustomScrollArea.qml b/share/qtcreator/welcomescreen/widgets/CustomScrollArea.qml deleted file mode 100644 index 230414c29c17c2a290f72d94edcf0e35dd152efb..0000000000000000000000000000000000000000 --- a/share/qtcreator/welcomescreen/widgets/CustomScrollArea.qml +++ /dev/null @@ -1,40 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -import QtQuick 1.1 -import qtcomponents 1.0 - -ScrollArea { - horizontalScrollBar.visible: false - frame: false - clip: true -} diff --git a/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml b/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml index ad3f8ee9dffbb2719a1a29b6c2058163fc4cd79e..9898d034a6399809b22b33c9efec3bdab32be246 100644 --- a/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml +++ b/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml @@ -31,14 +31,16 @@ **************************************************************************/ import QtQuick 1.0 +import qtcomponents 1.0 GridView { + id: gridView interactive: false - width: scrollArea.width + clip: true cellHeight: 240 cellWidth: 216 property int columns: Math.max(Math.floor(width / cellWidth), 1) - height: 240 * Math.ceil(count / columns) + cacheBuffer: 1000 x: Math.max((width - (cellWidth * columns)) / 2, 0); @@ -61,4 +63,28 @@ GridView { tags: model.tags } + WheelArea { + id: wheelarea + anchors.fill: parent + verticalMinimumValue: vscrollbar.minimumValue + verticalMaximumValue: vscrollbar.maximumValue + + onVerticalValueChanged: gridView.contentY = verticalValue + } + + ScrollBar { + id: vscrollbar + orientation: Qt.Vertical + property int availableHeight : gridView.height + visible: contentHeight > availableHeight + maximumValue: contentHeight > availableHeight ? gridView.contentHeight - availableHeight : 0 + minimumValue: 0 + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.topMargin: styleitem.style == "mac" ? 1 : 0 + onValueChanged: gridView.contentY = value + anchors.rightMargin: styleitem.frameoffset + anchors.bottomMargin: hscrollbar.visible ? hscrollbar.height : styleitem.frameoffset + } }