diff --git a/share/qtcreator/welcomescreen/widgets/IconAndLink.qml b/share/qtcreator/welcomescreen/widgets/IconAndLink.qml new file mode 100644 index 00000000000..0277d977119 --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/IconAndLink.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.1 + +Row { + property string iconSource + property string title: "title" + property string openUrl + property string openHelpUrl + spacing: 7 + Image { + width: 16 + height: 16 + source: iconSource + } + LinkedText { + text: title + font.pixelSize: 11 + color: "black" + onClicked: { + if (openUrl) + gettingStarted.openUrl(openUrl); + if (openHelpUrl) + gettingStarted.openHelp(openUrl); + } + } +} diff --git a/share/qtcreator/welcomescreen/widgets/SideBar.qml b/share/qtcreator/welcomescreen/widgets/SideBar.qml index 521bf45c5d5..a1c392f9a86 100644 --- a/share/qtcreator/welcomescreen/widgets/SideBar.qml +++ b/share/qtcreator/welcomescreen/widgets/SideBar.qml @@ -132,47 +132,20 @@ ColumnLayout { Column { x: 14 spacing: 16 - Row { - spacing: 7 - Image { - width: 16 - height: 15 - source: "images/icons/onlineCommunity.png" - } - LinkedText { - text: qsTr("Online Community") - font.pixelSize: 11 - color: "black" - onClicked: gettingStarted.openUrl("http://qt-project.org/forums") - } + IconAndLink { + iconSource: "images/icons/onlineCommunity.png" + title: qsTr("Online Community") + openUrl: "http://qt-project.org/forums" } - Row { - spacing: 7 - Image { - height: 15 - width: 15 - source: "images/icons/blogs.png" - } - LinkedText { - text: qsTr("Blogs") - font.pixelSize: 11 - color: "black" - onClicked: gettingStarted.openUrl("http://planet.qt-project.org") - } + IconAndLink { + iconSource: "images/icons/blogs.png" + title: qsTr("Blogs") + openUrl: "http://planet.qt-project.org" } - Row { - spacing: 7 - Image { - width: 16 - height: 15 - source: "images/icons/userGuide.png" - } - LinkedText { - text: qsTr("User Guide") - font.pixelSize: 11 - color: "black" - onClicked: gettingStarted.openHelp("qthelp://org.qt-project.qtcreator/doc/index.html") - } + IconAndLink { + iconSource: "images/icons/userGuide.png" + title: qsTr("User Guide") + openHelpUrl: "qthelp://org.qt-project.qtcreator/doc/index.html" } } }