From 0ef9782b11bae3f62efe37be009fe09afef6de0d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 11 Oct 2017 17:41:51 +0200 Subject: [PATCH] Make calendar pin persistent across sessions Summary: A user can "pin" the calendar so that it won't get closed on focus change, but only when the clock is clicked again. This persists across open/close operations, but currently doesn't persist across Plasma restarts. This patch loads the saved config value of the last pinned state. Test Plan: Opened calendar, set pin, closed it, reopened and it was still pinned (which is the current state) killed plasma, restarted plasma, was still pinned (new) Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D8252 --- applets/digital-clock/package/contents/config/main.xml | 4 ++++ .../digital-clock/package/contents/ui/CalendarView.qml | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/applets/digital-clock/package/contents/config/main.xml b/applets/digital-clock/package/contents/config/main.xml index 4d19fb5fb..df89e0cc7 100644 --- a/applets/digital-clock/package/contents/config/main.xml +++ b/applets/digital-clock/package/contents/config/main.xml @@ -65,5 +65,9 @@ + + + false + diff --git a/applets/digital-clock/package/contents/ui/CalendarView.qml b/applets/digital-clock/package/contents/ui/CalendarView.qml index dd51acfaf..533346da4 100644 --- a/applets/digital-clock/package/contents/ui/CalendarView.qml +++ b/applets/digital-clock/package/contents/ui/CalendarView.qml @@ -120,6 +120,12 @@ Item { } } + Binding { + target: plasmoid + property: "hideOnWindowDeactivate" + value: !plasmoid.configuration.pin + } + PlasmaComponents.Label { id: dayLabel anchors.left: parent.left @@ -347,6 +353,7 @@ Item { height: width checkable: true iconSource: "window-pin" - onCheckedChanged: plasmoid.hideOnWindowDeactivate = !checked + checked: plasmoid.configuration.pin + onCheckedChanged: plasmoid.configuration.pin = checked } }