 Folks, it is done. The floating panel MergeQuest was accepted and it landed and it will be in Plasma 5.25. It is certain at this point. And to make you fully understand how important this is, these are all of the videos that I published talking about the floating panels. The first one is from back 27th of April 2021. It's more than a year since I started working on this. And it's rather important that I finally finished and it is over. It is done. It is implemented and I hope that you're proud of me to some extent, to some extent. And I also feel like I wanted to ask you something because I think I've done everything right. I have not been the quickest, but I've said I'm going to do my best to implement floating panels. I did. I've worked through it for more than a year. I've done regularly videos talking about the progress, what was happening, also going very in depth about the technical side of this MergeQuest, as I will do in this video as well. So I wanted to please ask you if you could do a small donation to my channel because yeah, it's been a year and I'm doing this in my free time. It took hours and hours and hours of work. So I have a Patreon, I have a PayPal, a LibraPay, if you prefer, since that's for open source. And also thank you to all of the people who has donated already to the cause. I've received many messages saying thank you for working on this. So I'm super happy that I managed to do this. And hopefully you're happy too. Maybe you don't care at all, but nonetheless, I am happy. So let me actually explain how we reached this important point. So I don't know if you know, but Katie Plasma has what's called release free feature fees, sorry, which is a day after which you should not land big merge requests with new features such as the floating panel. So even though Plasma 5.25 is still more than a month from now, today was like the strict deadline. If the panels weren't merged after before today, sorry, they were not going to be included in 5.25. So what I did is two days ago, I thought, okay, it's almost over. And it is like Monday, Tuesday, it is Tuesday. I still have Tuesday and Wednesday. And then on Thursday, there's the feature freeze. So I got a bit done by then. So I actually had a concert on Tuesday. So I had to go to another city to actually watch this concert. And while on the train, I worked on the floating panels and I was so happy because I was done. And I sent the merge request. I also sent this epi tweet, very optimistic from the train, showing how the floating panels work from the train and saying it is done. And then I arrived at the concert. And while I was in the concert, I received a message and I saw that my merge request was actually reviewed by Nate. You probably know him. And Nate found something like 10 bucks about it. It was completely broken. And I was at a concert knowing that I only had Wednesday at this point. And I saw that my patch was completely broken. So I kind of panicked, kind of, kind of. And the day after, because I mean at a concert, I can't like pop up my laptop and start coding. So the day after, while on the train, I went through the bugs that were mentioned and I realized that my code was like really bad, really bad. And so actually midway through the travel, I just closed my laptop and I was in a very sad, sad moment. Still, I reached my city. I had like a university meeting that I had to attend to. And while I was at the university meeting, I just opened a text editor and I was like, okay, my code is bad. That means nothing to me because I'm going to throw it all away and start from scratch. So I literally like my patch was 270 lines. I threw out of the window 250 of them and I started from scratch and it worked. So let me actually explain how it works. So first of all, let me show you how it actually works. This is the panel. Now right now it's not floating because our window is maximized, but as soon as they maximize it, it's floating. Now it's not floating, floating, not floating, floating. And it's just perfect now. And what was the issue? Let me open up color paint to actually show you. Just like last time, the issue was with animations because if no animation was to be made, then it would have been like a five minutes patch, but animation. So in my mind, I had like this. So you have a floating panel, you have a normal panel, and you have to animate between the two. And that sounds pretty easy, but this is not at all how the code actually looks like. What we also have in the panel is adaptive transparency, which means that when a window is maximized, the panel also becomes completely opaque. So we've got a normal transparent panel, but also an opaque one. So okay, that's not big deal. So when you actually maximize a window, it's not very noticeable right now, but it does work. The panel actually becomes opaque too. So what we are actually animating between are the states of the panel being floating and the panel being opaque. So this one doesn't actually, we don't actually have to do this one. And then, of course, we have to animate between the panel being opaque and the panel being normal, because if you don't use a floating panel, then you need that animation too. And I thought, okay, that's pretty easy. That's two animations to work on. It's actually four because two directions, but okay, that's pretty easy. But then I realized that you also have to animate between a floating transparent panel and a floating normal panel, which initially I thought was not going to happen, because you can actually go into the settings of the panel and say, please make the panel always transparent. In this case, well, in this case, yeah, you have to animate between a transparent floating panel and a transparent non-floating panel. But okay, these are now six animations instead of four, that's still fine. But then I realized that you do also have an option to make the panel opaque always, this option here, always have an opaque panel. So if you have an opaque floating panel, then the translucent floating panel doesn't work anymore. You also need an opaque floating panel, because if you want, if you ask the panel to be opaque and it's floating, it has to be opaque floating. So okay, now what is this link to? So of course, it has to animate between an opaque and non-floating. If you maximize a window, we also have to animate these two if you switch between the two. So now we went from four transitions to one, two, three, four, five, six, seven, eight, nine, 10. And I was like, okay, let's do them. So I actually wrote 10 different transitions between all of the states. However, that was a big mistake. For the simple reason that you might have this occurrence when you're like switching from a floating panel to a normal one like this. And then for whatever reason, you actually change the direction and you go towards an opaque one. And what happens in this case, what I thought in my mind, I was like, yeah, you're just going to play this animation right here. No, this one will actually stop midway. And then you're going to switch to this animation down here. And you're never going to finish the animation you started. And the panel is going to be floating midair because it never finished the animation that was off. So I tried to fix it and I couldn't. My very good idea to actually fix all of this, all of this while I was in the university meeting was, okay, let's throw everything away. And I'm a mathematician. So let's actually imagine this space, which is the space of all real numbers in a computer. There are floating numbers between zero and one with zero and one. So it's going to look like this. Okay, so we've got the y-axis, the x-axis. And we say, okay, so the y-axis is going to be the floating-ness, how much the panel is floating. The x-axis is going to be the opacity. So by doing this, I now say, okay, the panel is going to be as opaque as our x-coordinate. It's going to be as floating as the y-coordinate. And you can be wherever you want in this graph, you can be here, you can be here, you can be here, I don't care. For whatever position, I'm making sure that it has its representation in the panel. And how do I do that? Well, simple enough, I put inside the properties of the, as an example, opaque panel, opacity is x. Floating-ness is y. And that's it. So now if we are doing an animation from here to down here, and we have to change the direction, there is no issue. We just do this. And animation still supports it out of the box. If we change the direction again for whatever reason, it's still going to work. We can do whatever path we want. The animation is still going to work. Still. Now, I actually had a thought about this at the very beginning. And I thought it was not going to work, because we can't just say, okay, the floating-ness is y. And that's it. Because we have two different panels, the floating panel and the non-floating panel. And there has to be a point where the non-floating panel is going to be used. So what I actually said is, well, this is what in mathematics we call a closed, if there's any mathematician listening to this, please don't even try to correct me if I'm wrong, I'm a donker. This is what we call a closed space, meaning that we do have the borders too. And then we have the inside of it, which is this part. So we actually treat, I actually treat the inside and the borders differently. If we are inside of here, well, if we are there, I actually draw a floating transparent panel and the floating opaque panel. If instead, we are on the right margin, I'm only going to draw the transparent one, because opacity is one, sorry, the opposite. If you are here on the left, I'm only going to draw the translucent floating one, because I mean opacity is zero. We don't need opacity at all anyway. If we are down here, I'm, if we are down here, I'm actually going to draw both the non-floating opaque one and the non-floating transparent one. If we are on the right margin, then we don't actually need the translucent floating one. If we are here, well, this one is actually treated the same as below. And then in this point, this point, this point and this point, which is what you're actually in for like 99% of the time, this is just to do animations. In these four points, I only use one of the four SVGs. It sounds really complex when I explain it, but in code, it's just a matter of saying, okay, SVG number one, you are drawn if you are inside of this. This is a notation to say from zero to one multiplied by from zero to one, but this zero is not included. And this one is not included. So if the X value is zero, or the Y value is zero, then you're not inside of this. And then there's various combination of this, depending on where you put your parenthesis. And I give one of these to HSVG. And this corresponds to an area of my bigger space. And if they are inside of that area, they're going to be shown. And if they're shown, they get a certain opacity and floating less depending on their coordinate sounds complex. But when you actually do it in code, it's like 10 lines. So if you survived that very long explanation, how did it all end? So when I came up with this, I was super happy. So I sent again the merge request for review. And Nate was like, it's still broken though, less broken than before, but still broken. And I sent him a message and we tried to figure out what was broken exactly. And thank you so much, Nate, because I mean, technically speaking, I didn't keep you up for until midnight, because different time zones, but I stayed up till midnight to figure out everything that was broken. And when everything was figured out, the merge quest at my, like, I think it was two AM, I stayed up till two AM was actually merged. So I did it. It works. How does it work? So by default, it's pretty easy. So this is what you get out of the box, just this, and to get a floating panel, you just get into edit mode and you click on floating panel and it floats. That's it. When you maximize the window, as I said before, it deflots. And as you now know, because I spent so many hours to fix this wall, you can use all of the combinations of opacity, adaptive, opacity, opaque, translucent, it will just work. You can customize the margin around it in order to do that. You need to change your plasma theme. I will, if you're interested, interested to send me an email, I'm too tired to go through the plasma theming part of it. It does retain fit slow. So if you click outside of the panel, let me show you by zooming. Now the mouse is outside of the panel. But if I click, I still open up kickoff because the mouse input gets redirected inside of the panel, just for sure. It's not perfect by any means. I still have some improvements to just make an example. If I open up a context menu, then it's that context menu is not going to open as you can see attached to the panel. It usually does that. But no, it doesn't. But I mean, small stuff, right? Also, the outlets look slightly broken, slightly. I'm working on another merge request to make floating outlets. So that's coming too. And what else? That's everything. Really, really, if you want to, if you like this kind of features, if you want me to continue working on this and do the videos and everything. Again, it's my free time. And I have to just justify it somehow. I currently don't have any kind of part time job. And fun fact, my girlfriend does. And my mother's makes fun of me for not having any kind of job. Whilst my girlfriend makes lots of money. So subscribe to my Patreon to stop my mom being angry, I guess.