Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/core/private/DefaultToolTip.qml
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 58 | PlasmaCore.IconItem { | |||
---|---|---|---|---|---|
61 | source: toolTip ? toolTip.icon : "" | 61 | source: toolTip ? toolTip.icon : "" | ||
62 | Layout.alignment: Qt.AlignTop | 62 | Layout.alignment: Qt.AlignTop | ||
63 | visible: toolTip != null && toolTip.icon != "" && toolTip.image == "" && valid | 63 | visible: toolTip != null && toolTip.icon != "" && toolTip.image == "" && valid | ||
64 | Layout.preferredWidth: units.iconSizes.medium | 64 | Layout.preferredWidth: units.iconSizes.medium | ||
65 | Layout.preferredHeight: units.iconSizes.medium | 65 | Layout.preferredHeight: units.iconSizes.medium | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | ColumnLayout { | 68 | ColumnLayout { | ||
69 | Layout.maximumWidth: preferredTextWidth | ||||
69 | 70 | | |||
70 | PlasmaExtras.Heading { | 71 | PlasmaExtras.Heading { | ||
71 | id: tooltipMaintext | 72 | id: tooltipMaintext | ||
72 | level: 3 | 73 | level: 3 | ||
73 | property int _width: Math.min(implicitWidth, preferredTextWidth) | 74 | Layout.fillWidth: true | ||
74 | Layout.minimumWidth: _width | | |||
75 | Layout.maximumWidth: preferredTextWidth | | |||
76 | elide: Text.ElideRight | 75 | elide: Text.ElideRight | ||
77 | wrapMode: Text.Wrap | 76 | wrapMode: Text.Wrap | ||
78 | text: toolTip ? toolTip.mainText : "" | 77 | text: toolTip ? toolTip.mainText : "" | ||
79 | visible: text != "" | 78 | visible: text != "" | ||
80 | } | 79 | } | ||
81 | PlasmaComponents.Label { | 80 | PlasmaComponents.Label { | ||
82 | id: tooltipSubtext | 81 | id: tooltipSubtext | ||
83 | property int _width: Math.min(implicitWidth, preferredTextWidth) | 82 | Layout.fillWidth: true | ||
84 | Layout.minimumWidth: _width | 83 | // Unset Label default height, confuses the layout engine completely | ||
85 | Layout.maximumWidth: preferredTextWidth | 84 | // either shifting the item vertically or letting it get too wide | ||
85 | height: undefined | ||||
86 | wrapMode: Text.WordWrap | 86 | wrapMode: Text.WordWrap | ||
87 | text: toolTip ? toolTip.subText : "" | 87 | text: toolTip ? toolTip.subText : "" | ||
88 | textFormat: toolTip ? toolTip.textFormat : Text.AutoText | 88 | textFormat: toolTip ? toolTip.textFormat : Text.AutoText | ||
89 | opacity: 0.6 | 89 | opacity: 0.6 | ||
90 | visible: text != "" | 90 | visible: text != "" | ||
91 | maximumLineCount: 8 | 91 | maximumLineCount: 8 | ||
92 | } | 92 | } | ||
93 | } | 93 | } | ||
94 | } | 94 | } | ||
95 | } | 95 | } | ||
96 | 96 | |