/** Copyright 2013 by Sebastian KΓΌgler <sebas@kde.org>* Copyright 2014 by Martin GrΓ€Γlin <mgraesslin@kde.org>** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU Library General Public License as* published by the Free Software Foundation; either version 2, or* (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU Library General Public License for more details** You should have received a copy of the GNU Library General Public* License along with this program; if not, write to the* Free Software Foundation, Inc.,* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.*/import QtQuick 2.0import QtQuick.Layouts 1.1import org.kde.plasma.core 2.0 as PlasmaCoreimport org.kde.plasma.components 2.0 as PlasmaComponentsimport org.kde.plasma.extras 2.0 as PlasmaExtrasimport org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddonsColumn {id: tooltipContentItemproperty Item toolTipproperty int preferredTextWidth: theme.mSize(theme.defaultFont).width * 30property int _s: units.largeSpacing / 2Layout.minimumWidth: widthLayout.minimumHeight: heightLayout.maximumWidth: widthLayout.maximumHeight: heightwidth: childrenRect.width + _sheight: childrenRect.heightspacing: _sRow {anchors.horizontalCenter: parent.horizontalCenterwidth: childrenRect.widthheight: childrenRect.heightspacing: units.largeSpacingRepeater {model: toolTip ? toolTip.windows : nullPlasmaCore.WindowThumbnail {y: _swidth: units.gridUnit * 15height: units.gridUnit * 10winId: modelDataMouseArea {anchors.fill: parentacceptedButtons: Qt.LeftButtononClicked: {tasks.activateWindow(modelData);toolTip.hideToolTip()}}}}}Row {anchors.horizontalCenter: parent.horizontalCenterwidth: childrenRect.width + _sheight: childrenRect.height + units.largeSpacingspacing: units.largeSpacingItem {id: imageContainervisible: toolTip != null && toolTip.icon != nullwidth: tooltipIcon.widthheight: tooltipIcon.heighty: _sPlasmaCore.IconItem {id: tooltipIconx: _swidth: toolTip != undefined && toolTip.icon != null ? units.iconSizes.desktop : 0height: widthsource: toolTip != undefined && toolTip.icon != null ? toolTip.icon : ""}}Column {id: mainColumny: _s//This instance is purely for metricsPlasmaExtras.Heading {id: tooltipMaintextPlaceholdervisible: falselevel: 3text: toolTip ? toolTip.mainText : ""}PlasmaExtras.Heading {id: tooltipMaintextlevel: 3width: Math.min(tooltipMaintextPlaceholder.width, preferredTextWidth)//width: 400elide: Text.ElideRighttext: toolTip ? toolTip.mainText : ""}PlasmaComponents.Label {id: tooltipSubtextwidth: tooltipContentItem.preferredTextWidthwrapMode: Text.WordWraptext: toolTip ? toolTip.subText : ""opacity: 0.5}}}}