
YearProgress
Plasma 5 Calendars plasma plasmoid
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
A simple progress bar, in pure QML, indicating the time elapsed since the beginning of the year, as a percentage (inspired by https://twitter.com/ProgressBar201X)
Less CPU intensive 2 years ago
Date check done only when the day actually changes
Less CPU intensive 2 years ago
Date check done only when the day actually changes
mehant
13 days ago
Report
adomas
7 months ago
Report
Refused
6 months ago
Report
oldfield
10 months ago
Report
Refused
6 months ago
Report
avlas
2 years ago
Report
Refused
2 years ago
You can try it by yourself (don't forget to revert the canges, rebuild and reinstall):
- edit src/yearprogressplasmoid.cpp replacing 60000 with 2000 at row 47, so it will be updated every two seconds,
- make && sudo make install && plasmoidviewer -a org.kde.yearprogressplasmoid.
- change the system date by some weeks ahead and you will see the percentage changing.
Report
Zren
2 years ago
You ought to look into the fuzzyclock widget for a simple example.
https://github.com/KDE/kdeplasma-addons/blob/master/applets/fuzzy-clock/package/contents/ui/main.qml
Here's where AlignToSecond, AlignToMinute, and AlignToHour is defined if you're interested in that enum.
https://github.com/KDE/plasma-framework/blob/38431eebfa1286c11d5bb716f7d65c1a660b535d/src/plasma/plasma.h#L207
You could bind to:
onCurrentDateTimeChanged: {
updateYearProgressSlider()
}
Report
Refused
2 years ago
2 seconds were suggested just for testing. It is actually one hour.
I've already tried the time dataengine but I could not find the currentDateTimeChanged signal: I believe that just newData is available and I should do the "date check" manually.
I could anyway use the current timer and correct just the first cycle.
Hints are welcome!
Report
Zren
2 years ago
Here's an example you can use to test the differences between AlignToHour, AlignToMinute and AlignToSecond.
https://gist.github.com/Zren/01d81eb74037fd038358b0fa426243c4
Report
Refused
2 years ago
Report
avlas
2 years ago
Report
avlas
2 years ago
Report
Refused
2 years ago
Report
avlas
2 years ago
May I suggest a tiny improvement? Please add +0.5 to properly round l_result -> in yearprogressplasmoid.cpp (line 69) -> l_result = ((qreal)l_days_elapsed/(qreal)l_days_total) * 100 + 0.5;
Report
Refused
2 years ago
Report