Warning, /plasma/latte-dock/declarativeimports/components/ToolTip.qml is written in an unsupported language. File is not indexed.

0001 /*
0002 *  Copyright 2019  Michail Vourlakos <mvourlakos@gmail.com>
0003 *
0004 *  This file is part of Latte-Dock
0005 *
0006 *  Latte-Dock is free software; you can redistribute it and/or
0007 *  modify it under the terms of the GNU General Public License as
0008 *  published by the Free Software Foundation; either version 2 of
0009 *  the License, or (at your option) any later version.
0010 *
0011 *  Latte-Dock is distributed in the hope that it will be useful,
0012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 *  GNU General Public License for more details.
0015 *
0016 *  You should have received a copy of the GNU General Public License
0017 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 import QtQuick 2.6
0021 import QtQuick.Controls 1.4
0022 import QtQuick.Templates 2.2 as T
0023 import org.kde.plasma.core 2.0 as PlasmaCore
0024 
0025 T.ToolTip {
0026     id: control
0027 
0028     x: parent ? (parent.width - implicitWidth) / 2 : 0
0029     y: -implicitHeight - 3
0030 
0031     implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
0032     implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
0033 
0034     margins: units.gridUnit
0035     leftPadding: background.margins.left
0036     topPadding: background.margins.top
0037     rightPadding: background.margins.right
0038     bottomPadding: background.margins.bottom
0039 
0040     closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
0041 
0042     contentItem: Label {
0043         text: control.text
0044         font: control.font
0045         color: PlasmaCore.ColorScope.textColor
0046     }
0047 
0048     background: PlasmaCore.FrameSvgItem {
0049         imagePath: "widgets/background"
0050         enabledBorders: PlasmaCore.FrameSvg.AllBorders
0051     }
0052 }