Changeset View
Changeset View
Standalone View
Standalone View
applets/analog-clock/contents/ui/analogclock.qml
Show All 15 Lines | |||||
16 | * You should have received a copy of the GNU Library General Public | 16 | * You should have received a copy of the GNU Library General Public | ||
17 | * License along with this program; if not, write to the | 17 | * License along with this program; if not, write to the | ||
18 | * Free Software Foundation, Inc., | 18 | * Free Software Foundation, Inc., | ||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | import QtQuick 2.0 | 22 | import QtQuick 2.0 | ||
23 | import org.kde.plasma.plasmoid 2.0 | 23 | import org.kde.plasma.plasmoid 2.0 | ||
24 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | | |||
25 | import QtQuick.Layouts 1.1 | 24 | import QtQuick.Layouts 1.1 | ||
26 | 25 | | |||
27 | import org.kde.plasma.core 2.0 as PlasmaCore | 26 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
28 | import org.kde.plasma.components 3.0 as PlasmaComponents | 27 | import org.kde.plasma.components 3.0 as PlasmaComponents | ||
29 | 28 | | |||
30 | Item { | 29 | Item { | ||
31 | id: analogclock | 30 | id: analogclock | ||
32 | 31 | | |||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
81 | 80 | | |||
82 | Plasmoid.compactRepresentation: Item { | 81 | Plasmoid.compactRepresentation: Item { | ||
83 | id: representation | 82 | id: representation | ||
84 | Layout.minimumWidth: plasmoid.formFactor != PlasmaCore.Types.Vertical ? representation.height : units.gridUnit | 83 | Layout.minimumWidth: plasmoid.formFactor != PlasmaCore.Types.Vertical ? representation.height : units.gridUnit | ||
85 | Layout.minimumHeight: plasmoid.formFactor == PlasmaCore.Types.Vertical ? representation.width : units.gridUnit | 84 | Layout.minimumHeight: plasmoid.formFactor == PlasmaCore.Types.Vertical ? representation.width : units.gridUnit | ||
86 | 85 | | |||
87 | MouseArea { | 86 | MouseArea { | ||
88 | anchors.fill: parent | 87 | anchors.fill: parent | ||
89 | onClicked: plasmoid.expanded = !plasmoid.expanded | | |||
90 | } | 88 | } | ||
91 | 89 | | |||
92 | 90 | | |||
93 | PlasmaCore.Svg { | 91 | PlasmaCore.Svg { | ||
94 | id: clockSvg | 92 | id: clockSvg | ||
95 | imagePath: "widgets/clock" | 93 | imagePath: "widgets/clock" | ||
96 | } | 94 | } | ||
97 | 95 | | |||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 171 | PlasmaCore.FrameSvgItem { | |||
184 | PlasmaComponents.Label { | 182 | PlasmaComponents.Label { | ||
185 | id: timezoneText | 183 | id: timezoneText | ||
186 | x: timezoneBg.margins.left | 184 | x: timezoneBg.margins.left | ||
187 | y: timezoneBg.margins.top | 185 | y: timezoneBg.margins.top | ||
188 | text: dataSource.data["Local"]["Timezone"] | 186 | text: dataSource.data["Local"]["Timezone"] | ||
189 | } | 187 | } | ||
190 | } | 188 | } | ||
191 | } | 189 | } | ||
192 | Plasmoid.fullRepresentation: PlasmaCalendar.MonthView { | | |||
193 | Layout.minimumWidth: units.gridUnit * 20 | | |||
194 | Layout.minimumHeight: units.gridUnit * 20 | | |||
195 | | ||||
196 | today: dataSource.data["Local"]["DateTime"] | | |||
197 | } | | |||
198 | | ||||
199 | } | 190 | } |