This forum has been archived. All content is frozen. Please use KDE Discuss instead.

SVG rendering in Plasma 5

Tags: None
(comma "," separated)
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

SVG rendering in Plasma 5

Tue May 14, 2019 4:44 pm
Hi,
I was wondering if anyone here would know the answer to this question on the Kubuntu forums:
https://www.kubuntuforums.net/showthrea ... n-Plasma-5
They keep referring me here.
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: SVG rendering in Plasma 5

Thu May 16, 2019 10:54 am
I'll try again with the actual question:

Now, I happen to believe that the Elegance theme clock is the best plasma clock ever made.
On 14.04, it looked like this:

Image

Nice, eh?
On 18.04, it looks like this:

Image

Nice, but... not quite so nice, right?
I mean, the minutes and seconds hands look... wrong, don't they?

Now, I tried editing the .svg with Inkscape. Didn't work.
I tried replacing the file with the old KDE4 one. Didn't work.

It must be that plasma 5 renders SVGs differently... or thereabouts.
Does anyone know if and how there's anything to be done?
Because the Elegance Theme developer doesn't seem to be active anymore... well, I can't find him.
frinring
Registered Member
Posts
11
Karma
0

Re: SVG rendering in Plasma 5

Thu May 16, 2019 4:23 pm
Sadly the code in Plasma5 has different assumptions about the default offset in the hands around which they should be rotated. And thus breaking existing themes from KDE4 times.

Starting with Plasma 5.16, there is now at least the option for themes to overrule the default offset, using new hints. See https://techbase.kde.org/Development/Tutorials/Plasma5/ThemePortingToPlasma5#Analog_clock and also compare the respective fix for the Oxygen & Air theme clocks: https://cgit.kde.org/plasma-framework.git/commit/?id=37a1845bc40ab5f71666adbe9f92f2c17f61c443.
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: SVG rendering in Plasma 5

Thu May 16, 2019 5:22 pm
Oh well. I guess there's nothing to be done then.
To start with, I have Plasma 5.12.7 (Qt 5.9.5)
And then, those diffs don't seem to apply to the old SVG. They seem to use a totally different language.

Pity though. KDE lost the only really good-looking clock they had.
Unless... someone can point me to one that's even half as good-looking... or... rewrite that one :)
frinring
Registered Member
Posts
11
Karma
0

Re: SVG rendering in Plasma 5

Thu May 16, 2019 11:23 pm
Once you are able to update your system to Plasma 5.16· you can add this snippet before the final "</svg>" in the widgets/clock.svg file:
Code: Select all
  <circle
     style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
     id="hint-hourhand-rotation-center-offset"
     r="2"
     cx="125"
     cy="125" />
  <circle
     style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
     id="hint-minutehand-rotation-center-offset"
     r="2"
     cx="125"
     cy="125" />
  <circle
     style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
     id="hint-secondhand-rotation-center-offset"
     r="2"
     cx="125"
     cy="125" />

With that the clock hands are again pinned to the clock center as they used to be with KDE4.
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: SVG rendering in Plasma 5

Fri May 17, 2019 8:51 am
Wow, thanks.
To upgrade the Plasma, do I just add the backports repository and wait?
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS

Re: SVG rendering in Plasma 5

Fri May 17, 2019 2:32 pm
Don B. Cilly wrote:Wow, thanks.
To upgrade the Plasma, do I just add the backports repository and wait?

Assuming you run Kubuntu 19.04, and not some other distro 8-) , maybe, if/when they backport it from the future 19.10. Likely they will.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: SVG rendering in Plasma 5

Fri May 17, 2019 2:59 pm
I run 18.04... any way I can "force" the Plasma upgrade?
:<
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS

Re: SVG rendering in Plasma 5

Fri May 17, 2019 4:32 pm
Don B. Cilly wrote:I run 18.04... any way I can "force" the Plasma upgrade?
:<


You won't get anything past Plasma 5.12.x (LTS) on 18.04, even with PPAs. You would need to upgrade to 19.04 or later when Plasma 5.16 is out, else move to a distro that will have the latest Plasma when it is released, such as KDE Neon (which will be very similar to Kubuntu as both use Ubuntu as a base) or a rolling-release distro such as Arch and its derivatives.


Now, if you are adventurous, there is an unstable build of Neon that should have 5.16 pre-release code you can try


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
User avatar
Don B. Cilly
Registered Member
Posts
31
Karma
0
OS

Re: SVG rendering in Plasma 5

Sat May 18, 2019 4:13 am
Not feeling particularly adventurous, I got the Neon and tried it in a VM.
I edited the .svg and... drum roll... it works! Log-out, log-in, pam. Beautiful.

I then tried it on my current Plasma (just in case you were taking the... ;·) and, sure enough, it didn't.
Still, thank you very much. Glimmers of hope on the horizon.
Now, I'm very much an LTS boy - and tend to run them into the ground - for the simple reason that dist-upgrades don't usually work, and re-customising takes ages.
But... maybe some adventurous soul will put that fix into mere-mortal plasma releases... eventually... :·/

Thanks again.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]