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
wilder-5.14
David Edmundson 9 years ago
parent e7fb53714a
commit 0ef9782b11
  1. 4
      applets/digital-clock/package/contents/config/main.xml
  2. 9
      applets/digital-clock/package/contents/ui/CalendarView.qml

@ -65,5 +65,9 @@
<label>A list of plugins where additional calendar event data can be sourced.</label>
<default></default>
</entry>
<entry name="pin" type="Bool">
<label>Whether the popup should remain open when another window is activated</label>
<default>false</default>
</entry>
</group>
</kcfg>

@ -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
}
}

Loading…
Cancel
Save