<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/127646/">https://git.reviewboard.kde.org/r/127646/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 13th, 2016, 6:43 p.m. UTC, <b>Marco Martin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I don't like the api...
If I understand correctly you need the menu aligned with the task item not going over the taskbar also in cases of windows can cover?
I would prefer in this case another open method, something along the lines of open(Plasma::Types::Location) that would open the menu relative to the visualparent, aligning it depending on the location</p></pre>
</blockquote>
<p>On April 13th, 2016, 7:18 p.m. UTC, <b>Eike Hein</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">No, it has nothing to do with the panel or even the visual parent. By default QMenus open towards the bottom and right of $pos. If $pos is closer to the bottom or right of the screen than the menu is big, the menu will go as far bottom and right as it can, bumping against the screen edge. In the case of the Task Manager that means the menu covers the task button. Our Task Managers have always had code to avoid this and position the context menu either against the panel edge or (better, because of multi-row task managers) the task item. The old Task Manager applet had the same code I added here to accomplish this.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Your API suggestion is OK, but in some sense kind of doesn't overlap with this one. Your proposal would add a new API to position the menu relative to the visual parent with the Location enum (which I personally always felt is very very confusing, but I digress). This extends the coordinate-based API with a hint for how those coordinates should be respected.</p></pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Note: I can try writing the enum API if you still want me to though ...</p></pre>
<br />
<p>- Eike</p>
<br />
<p>On April 13th, 2016, 5:24 p.m. UTC, Eike Hein wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for Plasma.</div>
<div>By Eike Hein.</div>
<p style="color: grey;"><i>Updated April 13, 2016, 5:24 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This adds a parameter to open() to request the menu be positioned to collide against the supplied coordinates instead of the screen edge if there's insufficient space to show the entire menu next to the coordinates. This allows Task Manager-style positioning (which used to be hardcoded in C++ in the applet), where the menu is shown above a task item in a bottom panel and to the left of the task item in a right panel. Without this opt-in behavior, the menu goes as far below/right of the coordinates as it an until it collides with the screen edge, therefore overlapping with the item.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The new behavior defaults to off, to not change API behavior.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It's added as a new parameter instead of a declarative prop in keeping with the existing style - the open coordinates are not declarative either; the whole thing is treated as a one-shot procedural op.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This will be used by the Task Manager applet to position the task context menu more smartly.</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Tested with rtl locales as well.</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/declarativeimports/plasmacomponents/qmenu.h <span style="color: grey">(41e8865)</span></li>
<li>src/declarativeimports/plasmacomponents/qmenu.cpp <span style="color: grey">(2a96d77)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/127646/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>