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
|
2010-03-10 12:45:49 +02:00
|
|
|
|
2014-06-19 17:53:25 +02:00
|
|
|
Rectangle {
|
|
|
|
|
color: styleConstants.lighterBackgroundColor
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2014-06-19 17:53:25 +02:00
|
|
|
border.color: styleConstants.backgroundColor
|
|
|
|
|
border.width: 1
|
2010-03-10 12:45:49 +02:00
|
|
|
|
2010-02-16 17:24:18 +02:00
|
|
|
|
|
|
|
|
Image {
|
2014-06-19 17:53:25 +02:00
|
|
|
id: itemIcon // to be set by model
|
2010-02-16 17:24:18 +02:00
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
2014-06-19 17:53:25 +02:00
|
|
|
anchors.topMargin: styleConstants.cellVerticalMargin
|
2010-02-16 17:24:18 +02:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
2010-03-10 12:45:49 +02:00
|
|
|
width: itemLibraryIconWidth // to be set in Qml context
|
|
|
|
|
height: itemLibraryIconHeight // to be set in Qml context
|
2010-07-13 10:11:05 +10:00
|
|
|
source: itemLibraryIconPath // to be set by model
|
2010-02-16 17:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
id: text
|
2014-06-19 18:26:34 +02:00
|
|
|
font.pixelSize: 11
|
2010-03-18 13:17:24 +02:00
|
|
|
elide: Text.ElideMiddle
|
2014-06-19 17:53:25 +02:00
|
|
|
wrapMode: Text.WordWrap
|
2010-02-16 17:24:18 +02:00
|
|
|
anchors.top: itemIcon.bottom
|
2014-06-19 17:53:25 +02:00
|
|
|
anchors.topMargin: styleConstants.cellVerticalSpacing
|
2010-03-10 12:45:49 +02:00
|
|
|
anchors.left: parent.left
|
2014-06-19 17:53:25 +02:00
|
|
|
anchors.leftMargin: styleConstants.cellHorizontalMargin
|
2010-03-18 13:17:24 +02:00
|
|
|
anchors.right: parent.right
|
2014-06-19 17:53:25 +02:00
|
|
|
anchors.rightMargin: styleConstants.cellHorizontalMargin
|
2014-07-03 13:54:48 +02:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.bottomMargin: styleConstants.cellHorizontalMargin
|
2010-02-16 17:24:18 +02:00
|
|
|
|
2014-07-03 13:54:48 +02:00
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
2010-03-10 12:45:49 +02:00
|
|
|
text: itemName // to be set by model
|
2014-06-19 17:53:25 +02:00
|
|
|
color: "#FFFFFF"
|
2013-09-18 12:40:51 +02:00
|
|
|
renderType: Text.NativeRendering
|
2010-02-16 17:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
2010-03-05 10:19:38 +01:00
|
|
|
MouseArea {
|
2010-03-10 12:45:49 +02:00
|
|
|
id: mouseRegion
|
2010-02-16 17:24:18 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
|
|
2010-02-19 14:21:36 +02:00
|
|
|
property bool reallyPressed: false
|
|
|
|
|
property int pressedX
|
|
|
|
|
property int pressedY
|
|
|
|
|
|
|
|
|
|
onPressed: {
|
2014-06-30 13:32:13 +02:00
|
|
|
rootView.startDragAndDrop(itemLibraryEntry)
|
2010-02-16 17:24:18 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|