Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/ui/DigitalClock.qml
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 27 | Item { | |||
---|---|---|---|---|---|
55 | // This is the index in the list of user selected timezones | 55 | // This is the index in the list of user selected timezones | ||
56 | property int tzIndex: 0 | 56 | property int tzIndex: 0 | ||
57 | 57 | | |||
58 | // if the date/timezone cannot be fit with the smallest font to its designated space | 58 | // if the date/timezone cannot be fit with the smallest font to its designated space | ||
59 | readonly property bool oneLineMode: plasmoid.formFactor === PlasmaCore.Types.Horizontal && | 59 | readonly property bool oneLineMode: plasmoid.formFactor === PlasmaCore.Types.Horizontal && | ||
60 | main.height <= 2 * theme.smallestFont.pixelSize && | 60 | main.height <= 2 * theme.smallestFont.pixelSize && | ||
61 | (main.showDate || timezoneLabel.visible) | 61 | (main.showDate || timezoneLabel.visible) | ||
62 | 62 | | |||
63 | onDateFormatChanged: { | 63 | function onDateFormatChanged() { | ||
64 | setupLabels(); | 64 | setupLabels(); | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | onDisplayTimezoneAsCodeChanged: { setupLabels(); } | 67 | function onDisplayTimezoneAsCodeChanged() { setupLabels(); } | ||
68 | onStateChanged: { setupLabels(); } | 68 | function onStateChanged() { setupLabels(); } | ||
69 | 69 | | |||
70 | onLastSelectedTimezoneChanged: { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | 70 | function onLastSelectedTimezoneChanged() { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | ||
71 | onShowSecondsChanged: { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | 71 | function onShowSecondsChanged() { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | ||
72 | onShowLocalTimezoneChanged: { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | 72 | function onShowLocalTimezoneChanged() { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | ||
73 | onShowDateChanged: { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | 73 | function onShowDateChanged() { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | ||
74 | onUse24hFormatChanged: { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | 74 | function onUse24hFormatChanged() { timeFormatCorrection(Qt.locale().timeFormat(Locale.ShortFormat)) } | ||
75 | 75 | | |||
76 | Connections { | 76 | Connections { | ||
77 | target: plasmoid | 77 | target: plasmoid | ||
78 | onContextualActionsAboutToShow: { | 78 | onContextualActionsAboutToShow: { | ||
79 | ClipboardMenu.secondsIncluded = main.showSeconds; | 79 | ClipboardMenu.secondsIncluded = main.showSeconds; | ||
80 | ClipboardMenu.currentDate = main.currentTime; | 80 | ClipboardMenu.currentDate = main.currentTime; | ||
81 | } | 81 | } | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | Connections { | 84 | Connections { | ||
85 | target: plasmoid.configuration | 85 | target: plasmoid.configuration | ||
86 | onSelectedTimeZonesChanged: { | 86 | function onSelectedTimeZonesChanged() { | ||
87 | // If the currently selected timezone was removed, | 87 | // If the currently selected timezone was removed, | ||
88 | // default to the first one in the list | 88 | // default to the first one in the list | ||
89 | var lastSelectedTimezone = plasmoid.configuration.lastSelectedTimezone; | 89 | var lastSelectedTimezone = plasmoid.configuration.lastSelectedTimezone; | ||
90 | if (plasmoid.configuration.selectedTimeZones.indexOf(lastSelectedTimezone) === -1) { | 90 | if (plasmoid.configuration.selectedTimeZones.indexOf(lastSelectedTimezone) === -1) { | ||
91 | plasmoid.configuration.lastSelectedTimezone = plasmoid.configuration.selectedTimeZones[0]; | 91 | plasmoid.configuration.lastSelectedTimezone = plasmoid.configuration.selectedTimeZones[0]; | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | setupLabels(); | 94 | setupLabels(); | ||
▲ Show 20 Lines • Show All 605 Lines • Show Last 20 Lines |