 Hello and welcome to yet another episode of Yes! I've just done a bug fix to fix this plasma theme that is third party and that probably nobody or almost nobody is using, but nonetheless I've done that. So this that you're seeing right now on the screen is called Fluffy Bunny. Today we're going to talk about Fluffy Bunny. Are you happy? So, sorry, what's up with this theme? So what's the idea behind this theme? So leaving aside for one second the fact that it looks gorgeous, gorgeous, one very important point about this theme is that it allows us to test plasma themes with very large borders to make sure that they still work, you know. So do they work? So I actually received a bug report I think from another KD developer about the theme Fluffy. So I mean of course I took some time to try to investigate what was wrong and it's pretty easy to see that something does look wrong because if you just look at the panel you can see that there is like kickoff which is super small and then there is a gigantic task manager and then the system tray is also very small so not exactly ideal and if you go into edit mode and you start making the panel even smaller and smaller and smaller and smaller everything looks completely broken. So I mean of course I got through a bug report about this. Why wouldn't I get a bug report about this? Of course everybody uses Fluffy Bunny these days. All the cool kids use Fluffy Bunny. So I took some time to try to understand what and the first thing I did was to download Fluffy Bunny, try it, laugh and then I checked the files of Fluffy Bunny, how Fluffy Bunny is actually made, what is Fluffy Bunny made of. So you can find that in dot local and then sure and then plasma where is plasma here desktop theme Fluffy Bunny and this is Fluffy Bunny. So I'm particularly looking after the desktop, the panel sorry because everything else seems okay-ish like if I open up kickoff this looks okay and if I open up a tool tip this looks okay it's just the panel that looks broken so let's go investigate what's up with the panel and this is the SVG for the panel and when I saw it I was like what? Because you know there's actually something we are going on so here is our Fluffy Bunny and you can notice that we actually have five different versions of the Fluffy Bunny theme which is weird. In theory we should just have one so I went ahead and try to click on it and you can see that this is called the south panel and then I remembered that this theme is from KD4 and some of the things we add in KD4 we still kind of have in KD Plasma 5 but more of a legacy stuff and one of these legacy things that in theory we should still support is the ability to have different looks for the panel depending on the side of the screen it is on for some reason like let's say that the background of your panel is a text of course you can't have just one look because if it's on the left then the text should be rotated or something so you have to be able to have a different look for each side of the screen the panel is on so we have south we have west we have east and we have north nice so apparently something is broken because in theory this should work we have that each of this is made of six elements should be nine it should be nine this is gonna create issues but let's just forget about that for a second and we can also see that whoever did this theme which again comes from prehistoric times did not include any hint about the margins fine fair enough I actually downloaded a similar theme which is called unicorn this is unicorn I just can't I just this is unicorn it also looks broken we have gigantic kickoff that does not respect panel margins unicorn is just as gorgeous as fluff is so something is broken for both of these themes sorry so I went into the files and you know there's also the files for unicorn and if we go into the panel of the unicorn well firstly we see that whoever did this theme only bothered to do the bottom look of the theme because the east west and north parts don't look like you're supposed to like if I right now move this panel to the top in theory it should completely change its look yes now it's no longer a unicorn because the theme maker has decided that this was anyway something is still wrong but here's the thing this theme does have margin hints in theory this should avoid the fact that content is drawn on top of the border but even if we didn't have this which is the case for this one here we don't have them we when we don't have margin hints in theory we should take the size of these four elements as the hint theory so we should should still not see any content drawn on the borders so I investigate so here we have three different issues they look the same but there are three different things first let's switch back to fluffy banyas first we have that kickoff and this no actually let's start from that we have that the task manager is super big and covers the borders I investigated a bit and turns out this is actually intentional it's a feature that I implemented why is that because if you have a theme that is like sane why let's take white surdark as an example now white surdark also has very big borders around it because it has very rounded corners if we actually respect it those borders for the task manager then the task manager will be would be way too small and actually same goes for breeze if we go with breeze if we go with breeze you can see that the highlight like the current element that is being highlighted the highlight actually touches the panel border even though the top part of the normal breeze panel is still as small but border so when I made sure that the task manager feels all the available space that it has themes like the fluffy bany suffered from this because they don't look so pretty when the task manager covers the border but here's the thing nobody nobody really uses fluffy bany like we have to decide whether we want fluffy bany to look good or whether we want breeze and literally all other themes that have a same seen border look good and personally I think it's more important for breeze to look good than fluffy bany so this the task manager being super big is intentional it is second bug if we make the panel very small then everything is drawn on the border now here yet again we have to we have to remember that there are third party themes like whites or dark that have a very big border that actually looks normal like this a good portion of this in theory is a border so if we didn't allow for anything to be drawn on the border as an example by making sure that the panel cannot be smaller than x where x is 20 pixels plus the border then other themes such as whites or dark would suffer from it because they are completely fine with stuff being drawn on their border actually that is the whole point of their themes so again this is intentional intentional so one only one thing remains and that is if we have a very big panel then in theory nothing should be drawn on the border and we can see this better on unicorn go to unicorn we can see that stuff is like recklessly drawn here so this is clearly drawn on the border this is also drawn on border here there's a bit of margin because svgs have a bit of margins by themselves but look at here look at this component this is drawn on the border this is wrong it is almost as if the margins are currently not being read so I looked at the code and that was indeed the case currently we are not reading margins if sorry I'm just looking at the beauty of this theme like there's even a heart look at the hearts look at the hearts and the progress bar is actually beautiful so yeah anyway I was saying what what was ah yes something goes wrong let me show you what this is a mess in the panel containment um c++ code yeah so we have these svgs the whole point of these two svgs is to read how big the margin is why there are two because uh the panel has two margin areas a thick one and a normal one now here's the thing this is funny nobody uses this normal prefix literally nobody not even us not even kitty uses it it's something that I made up and then I didn't use myself for some reason and the reason is that it's completely useless I don't know why I even thought about it so you can just get rid of it so now the perfect prefix is just empty so what's wrong if we take the other panel qml in here we actually have the svgs that are drawn on the screen so here we just use them to read the margins here we draw them on the screen and here's the thing there is this nice function which is called adjust prefix which adjusted the prefix adjusts this the prefix of the svgs and this is very important if the panel is on the left then the prefix is west if it's on the top then it's north if it's on the right it's east and if it's on the bottom it's south this is to support what I was talking at the very beginning of the video these you know panels that look different depending on the border side and each of these different prefixes could decide on their own margins as they do so when we draw them we adjust the prefix but when we when we read the margin we don't so really that's it like we are not even trying to adjust the prefix to read the correct svgs and that means that no margin will be found because the correct prefix in this case would be south because the panel is on the bottom if we had a south prefix then everything would work but we don't and that doesn't work so it's as simple as reading where the panel is and setting the prefix accordingly that was it that made sure that all of the components except for the task manager had the correct size by actually reading the panel's margin so here's a bug fix for legacy themes that I didn't know I would have done but nonetheless I did you can thank me and you can also help me out keeping the channel alive and everything this month is actually doing great I'm very happy and although I won't reach as always my goal of 700 which will give would give me some financial stability we can reach like 500 so if you feel like offering me a pizza for all the stuff that I'm doing which is surely super helpful for you I know that you're using the fluffy bunny theme you are clearly using the fluffy bunny theme so now that I fixed the fluffy bunny theme I'm sure you will want to donate to my course and you know all the make kitty better stuff so thanks everybody for following and see you tomorrow with sorry yet another video bye this was so funny