diff --git a/share/qtcreator/welcomescreen/examples.qml b/share/qtcreator/welcomescreen/examples.qml index 628061d9995f1f9879f86a697e34d54ae234289b..8e256362c6ba5001f12b12123dd3fd2b50554162 100644 --- a/share/qtcreator/welcomescreen/examples.qml +++ b/share/qtcreator/welcomescreen/examples.qml @@ -33,9 +33,10 @@ import widgets 1.0 Rectangle { id: rectangle1 width: 1024 - height: Math.min(3024, parent.height - y) + height: grid.contentHeight + 100 CustomizedGridView { + id: grid anchors.rightMargin: 38 anchors.bottomMargin: 60 anchors.leftMargin: 38 diff --git a/share/qtcreator/welcomescreen/tutorials.qml b/share/qtcreator/welcomescreen/tutorials.qml index ff46b971049873d37491ae1019e28860af5f8790..b2de14ad8e5009d69111b4141f08344d48b19673 100644 --- a/share/qtcreator/welcomescreen/tutorials.qml +++ b/share/qtcreator/welcomescreen/tutorials.qml @@ -33,9 +33,10 @@ import widgets 1.0 Rectangle { id: rectangle1 width: 1024 - height: Math.min(3024, parent.height - y) + height: grid.contentHeight + 100 CustomizedGridView { + id: grid anchors.rightMargin: 38 anchors.bottomMargin: 60 anchors.leftMargin: 38 diff --git a/share/qtcreator/welcomescreen/welcomescreen.qml b/share/qtcreator/welcomescreen/welcomescreen.qml index 79601ad7ec236f1d7bff1ba8e3430e5c1ec1c7bc..d5f4e945ecc4b4c814464c1c1775b66065597702 100644 --- a/share/qtcreator/welcomescreen/welcomescreen.qml +++ b/share/qtcreator/welcomescreen/welcomescreen.qml @@ -29,43 +29,46 @@ import QtQuick 2.1 import widgets 1.0 +import QtQuick.Controls 1.0 -Rectangle { - width: 920 - height: 600 - color: "#edf0f2" - id: root +ScrollView { + id: scrollView property var fonts: CustomFonts {} property var colors: CustomColors { } + Rectangle { + width: Math.max(920, scrollView.flickableItem.width - 30) + height: Math.max(loader.height, scrollView.flickableItem.height); - SideBar { - id: sideBar - model: pagesModel - anchors.top: parent.top - anchors.bottom: parent.bottom + id: root - } + SideBar { + id: sideBar + model: pagesModel + anchors.top: parent.top + anchors.bottom: parent.bottom - Rectangle { - color: "#737373" - width: 1 - height: parent.height + } - anchors.right: sideBar.right - } + Rectangle { + color: "#737373" + width: 1 + height: parent.height - QtObject { - id: tab - property int currentIndex: sideBar.currentIndex - } + anchors.right: sideBar.right + } - PageLoader { - anchors.top: parent.top - model: pagesModel - anchors.bottom: parent.bottom - anchors.left: sideBar.right - anchors.right: parent.right - } + QtObject { + id: tab + property int currentIndex: sideBar.currentIndex + } + PageLoader { + id: loader + model: pagesModel + anchors.left: sideBar.right + anchors.right: parent.right + } + + } } diff --git a/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml b/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml index b022235e38f8b47ff00eba29fa0d4f4a1dab29a3..4317bd2f5d9bea31a4e273434f8150a4e760d093 100644 --- a/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml +++ b/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml @@ -30,33 +30,30 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 -ScrollView { +GridView { x: Math.max((width - (cellWidth * columns)) / 2, 0); - property alias model: gridView.model - GridView { - id: gridView - interactive: false - cellHeight: 240 - cellWidth: 216 - property int columns: Math.max(Math.floor(width / cellWidth), 1) + id: gridView + interactive: false + cellHeight: 240 + cellWidth: 216 + property int columns: Math.max(Math.floor(width / cellWidth), 1) - delegate: Delegate { - id: delegate + delegate: Delegate { + id: delegate - property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1 - property string sourcePrefix: isHelpImage ? "image://helpimage/" : "" + property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1 + property string sourcePrefix: isHelpImage ? "image://helpimage/" : "" - property string mockupSource: model.imageSource - property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" + property string mockupSource: model.imageSource + property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" - imageSource: model.imageSource === undefined ? helpSource : mockupSource - videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource + imageSource: model.imageSource === undefined ? helpSource : mockupSource + videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource - caption: model.name; - description: model.description - isVideo: model.isVideo === true - videoLength: model.videoLength !== undefined ? model.videoLength : "" - tags: model.tags - } + caption: model.name; + description: model.description + isVideo: model.isVideo === true + videoLength: model.videoLength !== undefined ? model.videoLength : "" + tags: model.tags } } diff --git a/share/qtcreator/welcomescreen/widgets/PageLoader.qml b/share/qtcreator/welcomescreen/widgets/PageLoader.qml index c981e2b60b994d16242dd6fb363423b272b2cbea..3acca9ff9dd7bac26ba9238834dbf0bbf7dc180b 100644 --- a/share/qtcreator/welcomescreen/widgets/PageLoader.qml +++ b/share/qtcreator/welcomescreen/widgets/PageLoader.qml @@ -34,10 +34,16 @@ Item { property alias model: repeater.model + height: repeater.height + Repeater { id: repeater + height: itemAt(tab.currentIndex).height Loader { - anchors.fill: parent + id: loader + anchors.left: parent.left + anchors.right: parent.right + height: item.height property bool active: index === tab.currentIndex property bool wasActive onActiveChanged: { diff --git a/share/qtcreator/welcomescreen/widgets/Tabs.qml b/share/qtcreator/welcomescreen/widgets/Tabs.qml index d25325355010707917e055c8e20b3b0116d518ba..fc96beada5e9162c7f6df3761581f3a6cd2159db 100644 --- a/share/qtcreator/welcomescreen/widgets/Tabs.qml +++ b/share/qtcreator/welcomescreen/widgets/Tabs.qml @@ -35,7 +35,7 @@ Column { spacing: 16 signal itemChanged - property int currentIndex: 0 + property int currentIndex: -1 onCurrentIndexChanged: welcomeMode.activePlugin = currentIndex Component.onCompleted: currentIndex = welcomeMode.activePlugin diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 5502f24d20d0ac8691bd3d3ea3c269bebd2cf00c..013b0661f8c9ec1677230e4ec1068c98bd93832a 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -165,15 +165,9 @@ WelcomeMode::WelcomeMode() : styledBar->setObjectName(QLatin1String("WelcomePageStyledBar")); layout->addWidget(styledBar); - QScrollArea *scrollArea = new QScrollArea(m_modeWidget); - scrollArea->setFrameShape(QFrame::NoFrame); - scrollArea->setWidgetResizable(true); - - QWidget *container = QWidget::createWindowContainer(m_welcomePage, scrollArea); - container->setMinimumSize(QSize(880, 548)); - scrollArea->setWidget(container); + QWidget *container = QWidget::createWindowContainer(m_welcomePage, m_modeWidget); m_modeWidget->setLayout(layout); - layout->addWidget(scrollArea); + layout->addWidget(container); connect(PluginManager::instance(), SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*)));