Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/core/private/DefaultToolTip.qml
Show All 18 Lines | |||||
19 | 19 | | |||
20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 | ||
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 | ||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
25 | 25 | | |||
26 | 26 | | |||
27 | Item { | 27 | PlasmaCore.ColorScope { | ||
28 | id: tooltipContentItem | 28 | id: tooltipContentItem | ||
29 | 29 | | |||
30 | property Item toolTip | 30 | property Item toolTip | ||
31 | property int preferredTextWidth: units.gridUnit * 20 | 31 | property int preferredTextWidth: units.gridUnit * 20 | ||
32 | 32 | | |||
33 | Layout.minimumWidth: childrenRect.width + units.gridUnit | 33 | Layout.minimumWidth: childrenRect.width + units.gridUnit | ||
34 | Layout.minimumHeight: childrenRect.height + units.gridUnit | 34 | Layout.minimumHeight: childrenRect.height + units.gridUnit | ||
35 | Layout.maximumWidth: childrenRect.width + units.gridUnit | 35 | Layout.maximumWidth: childrenRect.width + units.gridUnit | ||
36 | Layout.maximumHeight: childrenRect.height + units.gridUnit | 36 | Layout.maximumHeight: childrenRect.height + units.gridUnit | ||
37 | 37 | | |||
38 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | 38 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | ||
39 | LayoutMirroring.childrenInherit: true | 39 | LayoutMirroring.childrenInherit: true | ||
40 | colorGroup: PlasmaCore.Theme.NormalColorGroup | ||||
41 | inherit: false | ||||
40 | 42 | | |||
41 | RowLayout { | 43 | RowLayout { | ||
42 | 44 | | |||
43 | anchors { | 45 | anchors { | ||
44 | left: parent.left | 46 | left: parent.left | ||
45 | top: parent.top | 47 | top: parent.top | ||
46 | margins: units.gridUnit / 2 | 48 | margins: units.gridUnit / 2 | ||
47 | } | 49 | } | ||
48 | 50 | | |||
49 | spacing: units.largeSpacing | 51 | spacing: units.largeSpacing | ||
50 | 52 | | |||
51 | Image { | 53 | Image { | ||
52 | id: tooltipImage | 54 | id: tooltipImage | ||
53 | source: toolTip ? toolTip.image : "" | 55 | source: toolTip ? toolTip.image : "" | ||
54 | visible: toolTip != null && toolTip.image != "" | 56 | visible: toolTip != null && toolTip.image != "" | ||
55 | Layout.alignment: Qt.AlignTop | 57 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter | ||
56 | } | 58 | } | ||
57 | 59 | | |||
58 | PlasmaCore.IconItem { | 60 | PlasmaCore.IconItem { | ||
59 | id: tooltipIcon | 61 | id: tooltipIcon | ||
60 | animated: false | 62 | animated: false | ||
61 | source: toolTip ? toolTip.icon : "" | 63 | source: toolTip ? toolTip.icon : "" | ||
62 | Layout.alignment: Qt.AlignTop | 64 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter | ||
63 | visible: toolTip != null && toolTip.icon != "" && toolTip.image == "" && valid | 65 | visible: toolTip != null && toolTip.icon != "" && toolTip.image == "" && valid | ||
64 | Layout.preferredWidth: units.iconSizes.medium | 66 | Layout.preferredWidth: units.iconSizes.medium | ||
65 | Layout.preferredHeight: units.iconSizes.medium | 67 | Layout.preferredHeight: units.iconSizes.medium | ||
66 | } | 68 | } | ||
67 | 69 | | |||
68 | ColumnLayout { | 70 | ColumnLayout { | ||
69 | Layout.maximumWidth: preferredTextWidth | 71 | Layout.maximumWidth: preferredTextWidth | ||
70 | 72 | | |||
Show All 26 Lines |