Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/Tooltip.qml
Show All 37 Lines | 26 | Item { | |||
---|---|---|---|---|---|
38 | 38 | | |||
39 | ColumnLayout { | 39 | ColumnLayout { | ||
40 | anchors { | 40 | anchors { | ||
41 | left: parent.left | 41 | left: parent.left | ||
42 | top: parent.top | 42 | top: parent.top | ||
43 | margins: units.gridUnit / 2 | 43 | margins: units.gridUnit / 2 | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | spacing: 0 | ||||
47 | | ||||
46 | PlasmaExtras.Heading { | 48 | PlasmaExtras.Heading { | ||
47 | id: tooltipMaintext | 49 | id: tooltipMaintext | ||
48 | level: 3 | 50 | level: 3 | ||
49 | Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) | 51 | Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) | ||
50 | Layout.maximumWidth: preferredTextWidth | 52 | Layout.maximumWidth: preferredTextWidth | ||
51 | elide: Text.ElideRight | 53 | elide: Text.ElideRight | ||
52 | text: Qt.formatDate(tzDate,"dddd") | 54 | text: clocks.visible ? Qt.formatDate(tzDate, Locale.LongFormat) : Qt.formatDate(tzDate,"dddd") | ||
53 | } | 55 | } | ||
54 | 56 | | |||
55 | PlasmaComponents.Label { | 57 | PlasmaComponents.Label { | ||
56 | id: tooltipSubtext | 58 | id: tooltipSubtext | ||
57 | Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) | 59 | Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) | ||
58 | Layout.maximumWidth: preferredTextWidth | 60 | Layout.maximumWidth: preferredTextWidth | ||
59 | text: Qt.formatDate(tzDate, dateFormatString) | 61 | text: Qt.formatDate(tzDate, dateFormatString) | ||
60 | opacity: 0.6 | 62 | opacity: 0.6 | ||
63 | visible: !clocks.visible | ||||
61 | } | 64 | } | ||
62 | 65 | | |||
63 | GridLayout { | 66 | GridLayout { | ||
67 | id: clocks | ||||
64 | Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) | 68 | Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth) | ||
65 | Layout.maximumWidth: preferredTextWidth | 69 | Layout.maximumWidth: preferredTextWidth | ||
66 | Layout.maximumHeight: childrenRect.height | 70 | Layout.maximumHeight: childrenRect.height | ||
67 | columns: 2 | 71 | columns: 2 | ||
68 | visible: plasmoid.configuration.selectedTimeZones.length > 1 | 72 | visible: plasmoid.configuration.selectedTimeZones.length > 1 | ||
73 | rowSpacing: 0 | ||||
69 | 74 | | |||
70 | Repeater { | 75 | Repeater { | ||
71 | model: { | 76 | model: { | ||
72 | // The timezones need to be duplicated in the array | 77 | // The timezones need to be duplicated in the array | ||
73 | // because we need their data twice - once for the name | 78 | // because we need their data twice - once for the name | ||
74 | // and once for the time and the Repeater delegate cannot | 79 | // and once for the time and the Repeater delegate cannot | ||
75 | // be one Item with two Labels because that wouldn't work | 80 | // be one Item with two Labels because that wouldn't work | ||
76 | // in a grid then | 81 | // in a grid then | ||
Show All 25 Lines |