<table><tr><td style="">mart added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8641" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D8641#167459" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D8641#167459</a>, <a href="https://phabricator.kde.org/p/hein/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@hein</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>So if I understand correctly, the Mnemonic stuff currently doesn't seem to have the same aims as KAcceleratorManager does ...</p>

<p>KAcceleratorManager acts on a hierarchy of widgets, traverses it, assigns weights to actionable things and possible mnemonics and overall smartly tries to distribute mnemonics across the hierarchy.</p>

<p>If I understand correctly this is more like a convenience wrapper around QKeySequence::mnemonic() that you can get both the label and a sequence to pass to shortcut to.</p></div>
</blockquote>

<p>no, it's kindof like kacceleratormanager.. but much more primitive, as it has just a single global pool in which accelerators are unique.</p>

<p>so what it would need and i may try, is to make and hash per different window, and then  have something about widgets hyerarchies.<br />
tough i was thinking that may be enough if is global per-window and shortcuts are unique based on only one enabled at the moment (so like if there is a stackview, only the topmost current page would be enabled)</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I'm not really sure about those static mappings members ... there currently doesn't seem to be any duplicate mnemonic tracking yet, right?</p></blockquote>

<p>basically it just avoids any duplicates... first come first served</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>My feeling is that this is still too much boiler plate for the dev. At least within a FormLayout, which has knowledge of what labels go with what, all the assignment should probably just happen automatically without needing to have your own Shortcut {} instances and getting the labels out of the Mnemonic thing. Do you think we can do that somehow?</p></blockquote>

<p>there would be boiler plate for who writes their own controls (which oone should try hard to avoid anyways)<br />
using a formlayout just works and for primitive controls should just work automatically as well, if this is done in the style.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Overall the code in KAcceleratorManagement is quite good and nicely commented, there's likely stuff of value in there (e.g. the algorithm it uses to weight mnemonic characters).</p></blockquote>

<p>i'll look at the algorythm to see if is reusable</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R169 Kirigami</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8641" rel="noreferrer">https://phabricator.kde.org/D8641</a></div></div><br /><div><strong>To: </strong>mart, Plasma, Kirigami, hein<br /><strong>Cc: </strong>colomar, ngraham, davidedmundson, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, hein<br /></div>