2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-02-16 19:07:59 +02:00
|
|
|
**
|
2016-01-15 14:59:14 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-02-16 19:07:59 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-02-16 19:07:59 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:59:14 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-02-16 19:07:59 +02:00
|
|
|
**
|
2015-09-18 11:34:48 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
2016-01-15 14:59:14 +01:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-02-16 19:07:59 +02:00
|
|
|
|
2013-09-13 17:06:10 +02:00
|
|
|
import QtQuick 2.1
|
2014-06-19 17:53:25 +02:00
|
|
|
import QtQuick.Controls 1.1
|
|
|
|
|
import QtQuick.Controls.Styles 1.0
|
2017-03-07 16:06:02 +01:00
|
|
|
import QtQuickDesignerTheme 1.0
|
2010-03-10 12:45:49 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
Item {
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.rightMargin: 1
|
|
|
|
|
anchors.topMargin: 1
|
|
|
|
|
anchors.fill: parent
|
2010-03-10 12:45:49 +02:00
|
|
|
|
2017-03-07 16:06:02 +01:00
|
|
|
color: Theme.qmlDesignerButtonColor()
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
Image {
|
|
|
|
|
id: itemIcon // to be set by model
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: styleConstants.cellVerticalMargin
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
width: itemLibraryIconWidth // to be set in Qml context
|
|
|
|
|
height: itemLibraryIconHeight // to be set in Qml context
|
|
|
|
|
source: itemLibraryIconPath // to be set by model
|
|
|
|
|
}
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
Text {
|
|
|
|
|
id: text
|
|
|
|
|
font.pixelSize: 9
|
|
|
|
|
elide: Text.ElideMiddle
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
anchors.top: itemIcon.bottom
|
|
|
|
|
anchors.topMargin: styleConstants.cellVerticalSpacing
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.leftMargin: styleConstants.cellHorizontalMargin
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.rightMargin: styleConstants.cellHorizontalMargin
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.bottomMargin: styleConstants.cellHorizontalMargin
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
|
text: itemName // to be set by model
|
2017-03-07 16:06:02 +01:00
|
|
|
color: Theme.color(Theme.PanelTextColorLight)
|
2016-07-28 13:17:54 +02:00
|
|
|
renderType: Text.NativeRendering
|
|
|
|
|
}
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
MouseArea {
|
|
|
|
|
id: mouseRegion
|
|
|
|
|
anchors.fill: parent
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2016-07-28 13:17:54 +02:00
|
|
|
onPressed: {
|
2017-03-24 10:44:33 +01:00
|
|
|
rootView.startDragAndDrop(mouseRegion, itemLibraryEntry)
|
2016-07-28 13:17:54 +02:00
|
|
|
}
|
2010-02-16 17:24:18 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|