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

1
7 .0
Description:

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)
Last changelog:

Less CPU intensive 2 years ago

Date check done only when the day actually changes

10

adomas

3 months ago

10 Interesting idea! I like it!

Report

C

Refused

1 month ago

Thank you!!

Report

10

oldfield

6 months ago

10 10 the best

Report

C

Refused

1 month ago

Thanks!!

Report

9

avlas

2 years ago

It doesn't seem to update the percentage automatically, does it? I mean, if plasma is running for days, one needs to restart plasma manually to get the % updated...

Report

C

Refused

2 years ago

Yes it does: the day is checked one every hour.

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

Every 2 seconds seems excessive. The "time" dataengine, which the Digital Clock, Fuzzy Clock, etc uses, has a property to show the current time. It also has the ability to AlignToHour, which means it only updates when the hour changes.

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

C

Refused

2 years ago

Thanks for your feedback!
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

Notice how fuzzyclock has a property named currentDateTime? Every property you define has a on_____Changed signal you can bind to. Since currentDateTime has a binding to dataSource.data.Local.DateTime, every time the dataengine updates, it will update currentDateTime too.

Here's an example you can use to test the differences between AlignToHour, AlignToMinute and AlignToSecond.
https://gist.github.com/Zren/01d81eb74037fd038358b0fa426243c4

Report

C

Refused

2 years ago

Oh well, it was quite easy :D Thanks for your support!

Report

9

avlas

2 years ago

Sounds great! It was few days since I used my laptop last time, and realized of this. Now I understand that less than an hour passed and that explains it wasn't updated (yet).

Report

9

avlas

2 years ago

9 + Nice minimalistic year progress bar!

Report

C

Refused

2 years ago

Thank you!

Report

9

avlas

2 years ago

Thanks! Very nice and minimalistic plasmoid :)

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

C

Refused

2 years ago

Thanks for your feedback. Actually, the value was just truncated to integer, now it shows the first digit as well (so, no need to add 0.5)

Report

Less CPU intensive 2 years ago

Date check done only when the day actually changes

12345678910
12
product-maker adomas Jul 11 2020 10 the best
Interesting idea! I like it!
product-maker oldfield Apr 05 2020 10 the best
10 the best
product-maker avlas Aug 10 2018 9 excellent
+ Nice minimalistic year progress bar!
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
xiaoyan
Jun 27 2019
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
GPLv2 or later
version
1.0.4
updated Sep 13 2018
added Aug 08 2018
downloads 24h
1
mediaviews 24h 0
pageviews 24h 2