Commit d1a0835b authored by Nate Graham's avatar Nate Graham 🔩

[applets/digital-clock] Remove the tooltip icon

Summary:
To increase consistency and reduce redundancy, widget tooltip icons are being removed
in D27847 and D27848, per discussion in T12778. This patch makes the Digital Clock
consistent what that initiative, since it has a custom tooltip.

Test Plan:
{F8150016}
{F8150021}

Reviewers: #vdg, #plasma, niccolove

Reviewed By: niccolove

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T12778

Differential Revision: https://phabricator.kde.org/D27849
parent 29587025
......@@ -36,79 +36,64 @@ Item {
PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
PlasmaCore.ColorScope.inherit: false
RowLayout {
ColumnLayout {
anchors {
left: parent.left
top: parent.top
margins: units.gridUnit / 2
}
spacing: units.largeSpacing
PlasmaCore.IconItem {
id: tooltipIcon
source: "preferences-system-time"
Layout.alignment: Qt.AlignTop
visible: true
implicitWidth: units.iconSizes.medium
Layout.preferredWidth: implicitWidth
Layout.preferredHeight: implicitWidth
PlasmaExtras.Heading {
id: tooltipMaintext
level: 3
Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth)
Layout.maximumWidth: preferredTextWidth
elide: Text.ElideRight
text: Qt.formatDate(tzDate,"dddd")
}
ColumnLayout {
PlasmaExtras.Heading {
id: tooltipMaintext
level: 3
Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth)
Layout.maximumWidth: preferredTextWidth
elide: Text.ElideRight
text: Qt.formatDate(tzDate,"dddd")
}
PlasmaComponents.Label {
id: tooltipSubtext
Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth)
Layout.maximumWidth: preferredTextWidth
text: Qt.formatDate(tzDate, dateFormatString)
opacity: 0.6
}
GridLayout {
Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth)
Layout.maximumWidth: preferredTextWidth
Layout.maximumHeight: childrenRect.height
columns: 2
visible: plasmoid.configuration.selectedTimeZones.length > 1
Repeater {
model: {
// The timezones need to be duplicated in the array
// because we need their data twice - once for the name
// and once for the time and the Repeater delegate cannot
// be one Item with two Labels because that wouldn't work
// in a grid then
var timezones = [];
for (var i = 0; i < plasmoid.configuration.selectedTimeZones.length; i++) {
timezones.push(plasmoid.configuration.selectedTimeZones[i]);
timezones.push(plasmoid.configuration.selectedTimeZones[i]);
}
PlasmaComponents.Label {
id: tooltipSubtext
Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth)
Layout.maximumWidth: preferredTextWidth
text: Qt.formatDate(tzDate, dateFormatString)
opacity: 0.6
}
return timezones;
GridLayout {
Layout.minimumWidth: Math.min(implicitWidth, preferredTextWidth)
Layout.maximumWidth: preferredTextWidth
Layout.maximumHeight: childrenRect.height
columns: 2
visible: plasmoid.configuration.selectedTimeZones.length > 1
Repeater {
model: {
// The timezones need to be duplicated in the array
// because we need their data twice - once for the name
// and once for the time and the Repeater delegate cannot
// be one Item with two Labels because that wouldn't work
// in a grid then
var timezones = [];
for (var i = 0; i < plasmoid.configuration.selectedTimeZones.length; i++) {
timezones.push(plasmoid.configuration.selectedTimeZones[i]);
timezones.push(plasmoid.configuration.selectedTimeZones[i]);
}
PlasmaComponents.Label {
id: timezone
// Layout.fillWidth is buggy here
Layout.alignment: index % 2 === 0 ? Qt.AlignRight : Qt.AlignLeft
return timezones;
}
wrapMode: Text.NoWrap
text: index % 2 == 0 ? nameForZone(modelData) : timeForZone(modelData)
font.weight: modelData === plasmoid.configuration.lastSelectedTimezone ? Font.Bold : Font.Normal
height: paintedHeight
elide: Text.ElideNone
opacity: 0.6
}
PlasmaComponents.Label {
id: timezone
// Layout.fillWidth is buggy here
Layout.alignment: index % 2 === 0 ? Qt.AlignRight : Qt.AlignLeft
wrapMode: Text.NoWrap
text: index % 2 == 0 ? nameForZone(modelData) : timeForZone(modelData)
font.weight: modelData === plasmoid.configuration.lastSelectedTimezone ? Font.Bold : Font.Normal
height: paintedHeight
elide: Text.ElideNone
opacity: 0.6
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment