 Hi, so okay today. I wanted to investigate something that I had just thought of It's nothing important, but I was wondering if we could allow the plasma theme to set Border around dialogues to make them floating as an example such option would make Kickoff floating, but also the system tray hopefully just like I don't know the calendar or K-Runner potentially and so on and I think It should be I wouldn't say easy to implement because it won't but The it should be possible to have a clean implementation of this. So let's try it out This is yet again another KD frameworks plasma frameworks Sorry and change. So let's get to master It all because we're not create a new branch, which will core call work Nicole floating dialogues Okay, now we can start experimenting what we are editing is Plasma core dialogue and I always get this wrong. I think it's Plasma I Always get this wrong. So Can you help me dialogue dot H this one and It serves plasma quick and then dialogue. Okay, make sense again Always get it wrong and the C++ part of it. So What we want to change is the position of the dialogue. I've read a bit through the code which I don't Understand that well because it's not my area of competence, but it should kind of be but It's a C++ is not like my programming language, but still I've seen that there is a position Function which is called what was it again? Something about position not set position Not through position Just pop up position this one pop up position and let's go to the definition. Okay, this one Does a lot of math stuff. So what we want to do is First of all investigate where this function is called We probably need to change it here rather than anywhere else But let's give a look. So set visible. Okay This one is update visibility again. This sets the position This one geometry Update layout parameters. It's okay and then seem to mean item size Two times and that's it. Okay. So so what we can do So basically what this does is let's go through this function because it's very big First of all, if there is no item, so basically the dialogue is not attached to a particular, I don't know applet as an example like kickoff It's attached to the kickoff icon. So it stays near that icon If there is no such item, then it gets just it checks whether it's on top left bottom or right And in that case it position itself like top center bottom center Let's enter red center of or if there's no alignment just at the center of the screen very clean As an example kickoff, sorry co-runner is not attached to any item It's just positioned on top Meaning that it's center top. So if we try to change that. So this is the point This is the x coordinate. This is the y if we remove 30 pixels from here We should see that carander moves a bit to the bottom. So let's try out that out Right away. Again, this is to check out that we're actually working on something and We know what's going on. This is a nice wallpaper. It's a pity to change it Okay And it didn't work So kickoff is sorry caraner is still in the correct position Which is annoying because it really seemed Like it was supposed to move Let's try adding a bit of Minus 30s to see if anything happens. Yes, this is very professional. Yes, we got build errors Nice now much for operating minus between point and integer. Yes, you are right that Minus 30 should be inside of The parenthesis, maybe I'm confused and kickoff is actually not positioned by this but actually positioned by And by I'm sorry caraner. I keep saying kickoff caraner is positioned by hand in Caraner code it could be Yeah Well, if it's so then we can't do anything about it And what we can do which is ugly to a certain extent Is to make the screen smaller? Then it actually is This should like move the Dialogue accordingly. What's a veil? It is a top blah blah blah and then of course it checks Okay, so takes the geometry from the geometry builds this a veil and then based on the veil it positions the apply so if we make This a veil Smaller is it minus or plus? So it goes from zero. So plus 30 for the top one Minus 30 from the bottom one plus 30 for the left one and minus 30 Yeah, okay. So let's see this Changed anything. I will not try to preserve It's low so that clicks on the empty void will be redirected to the dialogue simply because it's Crazy like it makes sense for the panel, but as far as oh well It's something as far as dialogues go. No, that's not a good idea So it is positioned a bit more to the right Compared to the left side not For the bottom one it stays attached to the element. So we've got Something but not enough. Okay. So right point that point. Okay. So this one we should probably Change as well only just that one. I don't know. Let's see what happens Okay, so this one we've seen what happens Let's try to change this one this time This is a point so True elements item map rack to see item bonding wrecked with minus size with guess the top one X and then wine Okay, so this year is The point so plus 30 is the bottom point. So minus 30 here Plus 30 blah blah blah blah blah blah minus 30 Let's see what this one does. I mean, maybe the answer is nothing But who knows the easiest way to learn about an existing code base is to mess a bit with it and see what happens Okay, so nothing Okay, so that's not what we're looking for They will think was interesting Changing this parent geometry Bound is pretty useless. Yeah, we didn't change anything. So If dialogue post Y is less than a wheel top now, that's the bottom a dialogue plus Y Plus the height is more than a wheel bottom. So it's hitting bottom if it's on the top or on the bottom Just moves it vertically. Otherwise now it It moves it to the top point Okay, so first of all, let's try let's put again. This was the right right directions. So let's 60 this time and 60 Like this Okay, let's see if anything changed. Okay, so it is it does move. So It doesn't move vertically and My guess is that it's because of this Where is it set Y? Top point why? What if I say Minus 30 because basically what it seems to say is if it doesn't fit and it doesn't fit Then if it's on top on bottom and it is on bottom Set the Y coordinate to the top point of the item, which is the kickoff icon. So it says sets the Y to top of kickoff But what if we change This way coordinate what happens and this floating Not by the right amount though Maybe panel is like Not considered in this and now because I put 30 today. I just put 30 where am I? Year 30. Yes, and I put 60. Okay, so it is working as expected Let's put 44 again. Thank you Meaning that we need to change both this one and that one. Okay, so it's like this. I think I've got it top point We change it here directly X and Y so we do this minus 60 60 is a random number This is actually minus this is plus and then here minus 60 Okay, plus 60 Minus 60. Okay, this one should work and If it does then we just we also need to update the borders Thing is so that's another aspect to consider and then we need to actually read the Flutiness from the plasma thing, which is easy in QMR, but C++. I don't know No clue. Shouldn't be that hard Nah Danger it broke My guess was not right. So What's the point I? Bottom point Which is the one that we've just changed isn't it now? It's top point. Okay top point We had put like a minus 30. Maybe I swapped again the values the point let's try Because I had put minus before which makes sense Maybe I'm confusing the position of the points usually it's top plus Bottom minus, but seems like these points are for some reason which I don't fully understand inverted So maybe the signs are also wrong. Let's try It's a bit weird because if that would be the case the pop-up should go not up but below But not stand still stay still Okay, it is working Still doesn't look like the distance is correct But I guess it is so as you can see we're missing shadow Bottom there's not big issue of hello Okay Missing shadow on the bottom. That's something I was Considering so We need to look for the code that Decides on the Active what was it again? Let me check the documentation of Frame SVG Plasma curve SVG item maybe something like that Enabled borders this should be no this I don't know. Let's try it should be it somehow No There's it, okay This reads them This reads them Set enabled borders This is the sync borders functions. This is interesting line 2 1 7 Also this one. I know this one is no border not interesting So we can just look for this one and just these two so what we're interested in are This okay, so text the borders Converse them into enabled border and sets them So What we should say is in the borders Then we change it accordingly, but floating windows have all borders, so we need to Location isn't floating and Well, basically we what we'll put here is floating Floating margin from theme Equals zero which means that it's not floating and then it allows it to pick the right border, but Right now we're testing the flottiness. So we just put false Does false require? Capital F in C++. I think not yes Okay, so This one should put shadows on all four borders and then we can proudly say It is floating So let's try it out what okay, so now we get bottom shadow, but it doesn't float anymore so What happened is that borders is Variable that's checked in set position. So we should not mess with it Okay, it's weird. I mean it's declared here. What are we messing with? It should been shouldn't be used anywhere else maybe ah because it of course it checks for Enabled borders, okay. Yeah And it even does this in the set position function, which I can't find anymore Position blah blah blah blah blah. Yeah, if and Blah blah blah is not this but why is not this so basically what we it's saying is if this one is floating forget about constraints about the screen, but I Don't see why I mean I do understand the logic that if it's floating then It's not attached to any border Then it can stay whenever wherever it wants But at the same time at the same time Why should a floating dialogue be? Outside of the parent window Okay, so I'll just take it off for now. I'll discuss with with the maintainer to see what's the reasoning behind this like I get the general idea, but Probably I'm missing The specific use cases where these changes this change breaks something So for now, I'll take it off and then we can change. I mean if we need that we can just say and It's not floating Except if the floating nest is defined by the plasma team It's just a bit uglier, but if that's what we need to do, that's what we need to do right now. I just take it off Deal as issues Okay, so now it is floating on all four sides here but of course The footer is not rounded on the bottom It is floating Yes, it is the footer, but we can do anything about the broken footer. That's Entralling different not related to the thing in itself floating, so Okay, and It is floating So now what I will do is just replace the hard-coded values that we set with actual values read from the plasma team and Then the patch is pretty much ready I'll stop the video for now and I'll do this off-screen because I need to listen to a bit of music